Commit a83d8f43 authored by Sascha Eggenberger's avatar Sascha Eggenberger
Browse files

New drupal navigation: Add check if help is enabled

parent 4d009eaf
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -21,6 +21,13 @@ function gin_theme() {
    $icon_path = $settings->getDefault('logo.path');
  }

  //Check if help is enabled.
  $help_enabled = FALSE;
  $module_handler = \Drupal::service('module_handler');
  if ($module_handler->moduleExists('help')) {
    $help_enabled = TRUE;
  }

  $items['navigation'] = [
    'variables' => [
      'icon_path' => $icon_path,
@@ -51,6 +58,7 @@ function gin_theme() {

  $items['menu_region__bottom'] = [
    'variables' => [
      'help_enabled' => $help_enabled,
      'items' => [],
      'title' => NULL,
      'menu_name' => NULL,
+1 −1
Original line number Diff line number Diff line
@@ -423,7 +423,7 @@ class GinSettings implements ContainerInjectionInterface {
        'vertical' => $this->t('Sidebar, Vertical Toolbar (Default)'),
        'horizontal' => $this->t('Horizontal, Modern Toolbar'),
        'classic' => $this->t('Legacy, Classic Drupal Toolbar'),
        'new' => $this->t('New Drupal Navigation') . $experimental_label,
        'new' => $this->t('New Drupal Navigation, Test integration') . $experimental_label,
      ],
      '#after_build' => [
        '_gin_toolbar_radios',
+2 −0
Original line number Diff line number Diff line
@@ -6,11 +6,13 @@
        <span id="sidebar-state">{{ 'Collapse sidebar'|t }}</span>
      </button>
    </li>
    {% if help_enabled %}
    <li class="menu-item level-1">
      <a href="{{ path('help.main') }}" class="navigation-link navigation-link--has-icon navigation-link--help">
        <span>{{ 'Help'|t }}</span>
      </a>
    </li>
    {% endif %}
    <li class="navigation-menu__user menu-item menu-item--has-dropdown level-1">
      <button class="navigation-link navigation-link--has-icon navigation-link--{{ menu_name|clean_class }}">
        <span class="action">{{ 'Extend'|t }}</span>