You are here

function advanced_help_menu in Advanced Help 7

Same name and namespace in other branches
  1. 5 advanced_help.module \advanced_help_menu()
  2. 6 advanced_help.module \advanced_help_menu()

Implements hook_menu().

Strings in hook_menu() should not be run through t().

File

./advanced_help.module, line 66
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_menu() {
  $help_exists = module_exists('help') ? TRUE : FALSE;
  if ($help_exists) {

    // Add tabs to core Help page to access Advanced Help.
    $items['admin/help/tab1'] = array(
      'title' => 'Help',
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => 0,
    );
    $items['admin/help/ah'] = array(
      'title' => 'Advanced Help',
      'page callback' => 'advanced_help_index_page',
      'access arguments' => array(
        'view advanced help index',
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 2,
    );
  }
  else {

    // Make Advanced Help the normal help.
    $items['admin/help/ah'] = array(
      'title' => 'Help',
      'page callback' => 'advanced_help_index_page',
      'access arguments' => array(
        'view advanced help index',
      ),
      'type' => MENU_NORMAL_ITEM,
      'weight' => 9,
    );
  }
  $items['help/ah/search/%'] = array(
    'title' => 'Search help',
    'page callback' => 'advanced_help_search_view',
    'page arguments' => array(
      'advanced_help',
    ),
    'access arguments' => array(
      'view advanced help index',
    ),
  );

  // View help topic.
  $items['help/%/%'] = array(
    'page callback' => 'advanced_help_topic_page',
    'page arguments' => array(
      1,
      2,
    ),
    'access arguments' => array(
      'view advanced help topic',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}