function poll_view
7.x poll.module | poll_view($node, |
6.x poll.module | poll_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) |
Implements hook_view().
File
- drupal-7.x/
modules/ poll/ poll.module, line 676 - Enables your site to capture votes on different topics in the form of multiple choice questions.
Code
function poll_view($node, $view_mode) {
global $user;
$output = '';
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;
}