commit fdff1c90f668af7641a62cc2d21220f2284b8191 Author: Lee Rowlands Date: Tue Apr 16 16:04:06 2013 +1000 Patch 87 diff --git a/core/modules/block/tests/block_test.info.yml b/core/modules/block/tests/block_test.info.yml index ab2ae8e..2628e9f 100644 --- a/core/modules/block/tests/block_test.info.yml +++ b/core/modules/block/tests/block_test.info.yml @@ -5,5 +5,5 @@ version: VERSION core: 8.x hidden: true regions: - account: 'Account links' + secondary_menu: 'Secondary Menu' main_menu: 'Main menu' diff --git a/core/modules/block/tests/themes/block_test_theme/block_test_theme.info b/core/modules/block/tests/themes/block_test_theme/block_test_theme.info deleted file mode 100644 index 5c20015..0000000 --- a/core/modules/block/tests/themes/block_test_theme/block_test_theme.info +++ /dev/null @@ -1,16 +0,0 @@ -name = Block test theme -description = Theme for testing the block system -core = 8.x -hidden = TRUE - -regions[account] = Account links -regions[main_menu] = Main menu -regions[sidebar_first] = Left sidebar -regions_hidden[] = sidebar_first -regions[sidebar_second] = Right sidebar -regions_hidden[] = sidebar_second -regions[content] = Content -regions[header] = Header -regions[footer] = Footer -regions[highlighted] = Highlighted -regions[help] = Help diff --git a/core/modules/block/tests/themes/block_test_theme/block_test_theme.info.yml b/core/modules/block/tests/themes/block_test_theme/block_test_theme.info.yml index 6057fb5..c5d8198 100644 --- a/core/modules/block/tests/themes/block_test_theme/block_test_theme.info.yml +++ b/core/modules/block/tests/themes/block_test_theme/block_test_theme.info.yml @@ -10,8 +10,8 @@ regions: footer: Footer highlighted: Highlighted help: Help - main_menu: Main Menu - account: Account + main_menu: 'Main Menu' + secondary_menu: 'Secondary Menu' regions_hidden: - sidebar_first - sidebar_second diff --git a/core/modules/block/tests/themes/block_test_theme/page.tpl.php b/core/modules/block/tests/themes/block_test_theme/page.tpl.php index 0e93b1c..905ef97 100644 --- a/core/modules/block/tests/themes/block_test_theme/page.tpl.php +++ b/core/modules/block/tests/themes/block_test_theme/page.tpl.php @@ -38,9 +38,9 @@ - + diff --git a/core/modules/menu/config/schema/menu.schema.yml b/core/modules/menu/config/schema/menu.schema.yml index e91b4d7..2752c28 100644 --- a/core/modules/menu/config/schema/menu.schema.yml +++ b/core/modules/menu/config/schema/menu.schema.yml @@ -4,12 +4,6 @@ menu.settings: type: mapping label: 'Menu settings' mapping: - main_links: - type: string - label: 'Main links' - secondary_links: - type: string - label: 'Source for secondary links' override_parent_selector: type: boolean label: 'Override parent selector' diff --git a/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php b/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php deleted file mode 100644 index 6bcbba2..0000000 --- a/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php +++ /dev/null @@ -1,72 +0,0 @@ -configFactory->get('menu.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(); - - $main = $config->get('main_links'); - $form['menu_main_links_source'] = array( - '#type' => 'select', - '#title' => t('Source for the Main links'), - '#default_value' => $main, - '#empty_option' => t('No Main links'), - '#options' => $menu_options, - '#tree' => FALSE, - '#description' => t('Select what should be displayed as the Main links (typically at the top of the page).'), - ); - - $form['menu_secondary_links_source'] = array( - '#type' => 'select', - '#title' => t('Source for the Secondary links'), - '#default_value' => $config->get('secondary_links'), - '#empty_option' => t('No Secondary links'), - '#options' => $menu_options, - '#tree' => FALSE, - '#description' => t('Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links.', array('%main' => $main ? $menu_options[$main] : t('none'))), - ); - - return parent::buildForm($form, $form_state); - } - - /** - * Implements \Drupal\Core\Form\FormInterface::submitForm(). - */ - public function submitForm(array &$form, array &$form_state) { - $this->configFactory->get('menu.settings') - ->set('main_links', $form_state['values']['menu_main_links_source']) - ->set('secondary_links', $form_state['values']['menu_secondary_links_source']) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php index 9575550..1c9d14f 100644 --- a/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php +++ b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php @@ -75,7 +75,13 @@ protected function blockBuild() { // that should be injected here. $links = menu_navigation_links($menu_name, $level); // Do not output this entire block if there are no visible/accessible links. - // @todo This is insufficient for the real world. Respect #access. + // Filter the links to remove those with #access set to FALSE. + array_filter($links, function($link) { + if (isset($link['#access']) && $link['#access'] === FALSE) { + return FALSE; + } + return TRUE; + }); if (empty($links)) { return array(); } diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index bb2ee20..85dc764 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -34,7 +34,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - $this->drupalPlaceBlock('menu_navigation', array('region' => 'account'), array('menu' => 'account')); + $this->drupalPlaceBlock('menu_navigation', array('region' => 'secondary_menu'), array('menu' => 'account')); $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); @@ -604,13 +604,6 @@ private function verifyAccess($response = 200, $menu_name = 'tools') { $this->assertText(t('Edit menu item'), 'Menu edit node was displayed'); } - // View menu settings node. - $this->drupalGet('admin/structure/menu/settings'); - $this->assertResponse($response); - if ($response == 200) { - $this->assertText(t('Menus'), 'Menu settings node was displayed'); - } - // View add menu node. $this->drupalGet('admin/structure/menu/add'); $this->assertResponse($response); diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index b0c4720..9cab843 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -90,13 +90,6 @@ function menu_menu() { 'type' => MENU_LOCAL_ACTION, 'file' => 'menu.admin.inc', ); - $items['admin/structure/menu/settings'] = array( - 'title' => 'Settings', - 'route_name' => 'menu_settings', - 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); $items['admin/structure/menu/manage/%menu'] = array( 'title' => 'Edit menu', 'page callback' => 'menu_menu_edit', diff --git a/core/modules/menu/menu.routing.yml b/core/modules/menu/menu.routing.yml index aafe5c3..c6862c4 100644 --- a/core/modules/menu/menu.routing.yml +++ b/core/modules/menu/menu.routing.yml @@ -1,10 +1,3 @@ -menu_settings: - pattern: '/admin/structure/menu/settings' - defaults: - _form: 'Drupal\menu\MenuSettingsForm' - requirements: - _permission: 'administer menu' - menu_link_reset: pattern: 'admin/structure/menu/item/{menu_link}/reset' defaults: diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php index aa6a986..9b9feb5 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php @@ -15,7 +15,7 @@ abstract class OpenIDTestBase extends WebTestBase { /** - * The user account links block placed in the account region. + * The user account links block placed in the content region. * * @var \Drupal\block\Plugin\Core\Entity\Block */ diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b209f4c..a2b2d05 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -3017,7 +3017,7 @@ function _system_rebuild_theme_data() { $defaults = array( 'engine' => 'phptemplate', 'regions' => array( - 'account' => 'Account links', + 'secondary_menu' => 'Secondary menu', 'main_menu' => 'Main navigation', 'sidebar_first' => 'Left sidebar', 'sidebar_second' => 'Right sidebar', diff --git a/core/modules/system/templates/page.tpl.php b/core/modules/system/templates/page.tpl.php index fd6e3cc..b92fa21 100644 --- a/core/modules/system/templates/page.tpl.php +++ b/core/modules/system/templates/page.tpl.php @@ -52,7 +52,7 @@ * comment/reply/12345). * * Regions: - * - $page['account']: Items for the account region. + * - $page['secondary_menu']: Items for the secondary menu region. * - $page['main_menu']: Items for the main menu region. * - $page['help']: Dynamic help text, mostly for admin pages. * - $page['highlighted']: Items for the highlighted content region. @@ -100,9 +100,9 @@ - + diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php index ce01c2b..ef1934d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php @@ -15,7 +15,7 @@ class UserAccountLinksTests extends WebTestBase { /** - * The user account links block placed in the account region. + * The user account links block placed in the secondary menu region. * * @var \Drupal\block\Plugin\Core\Entity\Block */ @@ -38,7 +38,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - $this->block = $this->drupalPlaceBlock('menu_navigation', array('region' => 'account'), array( + $this->block = $this->drupalPlaceBlock('menu_navigation', array('region' => 'secondary_menu'), array( 'menu' => 'account', 'level' => 0, 'id' => 'secondary-menu', diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php index 8de1715..732d93f 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php @@ -29,7 +29,7 @@ class UserPasswordResetTest extends WebTestBase { protected $account; /** - * The user account links block placed in the account region. + * The user account links block placed in the content region. * * @var \Drupal\block\Plugin\Core\Entity\Block */ diff --git a/core/profiles/standard/config/block.block.bartik.account_links.yml b/core/profiles/standard/config/block.block.bartik.account_links.yml index 97b183c..64bdb5f 100644 --- a/core/profiles/standard/config/block.block.bartik.account_links.yml +++ b/core/profiles/standard/config/block.block.bartik.account_links.yml @@ -1,6 +1,6 @@ id: bartik.account_links label: 'Account links' -region: account +region: secondary_menu weight: '0' module: menu status: '1' diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index b473a2a..edece99 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -272,7 +272,7 @@ function standard_install() { * * @ingroup config_upgrade */ -function standard_update_8001() { +function standard_update_8000() { // Place main-menu. $block = config('block.block.bartik.main_menu'); $uuid = new Uuid(); @@ -301,7 +301,7 @@ function standard_update_8001() { ->set('uuid', $uuid->generate()) ->set('plugin', 'menu_navigation') ->set('module', 'menu') - ->set('region', 'account') + ->set('region', 'secondary_menu') ->set('weight', 0) ->set('status', 1) ->set('visibility', array()) diff --git a/core/themes/bartik/bartik.info.yml b/core/themes/bartik/bartik.info.yml index 6a45674..9ef13af 100644 --- a/core/themes/bartik/bartik.info.yml +++ b/core/themes/bartik/bartik.info.yml @@ -28,7 +28,7 @@ regions: footer_thirdcolumn: 'Footer third column' footer_fourthcolumn: 'Footer fourth column' footer: Footer - account: 'Account links' + secondary_menu: 'Secondary menu' main_menu: 'Main menu' settings: shortcut_module_link: '0' diff --git a/core/themes/bartik/templates/page.tpl.php b/core/themes/bartik/templates/page.tpl.php index e020c09..cfda270 100644 --- a/core/themes/bartik/templates/page.tpl.php +++ b/core/themes/bartik/templates/page.tpl.php @@ -59,7 +59,7 @@ * comment/reply/12345). * * Regions: - * - $page['account']: Items for the account region. + * - $page['secondary_menu']: Items for the secondary menu region. * - $page['header']: Items for the header region. * - $page['main_menu']: Items for the main menu region. * - $page['featured']: Items for the featured region. @@ -88,7 +88,7 @@