_poll_choice_form
modules/poll/poll.module, строка 295
- Версии
- 6
_poll_choice_form($delta, $value = '', $votes = 0)
Код
<?php
function _poll_choice_form($delta, $value = '', $votes = 0) {
$admin = user_access('administer nodes');
$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'),
);
if ($admin) {
$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'),
);
}
return $form;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии