You are here

function token_custom_menu in Custom Tokens 5

Same name and namespace in other branches
  1. 6 token_custom.module \token_custom_menu()
  2. 7.2 token_custom.module \token_custom_menu()
  3. 7 token_custom.module \token_custom_menu()

Implementation of hook_menu().

File

./token_custom.module, line 36

Code

function token_custom_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/build/tokens',
      'title' => t('Tokens'),
      'callback' => 'token_custom_page',
      'access' => user_access('create PHP code for execution by Custom Tokens'),
    );
    $items[] = array(
      'path' => 'admin/build/tokens/list',
      'title' => t('List'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -1,
    );
    $items[] = array(
      'path' => 'admin/build/tokens/create',
      'callback' => 'token_custom_create_page',
      'title' => t('Create'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/tokens/help',
      'callback' => 'theme',
      'callback arguments' => array(
        'token_help',
      ),
      'title' => t('Tokens'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/tokens/edit',
      'callback' => 'token_custom_edit_page',
      'title' => t('Edit'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/build/tokens/delete',
      'callback' => 'token_custom_delete_page',
      'title' => t('Edit'),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}