function token_menu in Token 7
Same name and namespace in other branches
- 6 token.module \token_menu()
Implements hook_menu().
File
- ./
token.module, line 54 - Enhances the token API in core: adds a browseable UI, missing tokens, etc.
Code
function token_menu() {
/*$items['token/autocomplete/all/%menu_tail'] = array(
'page callback' => 'token_autocomplete',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
'file' => 'token.pages.inc',
);*/
$items['token/autocomplete/%token_type'] = array(
'page callback' => 'token_autocomplete_token',
'page arguments' => array(
2,
),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
'file' => 'token.pages.inc',
);
/*$items['token/autocomplete/%token_type/%menu_tail'] = array(
'page callback' => 'token_autocomplete_token',
'page arguments' => array(2, 3),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
'file' => 'token.pages.inc',
);*/
$items['token/tree'] = array(
'page callback' => 'token_page_output_tree',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
'file' => 'token.pages.inc',
'theme callback' => 'ajax_base_page_theme',
);
// Devel token pages.
if (module_exists('devel')) {
$items['node/%node/devel/token'] = array(
'title' => 'Tokens',
'page callback' => 'token_devel_token_object',
'page arguments' => array(
'node',
1,
),
'access arguments' => array(
'access devel information',
),
'type' => MENU_LOCAL_TASK,
'file' => 'token.pages.inc',
'weight' => 5,
);
$items['comment/%comment/devel/token'] = array(
'title' => 'Tokens',
'page callback' => 'token_devel_token_object',
'page arguments' => array(
'comment',
1,
),
'access arguments' => array(
'access devel information',
),
'type' => MENU_LOCAL_TASK,
'file' => 'token.pages.inc',
'weight' => 5,
);
$items['taxonomy/term/%taxonomy_term/devel/token'] = array(
'title' => 'Tokens',
'page callback' => 'token_devel_token_object',
'page arguments' => array(
'taxonomy_term',
2,
),
'access arguments' => array(
'access devel information',
),
'type' => MENU_LOCAL_TASK,
'file' => 'token.pages.inc',
'weight' => 5,
);
$items['user/%user/devel/token'] = array(
'title' => 'Tokens',
'page callback' => 'token_devel_token_object',
'page arguments' => array(
'user',
1,
),
'access arguments' => array(
'access devel information',
),
'type' => MENU_LOCAL_TASK,
'file' => 'token.pages.inc',
'weight' => 5,
);
}
// Admin menu callback to clear token caches.
$items['token/flush-cache'] = array(
'page callback' => 'token_flush_cache_callback',
'access arguments' => array(
'flush caches',
),
'type' => MENU_CALLBACK,
'file' => 'token.pages.inc',
);
return $items;
}