function theme_poll_bar in Drupal 4
Same name and namespace in other branches
- 5 modules/poll/poll.module \theme_poll_bar()
1 theme call to theme_poll_bar()
- poll_view_results in modules/
poll.module - Generates a graphical representation of the results of a poll.
File
- modules/
poll.module, line 372 - Enables your site to capture votes on different topics in the form of multiple choice questions.
Code
function theme_poll_bar($title, $percentage, $votes, $block) {
if ($block) {
$output = '<div class="text">' . $title . '</div>';
$output .= '<div class="bar"><div style="width: ' . $percentage . '%;" class="foreground"></div></div>';
$output .= '<div class="percent">' . $percentage . '%</div>';
}
else {
$output = '<div class="text">' . $title . '</div>';
$output .= '<div class="bar"><div style="width: ' . $percentage . '%;" class="foreground"></div></div>';
$output .= '<div class="percent">' . $percentage . '% (' . $votes . ')</div>';
}
return $output;
}