poll-results.tpl.php

  1. drupal
    1. 6 modules/poll/poll-results.tpl.php
    2. 7 modules/poll/poll-results.tpl.php
    3. 8 core/modules/poll/poll-results.tpl.php

Default theme implementation to display the poll results in a block.

Variables available:

  • $title: The title of the poll.
  • $results: The results of the poll.
  • $votes: The total results in the poll.
  • $links: Links in the poll.
  • $nid: The nid of the poll
  • $cancel_form: A form to cancel the user's vote, if allowed.
  • $raw_links: The raw array of links.
  • $vote: The choice number of the current user's vote.

See also

template_preprocess_poll_results()

1 theme call to poll-results.tpl.php

File

core/modules/poll/poll-results.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display the poll results in a block.
  5. *
  6. * Variables available:
  7. * - $title: The title of the poll.
  8. * - $results: The results of the poll.
  9. * - $votes: The total results in the poll.
  10. * - $links: Links in the poll.
  11. * - $nid: The nid of the poll
  12. * - $cancel_form: A form to cancel the user's vote, if allowed.
  13. * - $raw_links: The raw array of links.
  14. * - $vote: The choice number of the current user's vote.
  15. *
  16. * @see template_preprocess_poll_results()
  17. */
  18. ?>
  19. <div class="poll">
  20. <?php if ($block): ?>
  21. <h3 class="poll-title"><?php print $title; ?></h3>
  22. <?php endif; ?>
  23. <dl>
  24. <?php print $results; ?>
  25. </dl>
  26. <div class="total">
  27. <?php print t('Total votes: @votes', array('@votes' => $votes)); ?>
  28. </div>
  29. <?php if (!empty($cancel_form)): ?>
  30. <?php print $cancel_form; ?>
  31. <?php endif; ?>
  32. </div>
  33. <?php if ($block): ?>
  34. <div class="links"><?php print $links; ?></div>
  35. <?php endif; ?>
Login or register to post comments