You are here

function theme_poll_results in Drupal 5

Same name and namespace in other branches
  1. 4 modules/poll.module \theme_poll_results()
1 theme call to theme_poll_results()
poll_view_results in modules/poll/poll.module
Generates a graphical representation of the results of a poll.

File

modules/poll/poll.module, line 426
Enables your site to capture votes on different topics in the form of multiple choice questions.

Code

function theme_poll_results($title, $results, $votes, $links, $block, $nid, $vote) {
  if ($block) {
    $output .= '<div class="poll">';
    $output .= '<div class="title">' . $title . '</div>';
    $output .= $results;
    $output .= '<div class="total">' . t('Total votes: %votes', array(
      '%votes' => $votes,
    )) . '</div>';
    $output .= '</div>';
    $output .= '<div class="links">' . theme('links', $links) . '</div>';
  }
  else {
    $output .= '<div class="poll">';
    $output .= $results;
    $output .= '<div class="total">' . t('Total votes: %votes', array(
      '%votes' => $votes,
    )) . '</div>';
    if (isset($vote) && $vote > -1 && user_access('cancel own vote')) {
      $output .= drupal_get_form('poll_cancel_form', $nid);
    }
    $output .= '</div>';
  }
  return $output;
}