_poll_choice_form

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 _poll_choice_form($delta, $value = '', $votes = 0)
drupal7 _poll_choice_form($key, $chid = NULL, $value = '', $votes = 0, $weight = 0, $size = 10)

Code

modules/poll/poll.module, line 296

<?php
function _poll_choice_form($delta, $value = '', $votes = 0) {
  $form = array(
    '#tree' => TRUE,
  );

  // We'll manually set the #parents property of these fields so that
  // their values appear in the $form_state['values']['choice'] array.
  $form['chtext'] = array(
    '#type' => 'textfield',
    '#title' => t('Choice @n', array('@n' => ($delta + 1))),
    '#default_value' => $value,
    '#parents' => array('choice', $delta, 'chtext'),
  );
  $form['chvotes'] = array(
    '#type' => 'textfield',
    '#title' => t('Votes for choice @n', array('@n' => ($delta + 1))),
    '#default_value' => $votes,
    '#size' => 5,
    '#maxlength' => 7,
    '#parents' => array('choice', $delta, 'chvotes'),
    '#access' => user_access('administer nodes'),
  );

  return $form;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen