Loading includes/html.theme +6 −9 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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(); Loading Loading @@ -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'; } Loading includes/theme.theme +7 −2 Original line number Diff line number Diff line Loading @@ -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'] = [ Loading src/GinNavigation.php +5 −15 Original line number Diff line number Diff line Loading @@ -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} Loading @@ -29,7 +23,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Admin Menu Items. * */ public function getNavigationAdminMenuItems(): array { $parameters = new MenuTreeParameters(); Loading Loading @@ -59,7 +52,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Bookmarks. * */ public function getNavigationBookmarksMenuItems(): array { // Check if the shortcut module is installed. Loading @@ -77,7 +69,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Content menu. * */ public function getNavigationContentMenuItems(): array { // Get the Entity Type Manager service. Loading Loading @@ -175,7 +166,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation User menu. * */ public function getMenuNavigationUserItems(): array { $user_items = [ Loading Loading
includes/html.theme +6 −9 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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(); Loading Loading @@ -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'; } Loading
includes/theme.theme +7 −2 Original line number Diff line number Diff line Loading @@ -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'] = [ Loading
src/GinNavigation.php +5 −15 Original line number Diff line number Diff line Loading @@ -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} Loading @@ -29,7 +23,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Admin Menu Items. * */ public function getNavigationAdminMenuItems(): array { $parameters = new MenuTreeParameters(); Loading Loading @@ -59,7 +52,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Bookmarks. * */ public function getNavigationBookmarksMenuItems(): array { // Check if the shortcut module is installed. Loading @@ -77,7 +69,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation Content menu. * */ public function getNavigationContentMenuItems(): array { // Get the Entity Type Manager service. Loading Loading @@ -175,7 +166,6 @@ class GinNavigation implements ContainerInjectionInterface { /** * Get Navigation User menu. * */ public function getMenuNavigationUserItems(): array { $user_items = [ Loading