You are here

function token_help in Token 7

Same name and namespace in other branches
  1. 8 token.module \token_help()
  2. 5 token.module \token_help()
  3. 6 token.module \token_help()

Implements hook_help().

File

./token.module, line 16
Enhances the token API in core: adds a browseable UI, missing tokens, etc.

Code

function token_help($path, $arg) {
  if ($path == 'admin/help#token') {
    if (current_path() != 'admin/help/token') {

      // Because system_modules() executes hook_help() for each module to 'test'
      // if they will return anything, but not actually display it, we want to
      // return a TRUE value if this is not actually the help page.
      return TRUE;
    }
    $output = '<dl>';
    $output .= '<dt>' . t('List of the currently available tokens on this site') . '</dt>';
    $output .= '<dd>' . theme('token_tree', array(
      'token_types' => 'all',
      'click_insert' => FALSE,
      'show_restricted' => TRUE,
    )) . '</dd>';
    $output .= '</dl>';
    return $output;
  }
}