Commit 4d009eaf authored by Sascha Eggenberger's avatar Sascha Eggenberger
Browse files

New drupal navigation: fix phpcs

parent c7708472
Loading
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
 */

use Drupal\gin\GinContentFormHelper;
use Drupal\gin\GinSettings;
use Drupal\gin\GinNavigation;
use Drupal\gin\GinSettings;

/**
 * Implements hook_preprocess_HOOK() for html.
@@ -46,16 +46,12 @@ function gin_preprocess_html(&$variables) {
      return;
    }

    // Check for new Drupal navigation
    // Check for new Drupal navigation.
    if ($toolbar === 'new') {
      // Activate navigation.
      // unset($variables['page_top']['toolbar']);

      // Get navigation items.
      /** @var \Drupal\gin\GinNavigaton $navigation */
      $navigation = \Drupal::classResolver(GinNavigation::class);

      // Set menus.
      // Get navigation items.
      $menu['top']['bookmarks'] = $navigation->getNavigationBookmarksMenuItems();
      $menu['middle']['content'] = $navigation->getNavigationContentMenuItems();
      $menu['middle']['admin'] = $navigation->getNavigationAdminMenuItems();
@@ -84,7 +80,8 @@ function gin_preprocess_html(&$variables) {

      // Set toolbar class.
      $variables['attributes']['class'][] = 'gin--navigation';
    } else {
    }
    else {
      // Set toolbar class.
      $variables['attributes']['class'][] = 'gin--' . $toolbar . '-toolbar';
    }
+7 −2
Original line number Diff line number Diff line
@@ -33,7 +33,12 @@ function gin_theme() {

  $items['menu_region__middle'] = [
    'base hook' => 'menu',
    'variables' => ['menu_name' => NULL, 'items' => [], 'attributes' => [], 'title' => NULL],
    'variables' => [
      'menu_name' => NULL,
      'items' => [],
      'attributes' => [],
      'title' => NULL,
    ],
  ];

  $items['menu_region__top'] = [
+5 −15
Original line number Diff line number Diff line
@@ -2,23 +2,17 @@

namespace Drupal\gin;

use Drupal\Core\Url;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Core\Url;
use Drupal\taxonomy\Entity\Vocabulary;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Service to handle overridden user settings.
 */
class GinNavigation implements ContainerInjectionInterface {
  /**
   * Settings constructor.
   *
   */
  public function __construct() {}

  /**
   * {@inheritdoc}
@@ -29,7 +23,6 @@ class GinNavigation implements ContainerInjectionInterface {

  /**
   * Get Navigation Admin Menu Items.
   *
   */
  public function getNavigationAdminMenuItems(): array {
    $parameters = new MenuTreeParameters();
@@ -59,7 +52,6 @@ class GinNavigation implements ContainerInjectionInterface {

  /**
   * Get Navigation Bookmarks.
   *
   */
  public function getNavigationBookmarksMenuItems(): array {
    // Check if the shortcut module is installed.
@@ -77,7 +69,6 @@ class GinNavigation implements ContainerInjectionInterface {

  /**
   * Get Navigation Content menu.
   *
   */
  public function getNavigationContentMenuItems(): array {
    // Get the Entity Type Manager service.
@@ -175,7 +166,6 @@ class GinNavigation implements ContainerInjectionInterface {

  /**
   * Get Navigation User menu.
   *
   */
  public function getMenuNavigationUserItems(): array {
    $user_items = [