function template_preprocess_poll_bar
Same name and namespace in other branches
- 7.x drupal-7.x/modules/poll/poll.module \template_preprocess_poll_bar()
Preprocess the poll_bar theme hook.
Inputs: $title, $votes, $total_votes, $voted, $block
See also
Archivo
- drupal-6.x/
modules/ poll/ poll.module, line 727 - Enables your site to capture votes on different topics in the form of multiple choice questions.
Código
function template_preprocess_poll_bar(&$variables) {
if ($variables['block']) {
$variables['template_files'][] = 'poll-bar-block';
}
$variables['title'] = check_plain($variables['title']);
$variables['percentage'] = round($variables['votes'] * 100 / max($variables['total_votes'], 1));
}