You are here

function _advpoll_results_access in Advanced Poll 7.2

Same name and namespace in other branches
  1. 6.3 advpoll.module \_advpoll_results_access()
  2. 6 advpoll.module \_advpoll_results_access()
  3. 6.2 advpoll.module \_advpoll_results_access()
  4. 7.3 advpoll.module \_advpoll_results_access()
  5. 7 advpoll.module \_advpoll_results_access()

Results access callback.

Results tab displays the same bar graph of poll results that is displayed after casting a vote. It offers a means for users with the appropriate access to be able to see the results without having to vote or in cases where results are never displayed.

Parameters

$node: An advanced poll node.

Return value

Returns TRUE or FALSE

1 string reference to '_advpoll_results_access'
advpoll_menu in ./advpoll.module
Implements hook_menu()

File

./advpoll.module, line 968

Code

function _advpoll_results_access($node) {
  if ($node->type == 'advpoll') {
    $data = advpoll_get_data($node);
    $votes = advpoll_get_votes($node->nid);
    return $data->show_results && $votes['total'] > 0 && (user_access("show vote results") || user_access('administer polls'));
  }
}