You are here

function _advpoll_can_view_results in Advanced Poll 6.3

Same name and namespace in other branches
  1. 5 advpoll.module \_advpoll_can_view_results()
  2. 6 advpoll.module \_advpoll_can_view_results()
  3. 6.2 advpoll.module \_advpoll_can_view_results()

Helper function to abstract view results checking.

1 call to _advpoll_can_view_results()
_advpoll_results_access in ./advpoll.module
Results access callback.

File

./advpoll.module, line 1100
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function _advpoll_can_view_results($node) {
  $advpollSettings = variable_get('advpoll_settings', array());
  $view_results = !empty($advpollSettings['show_results']) ? $advpollSettings['show_results'] : 'aftervote';
  return !_advpoll_is_active($node) || $node->voted && $view_results == 'aftervote' || $view_results == 'always';

  // All can view
}