function _poll_choice_form

Same name and namespace in other branches
  1. 7.x drupal-7.x/modules/poll/poll.module \_poll_choice_form()
1 call to _poll_choice_form()
poll_form in drupal-6.x/modules/poll/poll.module
Implementation of hook_form().

Archivo

drupal-6.x/modules/poll/poll.module, line 293
Enables your site to capture votes on different topics in the form of multiple choice questions.

Código

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;
}