diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 5a5e544..c7fcd92 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1751,10 +1751,10 @@ function menu_set_custom_theme() { */ function menu_list_system_menus() { return array( - 'navigation' => 'Navigation', - 'management' => 'Management', - 'user-menu' => 'User menu', - 'main-menu' => 'Main menu', + 'tools' => 'Tools', + 'admin' => 'Administration', + 'account' => 'User account menu', + 'main' => 'Main navigation', ); } @@ -1765,7 +1765,7 @@ function menu_main_menu() { $config = config('menu.settings'); $menu_enabled = module_exists('menu'); // When menu module is not enabled, we need a hardcoded default value. - $main_links_source = $menu_enabled ? $config->get('main_links') : 'main-menu'; + $main_links_source = $menu_enabled ? $config->get('main_links') : 'main'; return menu_navigation_links($main_links_source); } @@ -1776,8 +1776,8 @@ function menu_secondary_menu() { $config = config('menu.settings'); $menu_enabled = module_exists('menu'); // When menu module is not enabled, we need a hardcoded default value. - $main_links_source = $menu_enabled ? $config->get('main_links') : 'main-menu'; - $secondary_links_source = $menu_enabled ? $config->get('secondary_links') : 'user-menu'; + $main_links_source = $menu_enabled ? $config->get('main_links') : 'main'; + $secondary_links_source = $menu_enabled ? $config->get('secondary_links') : 'account'; // If the secondary menu source is set as the primary menu, we display the // second level of the primary menu. @@ -2109,7 +2109,7 @@ function menu_local_tasks($level = 0) { * @param $args * A list of dynamic path arguments to append to $parent_path to form the * fully-qualified menu router path, for example array(123) for a certain - * node or array('system', 'navigation') for a certain block. + * node or array('system', 'tools') for a certain block. * * @return * A list of menu router items that are local tasks for the passed-in path. @@ -2267,7 +2267,7 @@ function theme_menu_local_tasks(&$variables) { * 'menu_default_active_menus' variable may be used to assert a menu order * different from the order of creation, or to prevent a particular menu from * being used at all in the active trail. - * E.g., $conf['menu_default_active_menus'] = array('navigation', 'main-menu') + * E.g., $conf['menu_default_active_menus'] = array('tools', 'main') */ function menu_set_active_menu_names($menu_names = NULL) { $active = &drupal_static(__FUNCTION__); @@ -2615,7 +2615,7 @@ function menu_link_load($mlid) { /** * Clears the cached cached data for a single named menu. */ -function menu_cache_clear($menu_name = 'navigation') { +function menu_cache_clear($menu_name = 'tools') { cache('menu')->invalidateTags(array('menu' => $menu_name)); // Also clear the menu system static caches. menu_reset_static_cache(); @@ -2749,7 +2749,7 @@ function _menu_link_build($item) { // the menu links generated automatically from entries in {menu_router}. $item['module'] = 'system'; $item += array( - 'menu_name' => 'navigation', + 'menu_name' => 'tools', 'link_title' => $item['title'], 'link_path' => $item['path'], 'hidden' => 0, @@ -2996,7 +2996,7 @@ function _menu_delete_item($item, $force = FALSE) { * normalized first by calling drupal_get_normal_path() on it. * - link_title: (required) Title to appear in menu for the link. * - menu_name: (optional) The machine name of the menu for the link. - * Defaults to 'navigation'. + * Defaults to 'tools'. * - weight: (optional) Integer to determine position in menu. Default is 0. * - expanded: (optional) Boolean that determines if the item is expanded. * - options: (optional) An array of options, see l() for more. @@ -3023,7 +3023,7 @@ function menu_link_save(&$item, $existing_item = array(), $parent_candidates = a $item['external'] = (url_is_external($item['link_path']) || $item['link_path'] == '') ? 1 : 0; // Load defaults. $item += array( - 'menu_name' => 'navigation', + 'menu_name' => 'tools', 'weight' => 0, 'link_title' => '', 'hidden' => 0, diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 2c37afc..4eb7683 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -319,10 +319,10 @@ function testBlockVisibilityPerUser() { * Test configuring and moving a module-define block to specific regions. */ function testBlock() { - // Select the Navigation block to be configured and moved. + // Select the Administration menu block to be configured and moved. $block = array(); $block['module'] = 'system'; - $block['delta'] = 'management'; + $block['delta'] = 'admin'; $block['title'] = $this->randomName(8); // Set block title to confirm that interface works and override any custom titles. @@ -354,13 +354,13 @@ function testBlock() { $xpath = $this->buildXPathQuery('//div[@id=:id]/*', array(':id' => 'block-block-' . $bid)); $this->assertNoFieldByXPath($xpath, FALSE, 'Custom block found in no regions.'); - // For convenience of developers, put the navigation block back. + // For convenience of developers, put the Administration menu block back. $edit = array(); $edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = $this->regions[1]; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); $this->assertText(t('The block settings have been updated.'), 'Block successfully move to first sidebar region.'); - $this->drupalPost('admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure', array('title' => 'Navigation'), t('Save block')); + $this->drupalPost('admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure', array('title' => 'Tools'), t('Save block')); $this->assertText(t('The block configuration has been saved.'), 'Block title set.'); } diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 985abbd..921a619 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -21,14 +21,14 @@ function contact_help($path, $arg) { $output .= '
' . t('Site-wide contact forms') . '
'; $output .= '
' . t('The Contact page provides a simple form for users with the Use the site-wide contact form permission to send comments, feedback, or other requests. You can create categories for directing the contact form messages to a set of defined recipients. Common categories for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). E-mail addresses defined within a category are not displayed publicly.', array('@contact' => url('contact'))) . '

'; $output .= '
' . t('Navigation') . '
'; - $output .= '
' . t("When the site-wide contact form is enabled, a link in the main Navigation menu is created, but the link is disabled by default. This menu link can be enabled on the Menus administration page.", array('@contact' => url('contact'), '@menu' => url('admin/structure/menu'))) . '
'; + $output .= '
' . t('When the site-wide contact form is enabled, a link in the Main navigation menu is created, but the link is disabled by default. This menu link can be enabled on the Menus administration page.', array('@menu' => url('admin/structure/menu'))) . '
'; $output .= '
' . t('Customization') . '
'; $output .= '
' . t('If you would like additional text to appear on the site-wide or personal contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => url('admin/structure/block'))) . '
'; $output .= ''; return $output; case 'admin/structure/contact': $output = '

' . t('Add one or more categories on this page to set up your site-wide contact form.', array('@form' => url('contact'))) . '

'; - $output .= '

' . t('A Contact menu item (disabled by default) is added to the Navigation menu, which you can modify on the Menus administration page.', array('@menu-settings' => url('admin/structure/menu'))) . '

'; + $output .= '

' . t('A Contact menu item (disabled by default) is added to the Tools menu, which you can modify on the Menus administration page.', array('@menu-settings' => url('admin/structure/menu'))) . '

'; $output .= '

' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => url('admin/structure/block'))) . '

'; return $output; } @@ -90,6 +90,7 @@ function contact_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('contact_site_form'), 'access arguments' => array('access site-wide contact form'), + 'menu_name' => 'main', 'type' => MENU_SUGGESTED_ITEM, 'file' => 'contact.pages.inc', ); diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index 37b3a21..df2ba1a 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -128,8 +128,8 @@ function contextual_preprocess(&$variables, $hook) { * menu_contextual_links(). For example: * @code * array('#contextual_links' => array( - * 'block' => array('admin/structure/block/manage', array('system', 'navigation')), - * 'menu' => array('admin/structure/menu/manage', array('navigation')), + * 'block' => array('admin/structure/block/manage', array('system', 'tools')), + * 'menu' => array('admin/structure/menu/manage', array('tools')), * )) * @endcode * diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index af2daa9..3ec8a41 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -33,8 +33,8 @@ function forum_help($path, $arg) { $output .= '
' . t('Visit the Forums page to set up containers and forums to hold your discussion topics.', array('@forums' => url('admin/structure/forum'))) . '
'; $output .= '
' . t('Starting a discussion') . '
'; $output .= '
' . t('The Forum topic link on the Add new content page creates the first post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'), '@content-add' => url('node/add'))) . '
'; - $output .= '
' . t('Navigation') . '
'; - $output .= '
' . t('Enabling the Forum module provides a default Forums menu item in the navigation menu that links to the Forums page.', array('@forums' => url('forum'))) . '
'; + $output .= '
' . t('Forum navigation') . '
'; + $output .= '
' . t('Enabling the Forum module provides a default Forums menu item in the Tools menu that links to the Forums page.', array('@forums' => url('forum'))) . '
'; $output .= '
' . t('Moving forum topics') . '
'; $output .= '
' . t('A forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic. When moving a forum topic between forums, the Leave shadow copy option creates a link in the original forum pointing to the new location.') . '
'; $output .= '
' . t('Locking and disabling comments') . '
'; diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index b747a68..67e58a2 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -250,11 +250,11 @@ private function doAdminTests($user) { $this->drupalLogin($user); // Retrieve forum menu id. - $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = 'forum' AND menu_name = 'navigation' AND module = 'system' ORDER BY mlid ASC", 0, 1)->fetchField(); + $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = 'forum' AND menu_name = 'tools' AND module = 'system' ORDER BY mlid ASC", 0, 1)->fetchField(); - // Add forum to navigation menu. + // Add forum to the Tools menu. $edit = array(); - $this->drupalPost('admin/structure/menu/manage/navigation', $edit, t('Save configuration')); + $this->drupalPost('admin/structure/menu/manage/tools', $edit, t('Save configuration')); $this->assertResponse(200); // Edit forum taxonomy. diff --git a/core/modules/menu/config/menu.settings.yml b/core/modules/menu/config/menu.settings.yml index 62946df..166d7eb 100644 --- a/core/modules/menu/config/menu.settings.yml +++ b/core/modules/menu/config/menu.settings.yml @@ -1,2 +1,2 @@ -main_links: main-menu -secondary_links: user-menu +main_links: main +secondary_links: account diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php index c3450a7..9d4b8d4 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php @@ -49,15 +49,15 @@ function setUp() { * Test creating, editing, deleting menu links via node form widget. */ function testMenuNodeFormWidget() { - // Enable Navigation menu as available menu. + // Enable Tools menu as available menu. $edit = array( - 'menu_options[navigation]' => 1, + 'menu_options[tools]' => 1, ); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); - // Change default parent item to Navigation menu, so we can assert more + // Change default parent item to Tools menu, so we can assert more // easily. $edit = array( - 'menu_parent' => 'navigation:0', + 'menu_parent' => 'tools:0', ); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); @@ -106,24 +106,24 @@ function testMenuNodeFormWidget() { $this->drupalGet('test-page'); $this->assertNoLink($node_title); - // Add a menu link to the Management menu. + // Add a menu link to the Administration menu. $item = array( 'link_path' => 'node/' . $node->nid, 'link_title' => $this->randomName(16), - 'menu_name' => 'management', + 'menu_name' => 'admin', ); menu_link_save($item); - // Assert that disabled Management menu is not shown on the node/$nid/edit page. + // Assert that disabled Administration menu is not shown on the node/$nid/edit page. $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertText('Provide a menu link', 'Link in not allowed menu not shown in node edit form'); - // Assert that the link is still in the management menu after save. + // Assert that the link is still in the Administration menu after save. $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); $link = menu_link_load($item['mlid']); $this->assertTrue($link, 'Link in not allowed menu still exists after saving node'); - // Move the menu link back to the Navigation menu. - $item['menu_name'] = 'navigation'; + // Move the menu link back to the Tools menu. + $item['menu_name'] = 'tools'; menu_link_save($item); // Create a second node. $child_node = $this->drupalCreateNode(array('type' => 'article')); @@ -137,9 +137,9 @@ function testMenuNodeFormWidget() { // Edit the first node. $this->drupalGet('node/'. $node->nid .'/edit'); // Assert that it is not possible to set the parent of the first node to itself or the second node. - $this->assertNoOption('edit-menu-parent', 'navigation:'. $item['mlid']); - $this->assertNoOption('edit-menu-parent', 'navigation:'. $child_item['mlid']); - // Assert that unallowed Management menu is not available in options. - $this->assertNoOption('edit-menu-parent', 'management:0'); + $this->assertNoOption('edit-menu-parent', 'tools:'. $item['mlid']); + $this->assertNoOption('edit-menu-parent', 'tools:'. $child_item['mlid']); + // Assert that unallowed Administration menu is not available in options. + $this->assertNoOption('edit-menu-parent', 'admin:0'); } } diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index b4cd7e7..2067e7d 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -28,7 +28,7 @@ class MenuTest extends WebTestBase { public static function getInfo() { return array( 'name' => 'Menu link creation/deletion', - 'description' => 'Add a custom menu, add menu links to the custom menu and Navigation menu, check their data, and delete them using the menu module UI.', + 'description' => 'Add a custom menu, add menu links to the custom menu and Tools menu, check their data, and delete them using the menu module UI.', 'group' => 'Menu' ); } @@ -90,7 +90,7 @@ function testMenu() { } /** - * Test standard menu functionality using navigation menu. + * Test standard menu functionality using Tools menu. * */ function doStandardMenuTests() { @@ -99,7 +99,7 @@ function doStandardMenuTests() { } /** - * Test custom menu functionality using navigation menu. + * Test custom menu functionality using Tools menu. * */ function doCustomMenuTests() { @@ -207,10 +207,10 @@ function deleteCustomMenu($menu) { } /** - * Test menu functionality using navigation menu. + * Test menu functionality using Tools menu. * */ - function doMenuTests($menu_name = 'navigation') { + function doMenuTests($menu_name = 'tools') { // Add nodes to use as links for menu links. $node1 = $this->drupalCreateNode(array('type' => 'article')); $node2 = $this->drupalCreateNode(array('type' => 'article')); @@ -307,7 +307,7 @@ function testMenuQueryAndFragment() { * @param string $weight Menu weight * @return array Menu link created. */ - function addMenuLink($plid = 0, $link = '', $menu_name = 'navigation', $expanded = TRUE, $weight = '0') { + function addMenuLink($plid = 0, $link = '', $menu_name = 'tools', $expanded = TRUE, $weight = '0') { // View add menu link page. $this->drupalGet("admin/structure/menu/manage/$menu_name/add"); $this->assertResponse(200); @@ -341,7 +341,7 @@ function addMenuLink($plid = 0, $link = '', $menu_name = 'navigation', $e * * @param string $menu_name Menu name. */ - function addInvalidMenuLink($menu_name = 'navigation') { + function addInvalidMenuLink($menu_name = 'tools') { foreach (array('-&-', 'admin/people/permissions', '#') as $link_path) { $edit = array( 'link_path' => $link_path, @@ -571,11 +571,11 @@ private function verifyAccess($response = 200) { $this->assertText(t('Menus'), 'Menu build overview node was displayed'); } - // View navigation menu customization node. - $this->drupalGet('admin/structure/menu/manage/navigation'); + // View tools menu customization node. + $this->drupalGet('admin/structure/menu/manage/tools'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Navigation'), 'Navigation menu node was displayed'); + $this->assertText(t('Tools'), 'Tools menu node was displayed'); } // View menu edit node. diff --git a/core/modules/menu/menu.admin.inc b/core/modules/menu/menu.admin.inc index eeb5c7f..8f1a8be 100644 --- a/core/modules/menu/menu.admin.inc +++ b/core/modules/menu/menu.admin.inc @@ -377,7 +377,7 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) { $options = menu_parent_options(menu_get_menus(), $item); $default = $item['menu_name'] . ':' . $item['plid']; if (!isset($options[$default])) { - $default = 'navigation:0'; + $default = 'tools:0'; } $form['parent'] = array( '#type' => 'select', diff --git a/core/modules/menu/menu.install b/core/modules/menu/menu.install index 41cbeaf..20277a7 100644 --- a/core/modules/menu/menu.install +++ b/core/modules/menu/menu.install @@ -10,7 +10,7 @@ */ function menu_schema() { $schema['menu_custom'] = array( - 'description' => 'Holds definitions for top-level custom menus (for example, Main menu).', + 'description' => 'Holds definitions for top-level custom menus (for example, Main navigation menu).', 'fields' => array( 'menu_name' => array( 'type' => 'varchar', @@ -47,10 +47,10 @@ function menu_install() { $system_menus = menu_list_system_menus(); $t = get_t(); $descriptions = array( - 'navigation' => $t('The Navigation menu contains links intended for site visitors. Links are added to the Navigation menu automatically by some modules.'), - 'user-menu' => $t("The User menu contains links related to the user's account, as well as the 'Log out' link."), - 'management' => $t('The Management menu contains links for administrative tasks.'), - 'main-menu' => $t('The Main menu is used on many sites to show the major sections of the site, often in a top navigation bar.'), + 'tools' => $t('Contains links for site visitors. Some modules add their links here.'), + 'account' => $t('Links related to the user account.'), + 'admin' => $t('Contains links to administrative tasks.'), + 'main' => $t('Use this for linking to the main site sections.'), ); foreach ($system_menus as $menu_name => $title) { $menu = array( @@ -80,3 +80,24 @@ function menu_update_8000() { 'menu_secondary_links_source' => 'secondary_links', )); } + +/** + * Rename default menu names. + */ +function menu_update_8001() { + // Only the internal identifiers are updated; the labels and descriptions + // might have been customized and do not have to be renamed. + $map = array( + 'navigation' => 'tools', + 'management' => 'admin', + 'user-menu' => 'account', + 'main-menu' => 'main', + ); + foreach ($map as $old => $new) { + db_update('menu_custom') + ->condition('menu_name', $old) + ->fields(array('menu_name' => $new)) + ->execute(); + } +} + diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index cee4ba5..a55660b 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -376,7 +376,7 @@ function menu_parent_options($menus, $item, $type = '') { } else { // If a node type is set, use all available menus for this type. - $type_menus = variable_get('menu_options_' . $type, array('main-menu' => 'main-menu')); + $type_menus = variable_get('menu_options_' . $type, array('main' => 'main')); foreach ($type_menus as $menu) { $available_menus[$menu] = $menu; } @@ -569,12 +569,12 @@ function menu_node_predelete(Node $node) { function menu_node_prepare(Node $node) { if (empty($node->menu)) { // Prepare the node for the edit form so that $node->menu always exists. - $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main-menu:0'), ':'); + $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main:0'), ':'); $item = array(); if (isset($node->nid)) { $mlid = FALSE; // Give priority to the default menu - $type_menus = variable_get('menu_options_' . $node->type, array('main-menu' => 'main-menu')); + $type_menus = variable_get('menu_options_' . $node->type, array('main' => 'main')); if (in_array($menu_name, $type_menus)) { $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", 0, 1, array( ':path' => 'node/' . $node->nid, @@ -690,7 +690,7 @@ function menu_form_node_form_alter(&$form, $form_state) { '#description' => t('Shown when hovering over the menu link.'), ); - $default = ($link['mlid'] ? $link['menu_name'] . ':' . $link['plid'] : variable_get('menu_parent_' . $type, 'main-menu:0')); + $default = ($link['mlid'] ? $link['menu_name'] . ':' . $link['plid'] : variable_get('menu_parent_' . $type, 'main:0')); // If the current parent menu item is not present in options, use the first // available option as default value. // @todo User should not be allowed to access menu link settings in such a @@ -762,7 +762,7 @@ function menu_form_node_type_form_alter(&$form, $form_state) { $form['menu']['menu_options'] = array( '#type' => 'checkboxes', '#title' => t('Available menus'), - '#default_value' => variable_get('menu_options_' . $type->type, array('main-menu')), + '#default_value' => variable_get('menu_options_' . $type->type, array('main')), '#options' => $menu_options, '#description' => t('The menus available to place links in for this content type.'), ); @@ -774,7 +774,7 @@ function menu_form_node_type_form_alter(&$form, $form_state) { $form['menu']['menu_parent'] = array( '#type' => 'select', '#title' => t('Default parent item'), - '#default_value' => variable_get('menu_parent_' . $type->type, 'main-menu:0'), + '#default_value' => variable_get('menu_parent_' . $type->type, 'main:0'), '#options' => $options, '#description' => t('Choose the menu item to be the default parent for a new link in the content authoring form.'), '#attributes' => array('class' => array('menu-title-select')), diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 30a6dd5..313a119 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1800,7 +1800,7 @@ function node_menu() { $items['node'] = array( 'page callback' => 'node_page_default', 'access arguments' => array('access content'), - 'menu_name' => 'navigation', + 'menu_name' => 'tools', 'type' => MENU_CALLBACK, ); $items['node/add'] = array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php index 5c0ab5f..661a712 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php @@ -36,8 +36,8 @@ function setUp() { $this->admin_user = $this->drupalCreateUser($perms); $this->drupalLogin($this->admin_user); - // This test puts menu links in the Navigation menu and then tests for - // their presence on the page, so we need to ensure that the Navigation + // This test puts menu links in the Tools menu and then tests for + // their presence on the page, so we need to ensure that the Tools // block will be displayed in all active themes. db_update('block') ->fields(array( @@ -46,7 +46,7 @@ function setUp() { 'status' => 1, )) ->condition('module', 'system') - ->condition('delta', 'navigation') + ->condition('delta', 'tools') ->execute(); } @@ -110,13 +110,13 @@ function testBreadCrumbs() { $trail += array( 'admin/structure/menu' => t('Menus'), ); - $this->assertBreadcrumb('admin/structure/menu/manage/navigation', $trail); + $this->assertBreadcrumb('admin/structure/menu/manage/tools', $trail); $trail += array( - 'admin/structure/menu/manage/navigation' => t('Navigation'), + 'admin/structure/menu/manage/tools' => t('Tools'), ); $this->assertBreadcrumb("admin/structure/menu/item/6/edit", $trail); - $this->assertBreadcrumb('admin/structure/menu/manage/navigation/edit', $trail); - $this->assertBreadcrumb('admin/structure/menu/manage/navigation/add', $trail); + $this->assertBreadcrumb('admin/structure/menu/manage/tools/edit', $trail); + $this->assertBreadcrumb('admin/structure/menu/manage/tools/add', $trail); // Verify Node administration breadcrumbs. $trail = $admin + array( @@ -187,14 +187,14 @@ function testBreadCrumbs() { $this->assertBreadcrumb('node', $trail); // Verify node breadcrumbs (in menu). - // Do this separately for Main menu and Navigation menu, since only the + // Do this separately for Main menu and Tools menu, since only the // latter is a preferred menu by default. // @todo Also test all themes? Manually testing led to the suspicion that // breadcrumbs may differ, possibly due to template.php overrides. - $menus = array('main-menu', 'navigation'); + $menus = array('main', 'tools'); // Alter node type menu settings. variable_set("menu_options_$type", $menus); - variable_set("menu_parent_$type", 'navigation:0'); + variable_set("menu_parent_$type", 'tools:0'); foreach ($menus as $menu) { // Create a parent node in the current menu. @@ -256,15 +256,15 @@ function testBreadCrumbs() { $trail = array(); $this->assertBreadcrumb('node', $trail); - if ($menu == 'navigation') { + if ($menu == 'tools') { $parent = $node2; $child = $node3; } } - // Create a Navigation menu link for 'node', move the last parent node menu + // Create a Tools menu link for 'node', move the last parent node menu // link below it, and verify a full breadcrumb for the last child node. - $menu = 'navigation'; + $menu = 'tools'; $edit = array( 'link_title' => 'Root', 'link_path' => 'node', @@ -293,7 +293,7 @@ function testBreadCrumbs() { $this->assertBreadcrumb("node/{$child->nid}", $trail, $child->title, $tree); // Add a taxonomy term/tag to last node, and add a link for that term to the - // Navigation menu. + // Tools menu. $tags = array( 'Drupal' => array(), 'Breadcrumbs' => array(), @@ -354,7 +354,7 @@ function testBreadCrumbs() { // ('taxonomy/term/%') should never be translated and appear in any menu // other than the breadcrumb trail. $elements = $this->xpath('//div[@id=:menu]/descendant::a[@href=:href]', array( - ':menu' => 'block-system-navigation', + ':menu' => 'block-system-tools', ':href' => url($link['link_path']), )); $this->assertTrue(count($elements) == 1, "Link to {$link['link_path']} appears only once."); @@ -420,7 +420,7 @@ function testBreadCrumbs() { ); $this->assertBreadcrumb('user/' . $this->web_user->uid . '/edit', $trail, $this->web_user->name, $tree); - // Add a Navigation menu links for 'user' and $this->admin_user. + // Add a Tools menu links for 'user' and $this->admin_user. // Although it may be faster to manage these links via low-level API // functions, there's a lot that can go wrong in doing so. $this->drupalLogin($this->admin_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php index 094961c..72bcf3f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php @@ -45,7 +45,7 @@ function setUp() { db_merge('block') ->key(array( 'module' => 'system', - 'delta' => 'navigation', + 'delta' => 'tools', 'theme' => 'bartik', )) ->fields(array( @@ -265,7 +265,7 @@ function testMenuLinkMaintain() { // Move second link to the main-menu, to test caching later on. db_update('menu_links') - ->fields(array('menu_name' => 'main-menu')) + ->fields(array('menu_name' => 'main')) ->condition('link_title', 'Menu link #1-main') ->condition('customized', 0) ->condition('module', 'menu_test') diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php index eac8546..44ba998 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php @@ -33,8 +33,8 @@ function setUp() { $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages')); $this->drupalLogin($this->admin_user); - // This test puts menu links in the Navigation menu and then tests for - // their presence on the page, so we need to ensure that the Navigation + // This test puts menu links in the Tools menu and then tests for + // their presence on the page, so we need to ensure that the Tools // block will be displayed in all active themes. db_update('block') ->fields(array( @@ -43,11 +43,11 @@ function setUp() { 'status' => 1, )) ->condition('module', 'system') - ->condition('delta', 'navigation') + ->condition('delta', 'tools') ->execute(); - // This test puts menu links in the Management menu and then tests for - // their presence on the page, so we need to ensure that the Management + // This test puts menu links in the Administration menu and then tests for + // their presence on the page, so we need to ensure that the Administration // block will be displayed in all active themes. db_update('block') ->fields(array( @@ -56,7 +56,7 @@ function setUp() { 'status' => 1, )) ->condition('module', 'system') - ->condition('delta', 'management') + ->condition('delta', 'admin') ->execute(); } @@ -75,7 +75,7 @@ function testMenuTreeSetPath() { // the menu_test_menu_trail_callback() callback (used by all paths in these // tests) issues an overriding call to menu_trail_set_path(). $test_menu_path = array( - 'menu_name' => 'management', + 'menu_name' => 'admin', 'path' => 'admin/config/system/site-information', ); @@ -87,12 +87,12 @@ function testMenuTreeSetPath() { 'menu-test/menu-trail' => t('Menu trail - Case 1'), ); - // Test the tree generation for the Navigation menu. + // Test the tree generation for the Tools menu. variable_del('menu_test_menu_tree_set_path'); $this->assertBreadcrumb('menu-test/menu-trail', $breadcrumb, t('Menu trail - Case 1'), $tree); - // Override the active trail for the Management tree; it should not affect - // the Navigation tree. + // Override the active trail for the Administration tree; it should not affect + // the Tools tree. variable_set('menu_test_menu_tree_set_path', $test_menu_path); $this->assertBreadcrumb('menu-test/menu-trail', $breadcrumb, t('Menu trail - Case 1'), $tree); @@ -113,12 +113,12 @@ function testMenuTreeSetPath() { 'admin/config/system/site-information' => t('Site information'), ); - // Test the tree generation for the Management menu. + // Test the tree generation for the Administration menu. variable_del('menu_test_menu_tree_set_path'); $this->assertBreadcrumb('admin/config/development/menu-trail', $breadcrumb, t('Menu trail - Case 2'), $tree); - // Override the active trail for the Management tree; it should affect the - // breadcrumbs and Management tree. + // Override the active trail for the Administration tree; it should affect the + // breadcrumbs and Administration tree. variable_set('menu_test_menu_tree_set_path', $test_menu_path); $this->assertBreadcrumb('admin/config/development/menu-trail', $override_breadcrumb, t('Menu trail - Case 2'), $override_tree); } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 0f6d668..9e20502 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -615,7 +615,7 @@ function hook_route_info() { * * This hook enables modules to register paths in order to define how URL * requests are handled. Paths may be registered for URL handling only, or they - * can register a link to be placed in a menu (usually the Navigation menu). A + * can register a link to be placed in a menu (usually the Tools menu). A * path and its associated information is commonly called a "menu router item". * This hook is rarely called (for example, when modules are enabled), and * its results are cached in the database. @@ -867,7 +867,7 @@ function hook_route_info() { * the menu; higher-weighted items sink. Defaults to 0. Menu items with the * same weight are ordered alphabetically. * - "menu_name": Optional. Set this to a custom menu if you don't want your - * item to be placed in Navigation. + * item to be placed in the default Tools menu. * - "context": (optional) Defines the context a tab may appear in. By * default, all tabs are only displayed as local tasks when being rendered * in a page context. All tabs that should be accessible as contextual links diff --git a/core/modules/system/system.install b/core/modules/system/system.install index a8819c1..81373c2 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1033,7 +1033,7 @@ function system_schema() { 'description' => 'Contains the individual links within a menu.', 'fields' => array( 'menu_name' => array( - 'description' => "The menu name. All links with the same menu name (such as 'navigation') are part of the same menu.", + 'description' => "The menu name. All links with the same menu name (such as 'tools') are part of the same menu.", 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, @@ -2188,6 +2188,24 @@ function system_update_8030() { } /** + * Rename default menu names. + */ +function system_update_8031() { + $map = array( + 'navigation' => 'tools', + 'management' => 'admin', + 'user-menu' => 'account', + 'main-menu' => 'main', + ); + foreach ($map as $old => $new) { + db_update('menu_links') + ->condition('menu_name', $old) + ->fields(array('menu_name' => $new)) + ->execute(); + } +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 255c669..25d383e 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -608,7 +608,7 @@ function system_menu() { 'access arguments' => array('access administration pages'), 'page callback' => 'system_admin_menu_block_page', 'weight' => 9, - 'menu_name' => 'management', + 'menu_name' => 'admin', 'file' => 'system.admin.inc', ); $items['admin/compact'] = array( diff --git a/core/modules/toolbar/templates/toolbar.tpl.php b/core/modules/toolbar/templates/toolbar.tpl.php index 5b03fee..b3d561c 100644 --- a/core/modules/toolbar/templates/toolbar.tpl.php +++ b/core/modules/toolbar/templates/toolbar.tpl.php @@ -10,7 +10,7 @@ * It includes the 'class' information, which includes: * - toolbar: The current template type, i.e., "theming hook". * - $toolbar['toolbar_user']: User account / logout links. - * - $toolbar['toolbar_menu']: Top level management menu links. + * - $toolbar['toolbar_menu']: Top level Administration menu links. * - $toolbar['toolbar_drawer']: A place for extended toolbar content. * * @see template_preprocess() diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 3717d7b..a54743a 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -278,9 +278,9 @@ function toolbar_view() { */ function toolbar_get_menu_tree() { $tree = array(); - $admin_link = db_query('SELECT * FROM {menu_links} WHERE menu_name = :menu_name AND module = :module AND link_path = :path', array(':menu_name' => 'management', ':module' => 'system', ':path' => 'admin'))->fetchAssoc(); + $admin_link = db_query('SELECT * FROM {menu_links} WHERE menu_name = :menu_name AND module = :module AND link_path = :path', array(':menu_name' => 'admin', ':module' => 'system', ':path' => 'admin'))->fetchAssoc(); if ($admin_link) { - $tree = menu_build_tree('management', array( + $tree = menu_build_tree('admin', array( 'expanded' => array($admin_link['mlid']), 'min_depth' => $admin_link['depth'] + 1, 'max_depth' => $admin_link['depth'] + 1, diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module index 7060a87..301ea8f 100644 --- a/core/modules/tracker/tracker.module +++ b/core/modules/tracker/tracker.module @@ -17,8 +17,8 @@ function tracker_help($path, $arg) { $output .= '

' . t('The Tracker module displays the most recently added and updated content on your site, and allows you to follow new content created by each user. This module has no configuration options. For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/documentation/modules/tracker')) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; - $output .= '
' . t('Navigation') . '
'; - $output .= '
' . t('The Tracker module adds a new menu item to the Navigation menu, called Recent content. You can configure menu items via the Menus administration page.', array('@menus' => url('admin/structure/menu'))) . '
'; + $output .= '
' . t('Tracker navigation') . '
'; + $output .= '
' . t('The Tracker module adds a new menu item to the Tools menu, called Recent content. You can configure menu items via the Menus administration page.', array('@menus' => url('admin/structure/menu'))) . '
'; $output .= '
' . t('Tracking new and updated site content') . '
'; $output .= '
' . t("The Recent content page shows new and updated content in reverse chronological order, listing the content type, title, author's name, number of comments, and time of last update. Content is considered updated when changes occur in the text, or when new comments are added. The My recent content tab limits the list to the currently logged-in user.", array('@recent' => url('tracker'))) . '
'; $output .= '
' . t('Tracking user-specific content') . '
'; diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php index f6e0b18..a813f9f 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php @@ -73,14 +73,14 @@ function testDisabledAccountLink() { $this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer menu'))); // Verify that the 'My account' link is enabled. - $this->drupalGet('admin/structure/menu/manage/user-menu'); + $this->drupalGet('admin/structure/menu/manage/account'); $this->assertFieldChecked('edit-mlid2-hidden', "The 'My account' link is enabled by default."); // Disable the 'My account' link. $edit = array( 'mlid:2[hidden]' => FALSE, ); - $this->drupalPost('admin/structure/menu/manage/user-menu', $edit, t('Save configuration')); + $this->drupalPost('admin/structure/menu/manage/account', $edit, t('Save configuration')); // Get the homepage. $this->drupalGet(''); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index fae45ad..871bf66 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1177,7 +1177,7 @@ function user_menu() { 'access callback' => TRUE, 'file' => 'user.pages.inc', 'weight' => -10, - 'menu_name' => 'user-menu', + 'menu_name' => 'account', ); $items['user/login'] = array( @@ -1221,7 +1221,7 @@ function user_menu() { 'access callback' => 'user_is_logged_in', 'page callback' => 'user_logout', 'weight' => 10, - 'menu_name' => 'user-menu', + 'menu_name' => 'account', 'file' => 'user.pages.inc', ); @@ -1411,7 +1411,7 @@ function user_menu_link_alter(&$link) { $link['options']['alter'] = TRUE; } - // Force the Logout link to appear on the top-level of 'user-menu' menu by + // Force the Logout link to appear on the top-level of 'account' menu by // default (i.e., unless it has been customized). if ($link['link_path'] == 'user/logout' && $link['module'] == 'system' && empty($link['customized'])) { $link['plid'] = 0; diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install index 6c8ec84..a25fdec 100644 --- a/core/profiles/minimal/minimal.install +++ b/core/profiles/minimal/minimal.install @@ -28,7 +28,7 @@ function minimal_install() { ), array( 'module' => 'system', - 'delta' => 'navigation', + 'delta' => 'tools', 'theme' => $default_theme, 'status' => 1, 'weight' => 0, diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index 4eeb8d6..87fb69f 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -110,7 +110,7 @@ function standard_install() { ), array( 'module' => 'system', - 'delta' => 'navigation', + 'delta' => 'tools', 'theme' => $default_theme, 'status' => 1, 'weight' => 0, @@ -397,7 +397,7 @@ function standard_install() { $item = array( 'link_title' => st('Home'), 'link_path' => '', - 'menu_name' => 'main-menu', + 'menu_name' => 'main', ); menu_link_save($item);