Loading cloud.module +32 Changes for cloud.module: 32 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -359,3 +359,35 @@ function cloud_update_views_configuration($view_name, array $options) { } $view->save(TRUE); } /** * Implements hook_preprocess_HOOK(). */ function cloud_preprocess_menu(&$variables) { // Remove cloud service provider menus without sub-menu. if (!empty($variables['menu_name']) && $variables['menu_name'] === 'main') { $variables['#cache']['max-age'] = 0; if (empty($variables['items'])) { return; } foreach (['cloud.service_providers.menu', 'cloud.design.menu'] as $menu) { if (empty($variables['items'][$menu])) { continue; } foreach (($parent =& $variables['items'][$menu]['below']) as $key => $item) { // Skip the menu "add cloud service provider". if ($key === 'cloud.menu.cloud_links:cloud_service_provider.local_tasks') { continue; } // If there is no sub-menu, remove the parent menu. if (empty($item['below'])) { unset($parent[$key]); } } } } } Loading
cloud.module +32 Changes for cloud.module: 32 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -359,3 +359,35 @@ function cloud_update_views_configuration($view_name, array $options) { } $view->save(TRUE); } /** * Implements hook_preprocess_HOOK(). */ function cloud_preprocess_menu(&$variables) { // Remove cloud service provider menus without sub-menu. if (!empty($variables['menu_name']) && $variables['menu_name'] === 'main') { $variables['#cache']['max-age'] = 0; if (empty($variables['items'])) { return; } foreach (['cloud.service_providers.menu', 'cloud.design.menu'] as $menu) { if (empty($variables['items'][$menu])) { continue; } foreach (($parent =& $variables['items'][$menu]['below']) as $key => $item) { // Skip the menu "add cloud service provider". if ($key === 'cloud.menu.cloud_links:cloud_service_provider.local_tasks') { continue; } // If there is no sub-menu, remove the parent menu. if (empty($item['below'])) { unset($parent[$key]); } } } } }