function advpoll_menu in Advanced Poll 6.2
Same name and namespace in other branches
- 5 advpoll.module \advpoll_menu()
- 6.3 advpoll.module \advpoll_menu()
- 6 advpoll.module \advpoll_menu()
- 7.3 advpoll.module \advpoll_menu()
- 7 advpoll.module \advpoll_menu()
- 7.2 advpoll.module \advpoll_menu()
Implementation of hook_menu().
File
- ./
advpoll.module, line 84 - Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.
Code
function advpoll_menu() {
global $user;
$modes = _advpoll_list_modes();
$menu = array();
$menu['advpoll/cancel/%node'] = array(
'title' => 'Cancel Vote',
'page callback' => 'advpoll_cancel',
'page arguments' => array(
2,
),
'access arguments' => array(
'cancel own vote',
),
'type' => MENU_CALLBACK,
'file' => 'advpoll.admin.inc',
);
$menu['advpoll/js_vote'] = array(
'title' => 'Vote via JavaScript',
'page callback' => 'advpoll_js_vote',
'access arguments' => array(
'vote on polls',
),
// TODO: be more specific here.
'type' => MENU_CALLBACK,
);
$menu['advpoll/js_more_choices'] = array(
'title' => 'More Choices via JavaScript',
'page callback' => 'advpoll_js_more_choices',
'access arguments' => array(
'access content',
),
// TODO: be more specific here.
'type' => MENU_CALLBACK,
);
$menu['polls'] = array(
'title' => 'Advanced Polls',
'page callback' => 'advpoll_page',
'access arguments' => array(
'access content',
),
'type' => MENU_SUGGESTED_ITEM,
'file' => 'advpoll.pages.inc',
);
$menu['node/%node/results'] = array(
'title' => 'Results',
'page callback' => 'advpoll_results_page',
'page arguments' => array(
1,
),
'access callback' => '_advpoll_results_access',
'access arguments' => array(
1,
),
'weight' => 3,
'type' => MENU_LOCAL_TASK,
'file' => 'advpoll.pages.inc',
);
$menu['node/%node/votes'] = array(
'title' => 'Votes',
'page callback' => 'advpoll_votes_page',
'page arguments' => array(
1,
),
'access callback' => '_advpoll_votes_access',
'access arguments' => array(
1,
),
'weight' => 3,
'type' => MENU_LOCAL_TASK,
'file' => 'advpoll.pages.inc',
);
// Show electoral list tab if using the functionality.
$menu['node/%node/electoral_list'] = array(
'title' => 'Electoral list',
'page callback' => 'advpoll_electoral_list_page',
'page arguments' => array(
1,
),
'access callback' => '_advpoll_electoral_list_access',
'access arguments' => array(
1,
),
'weight' => 3,
'type' => MENU_LOCAL_TASK,
'file' => 'advpoll.pages.inc',
);
// Allow voters to be removed.
$menu['node/%node/remove'] = array(
'page callback' => 'advpoll_remove_voter',
'page arguments' => array(
1,
),
'access arguments' => array(
'administer polls',
),
'weight' => 3,
'type' => MENU_CALLBACK,
'file' => 'advpoll.admin.inc',
);
// Allow votes to be cleared.
$menu['node/%node/votes/clear'] = array(
'page callback' => 'advpoll_clear_votes_page',
'page arguments' => array(
1,
),
'access callback' => '_advpoll_clear_votes_access',
'access arguments' => array(
1,
),
'weight' => 3,
'type' => MENU_LOCAL_TASK,
'file' => 'advpoll.pages.inc',
);
// Show the write-ins tab if there is at least one.
$menu['node/%node/writeins'] = array(
'title' => 'Write-ins',
'page callback' => 'advpoll_writeins_page',
'page arguments' => array(
1,
),
'access callback' => '_advpoll_writeins_access',
'access arguments' => array(
1,
),
'weight' => 3,
'type' => MENU_LOCAL_TASK,
'file' => 'advpoll.pages.inc',
);
return $menu;
}