function template_preprocess_poll_bar
template_preprocess_poll_bar(&$variables)
Preprocess the poll_bar theme hook.
Inputs: $title, $votes, $total_votes, $voted, $block
See also
File
- modules/poll/poll.module, line 922
- Enables your site to capture votes on different topics in the form of multiple choice questions.
Code
function template_preprocess_poll_bar(&$variables) { if ($variables['block']) { $variables['theme_hook_suggestions'][] = 'poll_bar__block'; } $variables['title'] = check_plain($variables['title']); $variables['percentage'] = round($variables['votes'] * 100 / max($variables['total_votes'], 1)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!poll!poll.module/function/template_preprocess_poll_bar/7.x