theme_poll_choices
modules/poll/poll.module, строка 664
- Версии
- 6
theme_poll_choices($form)
Theme the admin poll form for choices.
Связанные темы
Код
<?php
function theme_poll_choices($form) {
// Change the button title to reflect the behavior when using JavaScript.
drupal_add_js('if (Drupal.jsEnabled) { $(document).ready(function() { $("#edit-poll-more").val("'. t('Add another choice') .'"); }); }', 'inline');
$rows = array();
$headers = array(
t('Choice'),
t('Vote count'),
);
foreach (element_children($form) as $key) {
// No need to print the field title every time.
unset($form[$key]['chtext']['#title'], $form[$key]['chvotes']['#title']);
// Build the table row.
$row = array(
'data' => array(
array('data' => drupal_render($form[$key]['chtext']), 'class' => 'poll-chtext'),
array('data' => drupal_render($form[$key]['chvotes']), 'class' => 'poll-chvotes'),
),
);
// Add additional attributes to the row, such as a class for this row.
if (isset($form[$key]['#attributes'])) {
$row = array_merge($row, $form[$key]['#attributes']);
}
$rows[] = $row;
}
$output = theme('table', $headers, $rows);
$output .= drupal_render($form);
return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии