You are here

function poll_view in Drupal 7

Same name and namespace in other branches
  1. 4 modules/poll.module \poll_view()
  2. 5 modules/poll/poll.module \poll_view()
  3. 6 modules/poll/poll.module \poll_view()

Implements hook_view().

File

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

Code

function poll_view($node, $view_mode) {
  if (!empty($node->allowvotes) && empty($node->show_results)) {
    $node->content['poll_view_voting'] = drupal_get_form('poll_view_voting', $node);
  }
  else {
    $node->content['poll_view_results'] = array(
      '#markup' => poll_view_results($node, $view_mode),
    );
  }
  return $node;
}