diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 838b32a..b27061a 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1090,8 +1090,8 @@ function menu_secondary_menu() { * Returns menu name, if exist */ function _menu_get_links_source($name, $default) { - $config = \Drupal::config('menu.settings'); - return \Drupal::moduleHandler()->moduleExists('menu') ? $config->get($name) : $default; + $config = \Drupal::config('menu_ui.settings'); + return \Drupal::moduleHandler()->moduleExists('menu_ui') ? $config->get($name) : $default; } /** diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php index 5fec407..8fee2e2 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php @@ -21,7 +21,7 @@ class BlockLanguageCacheTest extends WebTestBase { * * @var array */ - public static $modules = array('block', 'language', 'menu'); + public static $modules = array('block', 'language', 'menu_ui'); /** * List of langcodes. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationListUiTest.php index 06ede2d..d0aac6b 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationListUiTest.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationListUiTest.php @@ -30,7 +30,7 @@ class ConfigTranslationListUiTest extends WebTestBase { 'custom_block', 'field', 'field_ui', - 'menu', + 'menu_ui', 'node', 'shortcut', 'taxonomy', diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index d7f8dd0..267cca7 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -20,7 +20,7 @@ class ForumTest extends WebTestBase { * * @var array */ - public static $modules = array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu', 'help'); + public static $modules = array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu_ui', 'help'); /** * A user with various administrative privileges. diff --git a/core/modules/menu/menu.contextual_links.yml b/core/modules/menu/menu.contextual_links.yml deleted file mode 100644 index 5af427e..0000000 --- a/core/modules/menu/menu.contextual_links.yml +++ /dev/null @@ -1,4 +0,0 @@ -menu_edit: - title: 'Edit menu' - route_name: 'menu.menu_edit' - group: menu diff --git a/core/modules/menu/menu.local_actions.yml b/core/modules/menu/menu.local_actions.yml deleted file mode 100644 index cca55d8..0000000 --- a/core/modules/menu/menu.local_actions.yml +++ /dev/null @@ -1,11 +0,0 @@ -menu_link_add: - route_name: menu.link_add - title: 'Add link' - appears_on: - - menu.menu_edit - -menu.menu_add: - route_name: menu.menu_add - title: 'Add menu' - appears_on: - - menu.overview_page diff --git a/core/modules/menu/menu.local_tasks.yml b/core/modules/menu/menu.local_tasks.yml deleted file mode 100644 index 038487c..0000000 --- a/core/modules/menu/menu.local_tasks.yml +++ /dev/null @@ -1,15 +0,0 @@ -menu.menu_edit: - title: 'Edit menu' - route_name: menu.menu_edit - base_route: menu.menu_edit - -menu.overview_page: - title: 'List' - route_name: menu.overview_page - base_route: menu.overview_page - -menu.settings: - title: 'Settings' - route_name: menu.settings - base_route: menu.overview_page - weight: 100 diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php index 36705d5..c7011c9 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -111,7 +111,7 @@ class MenuLink extends Entity implements \ArrayAccess, MenuLinkInterface { * * @var string */ - public $module = 'menu'; + public $module = 'menu_ui'; /** * A flag for whether the link should be rendered in menus. diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkAccessController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkAccessController.php index 85cc796..dd3d897 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkAccessController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkAccessController.php @@ -31,7 +31,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A case 'delete': // Only items created by the menu module can be deleted. - return $entity->module == 'menu' || $entity->updated == 1; + return $entity->module == 'menu_ui' || $entity->updated == 1; } } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php index e3c43a8..083173f 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -98,7 +98,7 @@ public function form(array $form, array &$form_state) { if (isset($menu_link->options['fragment'])) { $path .= '#' . $menu_link->options['fragment']; } - if ($menu_link->module == 'menu') { + if ($menu_link->module == 'menu_ui') { $form['link_path'] = array( '#type' => 'textfield', '#title' => t('Path'), @@ -137,7 +137,7 @@ public function form(array $form, array &$form_state) { ); // Generate a list of possible parents (not including this link or descendants). - $options = menu_parent_options(menu_get_menus(), $menu_link); + $options = menu_ui_parent_options(menu_ui_get_menus(), $menu_link); $default = $menu_link->menu_name . ':' . $menu_link->plid; if (!isset($options[$default])) { $default = 'tools:0'; @@ -298,7 +298,7 @@ public function save(array $form, array &$form_state) { if ($saved) { drupal_set_message(t('The menu link has been saved.')); $form_state['redirect_route'] = array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $menu_link->menu_name, ), diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module index dc86f4c..be2b069 100644 --- a/core/modules/menu_link/menu_link.module +++ b/core/modules/menu_link/menu_link.module @@ -14,7 +14,7 @@ function menu_link_help($path, $arg) { case 'admin/help#menu_link': $output = ''; $output .= '
' . t('The Menu Link module allows users to create menu links. It is required by the Menu module, which provides an interface for managing menus. See the Menu module help page for more information.', array('!menu-help' => \Drupal::url('help.page', array('name' => 'menu')))) . '
'; + $output .= '' . t('The Menu Link module allows users to create menu links. It is required by the Menu module, which provides an interface for managing menus. See the Menu module help page for more information.', array('!menu-help' => \Drupal::url('help.page', array('name' => 'menu_ui')))) . '
'; return $output; } } @@ -205,12 +205,12 @@ function menu_link_maintain($module, $op, $link_path, $link_title = NULL) { function menu_link_system_breadcrumb_alter(array &$breadcrumb, array $attributes, array $context) { // Custom breadcrumb behavior for editing menu links, we append a link to // the menu in which the link is found. - if (!empty($attributes[RouteObjectInterface::ROUTE_NAME]) && $attributes[RouteObjectInterface::ROUTE_NAME] == 'menu.link_edit' && !empty($attributes['menu_link'])) { + if (!empty($attributes[RouteObjectInterface::ROUTE_NAME]) && $attributes[RouteObjectInterface::ROUTE_NAME] == 'menu_ui.link_edit' && !empty($attributes['menu_link'])) { $menu_link = $attributes['menu_link']; if (($menu_link instanceof MenuLinkInterface) && !$menu_link->isNew()) { // Add a link to the menu admin screen. $menu = entity_load('menu', $menu_link->menu_name); - $breadcrumb[] = Drupal::l($menu->label(), 'menu.menu_edit', array('menu' => $menu->id)); + $breadcrumb[] = Drupal::l($menu->label(), 'menu_ui.menu_edit', array('menu' => $menu->id)); } } } diff --git a/core/modules/menu/config/menu.settings.yml b/core/modules/menu_ui/config/menu_ui.settings.yml similarity index 100% rename from core/modules/menu/config/menu.settings.yml rename to core/modules/menu_ui/config/menu_ui.settings.yml diff --git a/core/modules/menu/config/schema/menu.schema.yml b/core/modules/menu_ui/config/schema/menu_ui.schema.yml similarity index 96% rename from core/modules/menu/config/schema/menu.schema.yml rename to core/modules/menu_ui/config/schema/menu_ui.schema.yml index 5431b7b..d5dfd64 100644 --- a/core/modules/menu/config/schema/menu.schema.yml +++ b/core/modules/menu_ui/config/schema/menu_ui.schema.yml @@ -1,6 +1,6 @@ # Schema for configuration files of the Menu module. -menu.settings: +menu_ui.settings: type: mapping label: 'Menu settings' mapping: diff --git a/core/modules/menu/css/menu.admin.css b/core/modules/menu_ui/css/menu_ui.admin.css similarity index 100% rename from core/modules/menu/css/menu.admin.css rename to core/modules/menu_ui/css/menu_ui.admin.css diff --git a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Controller/MenuController.php similarity index 89% rename from core/modules/menu/lib/Drupal/menu/Controller/MenuController.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Controller/MenuController.php index 0b77263..fd46114 100644 --- a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Controller/MenuController.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Controller\MenuController. + * Contains \Drupal\menu_ui\Controller\MenuController. */ -namespace Drupal\menu\Controller; +namespace Drupal\menu_ui\Controller; use Drupal\Component\Utility\Xss; use Drupal\Core\Controller\ControllerBase; @@ -34,7 +34,7 @@ public function getParentOptions(Request $request) { $available_menus[$menu] = $menu; } } - $options = _menu_get_options(menu_get_menus(), $available_menus, array('mlid' => 0)); + $options = _menu_ui_get_options(menu_ui_get_menus(), $available_menus, array('mlid' => 0)); return new JsonResponse($options); } diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuDeleteForm.php similarity index 94% rename from core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuDeleteForm.php index 709c71b..04f9d43 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuDeleteForm.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Form\MenuDeleteForm. + * Contains \Drupal\menu_ui\Form\MenuDeleteForm. */ -namespace Drupal\menu\Form; +namespace Drupal\menu_ui\Form; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityConfirmFormBase; @@ -66,7 +66,7 @@ public function getQuestion() { */ public function getCancelRoute() { return array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $this->entity->id(), ), @@ -97,7 +97,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function submit(array $form, array &$form_state) { - $form_state['redirect_route']['route_name'] = 'menu.overview_page'; + $form_state['redirect_route']['route_name'] = 'menu_ui.overview_page'; // Locked menus may not be deleted. if ($this->entity->isLocked()) { diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuLinkDeleteForm.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkDeleteForm.php similarity index 86% rename from core/modules/menu/lib/Drupal/menu/Form/MenuLinkDeleteForm.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkDeleteForm.php index efc9cdd..eeb40a6 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuLinkDeleteForm.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkDeleteForm.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Form\MenuLinkDeleteForm. + * Contains \Drupal\menu_ui\Form\MenuLinkDeleteForm. */ -namespace Drupal\menu\Form; +namespace Drupal\menu_ui\Form; use Drupal\Core\Entity\EntityConfirmFormBase; @@ -26,7 +26,7 @@ public function getQuestion() { */ public function getCancelRoute() { return array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $this->entity->menu_name, ), @@ -42,7 +42,7 @@ public function submit(array $form, array &$form_state) { drupal_set_message(t('The menu link %title has been deleted.', $t_args)); watchdog('menu', 'Deleted menu link %title.', $t_args, WATCHDOG_NOTICE); $form_state['redirect_route'] = array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $this->entity->menu_name, ), diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuLinkResetForm.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkResetForm.php similarity index 87% rename from core/modules/menu/lib/Drupal/menu/Form/MenuLinkResetForm.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkResetForm.php index 7542c57..31b23ab 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuLinkResetForm.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Form/MenuLinkResetForm.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Form\MenuLinkResetForm. + * Contains \Drupal\menu_ui\Form\MenuLinkResetForm. */ -namespace Drupal\menu\Form; +namespace Drupal\menu_ui\Form; use Drupal\Core\Entity\EntityConfirmFormBase; @@ -26,7 +26,7 @@ public function getQuestion() { */ public function getCancelRoute() { return array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $this->entity->menu_name, ), @@ -54,7 +54,7 @@ public function submit(array $form, array &$form_state) { $new_menu_link = $this->entity->reset(); drupal_set_message(t('The menu link was reset to its default settings.')); $form_state['redirect_route'] = array( - 'route_name' => 'menu.menu_edit', + 'route_name' => 'menu_ui.menu_edit', 'route_parameters' => array( 'menu' => $new_menu_link->menu_name, ), diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu_ui/lib/Drupal/menu_ui/MenuFormController.php similarity index 99% rename from core/modules/menu/lib/Drupal/menu/MenuFormController.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/MenuFormController.php index d6720a7..12cc49b 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/MenuFormController.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\MenuFormController. + * Contains \Drupal\menu_ui\MenuFormController. */ -namespace Drupal\menu; +namespace Drupal\menu_ui; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Entity\EntityFormController; @@ -228,7 +228,7 @@ public function save(array $form, array &$form_state) { * * This form constructor can be integrated as a section into another form. It * relies on the following keys in $form_state: - * - menu: A loaded menu definition, as returned by menu_load(). + * - menu: A loaded menu definition, as returned by menu_ui_load(). * - menu_overview_form_parents: An array containing the parent keys to this * form. * Forms integrating this section should call menu_overview_form_submit() from diff --git a/core/modules/menu/lib/Drupal/menu/MenuListController.php b/core/modules/menu_ui/lib/Drupal/menu_ui/MenuListController.php similarity index 95% rename from core/modules/menu/lib/Drupal/menu/MenuListController.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/MenuListController.php index 18a3732..8ac599a 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuListController.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/MenuListController.php @@ -1,10 +1,10 @@ configFactory->get('menu.settings'); + $config = $this->configFactory->get('menu_ui.settings'); $form['intro'] = array( '#type' => 'item', '#markup' => t('The menu module allows on-the-fly creation of menu links in the content authoring forms. To configure these settings for a particular content type, visit the Content types page, click the edit link for the content type, and go to the Menu settings section.', array('@content-types' => url('admin/structure/types'))), ); - $menu_options = menu_get_menus(); + $menu_options = menu_ui_get_menus(); $main = $config->get('main_links'); $form['menu_main_links_source'] = array( @@ -61,7 +61,7 @@ public function buildForm(array $form, array &$form_state) { * Implements \Drupal\Core\Form\FormInterface::submitForm(). */ public function submitForm(array &$form, array &$form_state) { - $this->configFactory->get('menu.settings') + $this->configFactory->get('menu_ui.settings') ->set('main_links', $form_state['values']['menu_main_links_source']) ->set('secondary_links', $form_state['values']['menu_secondary_links_source']) ->save(); diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuCacheTagsTest.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuCacheTagsTest.php similarity index 96% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuCacheTagsTest.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuCacheTagsTest.php index c09875c..679785a 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuCacheTagsTest.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuCacheTagsTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\menu\Tests\MenuCacheTagsTest. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; use Drupal\system\Tests\Cache\PageCacheTagsTestBase; @@ -17,7 +17,7 @@ class MenuCacheTagsTest extends PageCacheTagsTestBase { /** * {@inheritdoc} */ - public static $modules = array('menu', 'block', 'test_page_test'); + public static $modules = array('menu_ui', 'block', 'test_page_test'); /** * {@inheritdoc} diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuLanguageTest.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuLanguageTest.php similarity index 97% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuLanguageTest.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuLanguageTest.php index 9e9af49..73374aa 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuLanguageTest.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuLanguageTest.php @@ -2,10 +2,10 @@ /** * @file - * Tests for menu language settings. + * Tests for menu_ui language settings. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; use Drupal\Component\Utility\Unicode; use Drupal\Core\Language\Language; @@ -174,7 +174,7 @@ function testMenuLanguageRemovedEnglish() { $this->drupalPostForm('admin/structure/menu/add', $edit, t('Save')); // Check that the language settings were saved. - $menu = menu_load($menu_name); + $menu = menu_ui_load($menu_name); $this->assertEqual($menu->langcode, 'en'); // Remove English language. To do that another language has to be set as @@ -186,7 +186,7 @@ function testMenuLanguageRemovedEnglish() { // Save the menu again and check if the language is still the same. $this->drupalPostForm("admin/structure/menu/manage/$menu_name", array(), t('Save')); - $menu = menu_load($menu_name); + $menu = menu_ui_load($menu_name); $this->assertEqual($menu->langcode, 'en'); } diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuNodeTest.php similarity index 97% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuNodeTest.php index d8fdea8..9c1c67e 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuNodeTest.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\menu\Tests\MenuNodeTest. + * Definition of Drupal\menu_ui\Tests\MenuNodeTest. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; use Drupal\simpletest\WebTestBase; @@ -19,7 +19,7 @@ class MenuNodeTest extends WebTestBase { * * @var array */ - public static $modules = array('menu', 'test_page_test', 'node'); + public static $modules = array('menu_ui', 'test_page_test', 'node'); public static function getInfo() { return array( diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuTest.php similarity index 98% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuTest.php index ef63ae0..96de52d 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuTest.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\menu\Tests\MenuTest. + * Definition of Drupal\menu_ui\Tests\MenuTest. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; /** * Defines a test class for testing menu and menu link functionality. @@ -197,7 +197,7 @@ function addCustomMenu() { // Enable the block. $this->drupalPlaceBlock('system_menu_block:' . $menu_name); - return menu_load($menu_name); + return menu_ui_load($menu_name); } /** @@ -214,7 +214,7 @@ function deleteCustomMenu() { $this->drupalPostForm("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete')); $this->assertResponse(200); $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $label)), 'Custom menu was deleted'); - $this->assertFalse(menu_load($menu_name), 'Custom menu was deleted'); + $this->assertFalse(menu_ui_load($menu_name), 'Custom menu was deleted'); // Test if all menu links associated to the menu were removed from database. $result = entity_load_multiple_by_properties('menu_link', array('menu_name' => $menu_name)); $this->assertFalse($result, 'All menu links associated to the custom menu were deleted.'); @@ -475,7 +475,7 @@ public function testBlockContextualLinks() { $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } /** diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuUninstallTest.php similarity index 77% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuUninstallTest.php index 6815f02..ed92f28 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuUninstallTest.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Tests\MenuUninstallTest. + * Contains \Drupal\menu_ui\Tests\MenuUninstallTest. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; use Drupal\simpletest\WebTestBase; @@ -19,7 +19,7 @@ class MenuUninstallTest extends WebTestBase { * * @var array */ - public static $modules = array('menu'); + public static $modules = array('menu_ui'); public static function getInfo() { return array( @@ -33,7 +33,7 @@ public static function getInfo() { * Tests Menu uninstall. */ public function testMenuUninstall() { - \Drupal::moduleHandler()->uninstall(array('menu')); + \Drupal::moduleHandler()->uninstall(array('menu_ui')); $this->assertTrue(entity_load('menu', 'admin', TRUE), 'The \'admin\' menu still exists after uninstalling menu module.'); } diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuWebTestBase.php similarity index 87% rename from core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php rename to core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuWebTestBase.php index e1c21a0..a8dda4b 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php +++ b/core/modules/menu_ui/lib/Drupal/menu_ui/Tests/MenuWebTestBase.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\menu\Tests\MenuWebTestBase. + * Contains \Drupal\menu_ui\Tests\MenuWebTestBase. */ -namespace Drupal\menu\Tests; +namespace Drupal\menu_ui\Tests; use Drupal\simpletest\WebTestBase; @@ -19,7 +19,7 @@ class MenuWebTestBase extends WebTestBase { * * @var array */ - public static $modules = array('menu'); + public static $modules = array('menu_ui'); /** * Fetchs the menu item from the database and compares it to expected item. diff --git a/core/modules/menu/menu.admin.inc b/core/modules/menu_ui/menu_ui.admin.inc similarity index 100% rename from core/modules/menu/menu.admin.inc rename to core/modules/menu_ui/menu_ui.admin.inc diff --git a/core/modules/menu/menu.admin.js b/core/modules/menu_ui/menu_ui.admin.js similarity index 89% rename from core/modules/menu/menu.admin.js rename to core/modules/menu_ui/menu_ui.admin.js index 50b3999..4a04ab0 100644 --- a/core/modules/menu/menu.admin.js +++ b/core/modules/menu_ui/menu_ui.admin.js @@ -2,16 +2,16 @@ "use strict"; - Drupal.behaviors.menuChangeParentItems = { + Drupal.behaviors.menuUiChangeParentItems = { attach: function (context, settings) { var $menu = $('#edit-menu'); $menu.once('menu-parent', function () { // Update the list of available parent menu items to match the initial // available menus. - Drupal.menuUpdateParentList(); + Drupal.menuUiUpdateParentList(); // Update list of available parent menu items. - $menu.on('change', 'input', Drupal.menuUpdateParentList); + $menu.on('change', 'input', Drupal.menuUiUpdateParentList); }); } }; @@ -19,7 +19,7 @@ /** * Function to set the options of the menu parent item dropdown. */ - Drupal.menuUpdateParentList = function () { + Drupal.menuUiUpdateParentList = function () { var $menu = $('#edit-menu'); var values = []; diff --git a/core/modules/menu/menu.api.php b/core/modules/menu_ui/menu_ui.api.php similarity index 100% rename from core/modules/menu/menu.api.php rename to core/modules/menu_ui/menu_ui.api.php diff --git a/core/modules/menu_ui/menu_ui.contextual_links.yml b/core/modules/menu_ui/menu_ui.contextual_links.yml new file mode 100644 index 0000000..22e3a4e --- /dev/null +++ b/core/modules/menu_ui/menu_ui.contextual_links.yml @@ -0,0 +1,4 @@ +menu_ui_edit: + title: 'Edit menu' + route_name: 'menu_ui.menu_edit' + group: menu diff --git a/core/modules/menu/menu.info.yml b/core/modules/menu_ui/menu_ui.info.yml similarity index 77% rename from core/modules/menu/menu.info.yml rename to core/modules/menu_ui/menu_ui.info.yml index b163994..c0fba50 100644 --- a/core/modules/menu/menu.info.yml +++ b/core/modules/menu_ui/menu_ui.info.yml @@ -1,9 +1,9 @@ -name: Menu +name: Menu Ui type: module description: 'Allows administrators to customize the site navigation menu.' package: Core version: VERSION core: 8.x -configure: menu.overview_page +configure: menu_ui.overview_page dependencies: - menu_link diff --git a/core/modules/menu/menu.install b/core/modules/menu_ui/menu_ui.install similarity index 86% rename from core/modules/menu/menu.install rename to core/modules/menu_ui/menu_ui.install index 037fc62..0e580b4 100644 --- a/core/modules/menu/menu.install +++ b/core/modules/menu_ui/menu_ui.install @@ -2,7 +2,7 @@ /** * @file - * Install, update and uninstall functions for the menu module. + * Install, update and uninstall functions for the menu_ui module. */ use Drupal\Component\Uuid\Uuid; @@ -10,7 +10,7 @@ /** * Implements hook_install(). */ -function menu_install() { +function menu_ui_install() { // Rebuild all the menu data. // @todo - remove this when we understand why removing it breaks the // standard install profile, possibly need to be handled in @@ -31,6 +31,6 @@ function menu_install() { /** * Implements hook_uninstall(). */ -function menu_uninstall() { +function menu_ui_uninstall() { \Drupal::service('router.builder')->setRebuildNeeded(); } diff --git a/core/modules/menu/menu.js b/core/modules/menu_ui/menu_ui.js similarity index 96% rename from core/modules/menu/menu.js rename to core/modules/menu_ui/menu_ui.js index 589e69e..1f830d2 100644 --- a/core/modules/menu/menu.js +++ b/core/modules/menu_ui/menu_ui.js @@ -2,7 +2,7 @@ "use strict"; - Drupal.behaviors.menuDetailsSummaries = { + Drupal.behaviors.menuUiDetailsSummaries = { attach: function (context) { $(context).find('.menu-link-form').drupalSetSummary(function (context) { var $context = $(context); @@ -19,7 +19,7 @@ /** * Automatically fill in a menu link title, if possible. */ - Drupal.behaviors.menuLinkAutomaticTitle = { + Drupal.behaviors.menuUiLinkAutomaticTitle = { attach: function (context) { var $context = $(context); $context.find('.menu-link-form').each(function () { diff --git a/core/modules/menu/menu.libraries.yml b/core/modules/menu_ui/menu_ui.libraries.yml similarity index 68% rename from core/modules/menu/menu.libraries.yml rename to core/modules/menu_ui/menu_ui.libraries.yml index 56cf437..a4e381c 100644 --- a/core/modules/menu/menu.libraries.yml +++ b/core/modules/menu_ui/menu_ui.libraries.yml @@ -1,16 +1,16 @@ -drupal.menu: +drupal.menu_ui: version: VERSION js: - menu.js: {} + menu_ui.js: {} dependencies: - core/jquery - core/drupal - core/drupal.form -drupal.menu.admin: +drupal.menu_ui.admin: version: VERSION js: - menu.admin.js: {} + menu_ui.admin.js: {} dependencies: - core/jquery - core/drupal diff --git a/core/modules/menu_ui/menu_ui.local_actions.yml b/core/modules/menu_ui/menu_ui.local_actions.yml new file mode 100644 index 0000000..0834821 --- /dev/null +++ b/core/modules/menu_ui/menu_ui.local_actions.yml @@ -0,0 +1,11 @@ +menu_ui_link_add: + route_name: menu_ui.link_add + title: 'Add link' + appears_on: + - menu_ui.menu_edit + +menu_ui.menu_add: + route_name: menu_ui.menu_add + title: 'Add menu' + appears_on: + - menu_ui.overview_page diff --git a/core/modules/menu_ui/menu_ui.local_tasks.yml b/core/modules/menu_ui/menu_ui.local_tasks.yml new file mode 100644 index 0000000..92aadeb --- /dev/null +++ b/core/modules/menu_ui/menu_ui.local_tasks.yml @@ -0,0 +1,15 @@ +menu_ui.menu_edit: + title: 'Edit menu' + route_name: menu_ui.menu_edit + base_route: menu_ui.menu_edit + +menu_ui.overview_page: + title: 'List' + route_name: menu_ui.overview_page + base_route: menu_ui.overview_page + +menu_ui.settings: + title: 'Settings' + route_name: menu_ui.settings + base_route: menu_ui.overview_page + weight: 100 diff --git a/core/modules/menu/menu.module b/core/modules/menu_ui/menu_ui.module similarity index 81% rename from core/modules/menu/menu.module rename to core/modules/menu_ui/menu_ui.module index 660e1df..26891de 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu_ui/menu_ui.module @@ -29,12 +29,12 @@ /** * Implements hook_help(). */ -function menu_help($path, $arg) { +function menu_ui_help($path, $arg) { switch ($path) { - case 'admin/help#menu': + case 'admin/help#menu_ui': $output = ''; $output .= '' . t('The Menu 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. Each menu is rendered in a block that can be enabled and positioned through the Blocks administration page. You can view and manage menus on the Menus administration page. For more information, see the online handbook entry for the Menu module.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/documentation/modules/menu/')) . '
'; + $output .= '' . 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. Each menu is rendered in a block that can be enabled and positioned through the Blocks administration page. You can view and manage menus on the Menus administration page. For more information, see the online handbook entry for the Menu module.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/documentation/modules/menu/')) . '
'; $output .= '