You are here

function _advpoll_can_view_results in Advanced Poll 6.2

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

Helper function to abstract view results checking.

2 calls to _advpoll_can_view_results()
advpoll_view_results in ./advpoll.module
Show results of the vote.
_advpoll_results_access in ./advpoll.module
Results access callback.

File

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

Code

function _advpoll_can_view_results($node) {
  $view_results = variable_get('advpoll_view_results_' . $node->type, ADVPOLL_VIEW_RESULTS);
  return !_advpoll_is_active($node) || $node->voted && $view_results == 'aftervote' || $view_results == 'always';

  // All can view
}