poll-bar.tpl.php

  1. 7.x drupal-7.x/modules/poll/poll-bar.tpl.php
  2. 6.x drupal-6.x/modules/poll/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.php
View source
  1. <?php
  2. /**
  3. * @file poll-bar.tpl.php
  4. * Display the bar for a single choice in a poll
  5. *
  6. * Variables available:
  7. * - $title: The title of the poll.
  8. * - $votes: The number of votes for this choice
  9. * - $total_votes: The number of votes for this choice
  10. * - $percentage: The percentage of votes for this choice.
  11. * - $vote: The choice number of the current user's vote.
  12. * - $voted: Set to TRUE if the user voted for this choice.
  13. *
  14. * @see template_preprocess_poll_bar()
  15. */
  16. ?>
  17. <div class="text"><?php print $title; ?></div>
  18. <div class="bar">
  19. <div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
  20. </div>
  21. <div class="percent">
  22. <?php print $percentage; ?>% (<?php print format_plural($votes, '1 vote', '@count votes'); ?>)
  23. </div>