function poll_view

poll_view($node, $view_mode)

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!poll!poll.module/function/poll_view/7.x