function _advpoll_results_access in Advanced Poll 7.2
Same name and namespace in other branches
- 6.3 advpoll.module \_advpoll_results_access()
- 6 advpoll.module \_advpoll_results_access()
- 6.2 advpoll.module \_advpoll_results_access()
- 7.3 advpoll.module \_advpoll_results_access()
- 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'));
}
}