You are here

function menu_ui_help in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/menu_ui/menu_ui.module \menu_ui_help()

Implements hook_help().

File

core/modules/menu_ui/menu_ui.module, line 34
Allows administrators to customize the site's navigation menus.

Code

function menu_ui_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.menu_ui':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Menu UI module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. For more information, see the <a href=":menu">online documentation for the Menu UI module</a>.', array(
        ':menu' => 'https://www.drupal.org/documentation/modules/menu/',
      )) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Managing menus') . '</dt>';
      $output .= '<dd>' . t('Users with the <em>Administer menus and menu items</em> permission can add, edit, and delete custom menus on the <a href=":menu">Menus page</a>. Custom menus can be special site menus, menus of external links, or any combination of internal and external links. You may create an unlimited number of additional menus, each of which will automatically have an associated block (if you have the <a href=":block_help">Block module</a> installed). By selecting <em>Edit menu</em>, you can add, edit, or delete links for a given menu. The links listing page provides a drag-and-drop interface for controlling the order of links, and creating a hierarchy within the menu.', array(
        ':block_help' => \Drupal::moduleHandler()
          ->moduleExists('block') ? \Drupal::url('help.page', array(
          'name' => 'block',
        )) : '#',
        ':menu' => \Drupal::url('entity.menu.collection'),
      )) . '</dd>';
      $output .= '<dt>' . t('Displaying menus') . '</dt>';
      $output .= '<dd>' . t('If you have the Block module enabled, then each menu that you create is rendered in a block that you enable and position on the <a href=":blocks">Block layout page</a>. In some <a href=":themes">themes</a>, the main menu and possibly the secondary menu will be output automatically; you may be able to disable this behavior on the <a href=":themes">theme\'s settings page</a>.', array(
        ':blocks' => \Drupal::moduleHandler()
          ->moduleExists('block') ? \Drupal::url('block.admin_display') : '#',
        ':themes' => \Drupal::url('system.themes_page'),
        ':theme_settings' => \Drupal::url('system.theme_settings'),
      )) . '</dd>';
      $output .= '</dl>';
      return $output;
  }
  if ($route_name == 'entity.menu.add_form' && \Drupal::moduleHandler()
    ->moduleExists('block') && \Drupal::currentUser()
    ->hasPermission('administer blocks')) {
    return '<p>' . t('You can enable the newly-created block for this menu on the <a href=":blocks">Block layout page</a>.', array(
      ':blocks' => \Drupal::url('block.admin_display'),
    )) . '</p>';
  }
  elseif ($route_name == 'entity.menu.collection' && \Drupal::moduleHandler()
    ->moduleExists('block') && \Drupal::currentUser()
    ->hasPermission('administer blocks')) {
    return '<p>' . t('Each menu has a corresponding block that is managed on the <a href=":blocks">Block layout page</a>.', array(
      ':blocks' => \Drupal::url('block.admin_display'),
    )) . '</p>';
  }
}