poll-bar.tpl.php
poll-bar.tpl.php Display the bar for a single choice in a poll
Variables available:
- $title: The title of the poll.
- $votes: The number of votes for this choice
- $total_votes: The number of votes for this choice
- $percentage: The percentage of votes for this choice.
- $vote: The choice number of the current user's vote.
- $voted: Set to TRUE if the user voted for this choice.
See also
template_preprocess_poll_bar()
1 theme call to poll-bar.tpl.php
- poll_view_results in drupal-6.x/
modules/ poll/ poll.module - Generates a graphical representation of the results of a poll.
File
drupal-6.x/modules/poll/poll-bar.tpl.phpView source
- <?php
-
- /**
- * @file poll-bar.tpl.php
- * Display the bar for a single choice in a poll
- *
- * Variables available:
- * - $title: The title of the poll.
- * - $votes: The number of votes for this choice
- * - $total_votes: The number of votes for this choice
- * - $percentage: The percentage of votes for this choice.
- * - $vote: The choice number of the current user's vote.
- * - $voted: Set to TRUE if the user voted for this choice.
- *
- * @see template_preprocess_poll_bar()
- */
- ?>
-
- <div class="text"><?php print $title; ?></div>
- <div class="bar">
- <div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
- </div>
- <div class="percent">
- <?php print $percentage; ?>% (<?php print format_plural($votes, '1 vote', '@count votes'); ?>)
- </div>
-