function token_custom_menu in Custom Tokens 7
Same name and namespace in other branches
- 5 token_custom.module \token_custom_menu()
- 6 token_custom.module \token_custom_menu()
- 7.2 token_custom.module \token_custom_menu()
Implementation of hook_menu().
File
- ./
token_custom.module, line 50 - It gives the user the ability to create custom tokens using PHP code for specific replacements that can improve other modules relying on the token Drupal 7 core API.
Code
function token_custom_menu() {
$items['admin/structure/token-custom'] = array(
'title' => 'Custom tokens',
'description' => 'Administrate custom tokens.',
'page callback' => 'token_custom_list_page',
'access arguments' => array(
'list custom tokens',
),
'file' => 'token_custom.admin.inc',
);
$items['admin/structure/token-custom/list'] = array(
'title' => 'List',
'description' => 'List of custom tokens.',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/token-custom/add'] = array(
'title' => 'Add token',
'description' => 'Create custom tokens',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'token_custom_edit_form',
'add',
),
'access arguments' => array(
'administer custom tokens',
),
'file' => 'token_custom.admin.inc',
'weight' => 1,
'type' => MENU_LOCAL_ACTION,
);
$items['admin/structure/token-custom/%token_custom/edit'] = array(
'title' => 'Edit token',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'token_custom_edit_form',
'edit',
3,
),
'access arguments' => array(
'administer custom tokens',
),
'file' => 'token_custom.admin.inc',
'type' => MENU_CALLBACK,
'weight' => 10,
);
$items['admin/structure/token-custom/%token_custom/delete'] = array(
'title' => 'Delete custom token',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'token_custom_delete_confirm_form',
3,
),
'access arguments' => array(
'administer custom tokens',
),
'file' => 'token_custom.admin.inc',
);
return $items;
}