diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php index 0acf4bc..e2a2499 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -126,7 +126,7 @@ public function __construct(ControllerResolverInterface $controller_resolver, Re $this->accessManager = $access_manager; $this->account = $account; $this->alterInfo($module_handler, 'local_tasks'); - $this->setCacheBackend($cache, $language_manager, 'local_task_plugins', array('local_task' => 1)); + $this->setCacheBackend($cache, $language_manager, 'local_task_plugins', array('local_task' => TRUE)); } /** diff --git a/core/modules/contact/contact.local_tasks.yml b/core/modules/contact/contact.local_tasks.yml index 91bb65d..2eee1ee 100644 --- a/core/modules/contact/contact.local_tasks.yml +++ b/core/modules/contact/contact.local_tasks.yml @@ -2,3 +2,9 @@ contact.category_edit: title: 'Edit' route_name: contact.category_edit tab_root_id: contact.category_edit + +contact.personal_page: + title: 'Contact' + route_name: contact.personal_page + weight: 2 + tab_root_id: user.view diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 58e343e..ea616d8 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -81,12 +81,6 @@ function contact_menu() { 'route_name' => 'contact.site_page_category', 'type' => MENU_VISIBLE_IN_BREADCRUMB, ); - $items['user/%user/contact'] = array( - 'title' => 'Contact', - 'route_name' => 'contact.personal_page', - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); return $items; } diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 3951c1e..7f5074e 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -178,20 +178,6 @@ function content_translation_menu() { $item[str_replace('_', ' ', $key)] = $value; } - $items["$path/translations"] = array( - 'title' => 'Translate', - 'route_name' => $info['links']['drupal:content-translation-overview'], - 'type' => MENU_LOCAL_TASK, - 'context' => MENU_CONTEXT_PAGE, - 'weight' => 2, - ) + $item; - - $items["$path/translations/overview"] = array( - 'title' => 'Overview', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 0, - ); - // Add translation callback. // @todo Add the access callback instead of replacing it as soon as the // routing system supports multiple callbacks. diff --git a/core/modules/entity/entity.local_tasks.yml b/core/modules/entity/entity.local_tasks.yml index 54895b4..8189782 100644 --- a/core/modules/entity/entity.local_tasks.yml +++ b/core/modules/entity/entity.local_tasks.yml @@ -7,3 +7,18 @@ entity.form_mode_edit: title: 'Edit' route_name: entity.form_mode_edit tab_root_id: entity.form_mode_edit + +entity.view_mode_list: + title: List + route_name: entity.view_mode_list + tab_root_id: entity.view_mode_list + +entity.view_mode_list: + title: List + route_name: entity.view_mode_list + tab_root_id: entity.view_mode_list + +entity.form_mode_list: + title: List + route_name: entity.form_mode_list + tab_root_id: entity.form_mode_list diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 9cd45d4..33397b9 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -39,10 +39,6 @@ function entity_menu() { 'description' => 'Manage custom view modes.', 'route_name' => 'entity.view_mode_list', ); - $items['admin/structure/display-modes/view/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['admin/structure/display-modes/view/add'] = array( 'title' => 'Add view mode', 'route_name' => 'entity.view_mode_add', @@ -61,10 +57,6 @@ function entity_menu() { 'description' => 'Manage custom form modes.', 'route_name' => 'entity.form_mode_list', ); - $items['admin/structure/display-modes/form/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['admin/structure/display-modes/form/add'] = array( 'title' => 'Add form mode', 'route_name' => 'entity.form_mode_add', diff --git a/core/modules/filter/filter.local_tasks.yml b/core/modules/filter/filter.local_tasks.yml index 9f7e8e9..56cbb87 100644 --- a/core/modules/filter/filter.local_tasks.yml +++ b/core/modules/filter/filter.local_tasks.yml @@ -3,3 +3,8 @@ filter.format_edit_tab: title: 'Configure' tab_root_id: filter.format_edit_tab weight: -10 + +filter.admin_overview: + title: List + route_name: filter.admin_overview + tab_root_id: filter.admin_overview diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 922688d..4962044 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -136,10 +136,6 @@ function filter_menu() { 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', 'route_name' => 'filter.admin_overview', ); - $items['admin/config/content/formats/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['admin/config/content/formats/manage/%'] = array( 'title callback' => 'entity_page_label', 'title arguments' => array(5), diff --git a/core/modules/image/image.local_tasks.yml b/core/modules/image/image.local_tasks.yml index 3aeeebd..3bff783 100644 --- a/core/modules/image/image.local_tasks.yml +++ b/core/modules/image/image.local_tasks.yml @@ -2,3 +2,8 @@ image.style_edit: title: 'Edit' route_name: image.style_edit tab_root_id: image.style_edit + +image.style_list: + title: List + route_name: image.style_list + tab_root_id: image.style_list diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 23443ff..5b0d9a3 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -95,11 +95,6 @@ function image_menu() { 'description' => 'Configure styles that can be used for resizing or adjusting images on display.', 'route_name' => 'image.style_list', ); - $items['admin/config/media/image-styles/list'] = array( - 'title' => 'List', - 'description' => 'List the current image styles on the site.', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['admin/config/media/image-styles/manage/%image_style'] = array( 'title' => 'Edit style', 'description' => 'Configure an image style.', diff --git a/core/modules/menu/menu.local_tasks.yml b/core/modules/menu/menu.local_tasks.yml index 3b2bf45..bcf4de8 100644 --- a/core/modules/menu/menu.local_tasks.yml +++ b/core/modules/menu/menu.local_tasks.yml @@ -2,3 +2,14 @@ menu.menu_edit: title: 'Edit menu' route_name: menu.menu_edit tab_root_id: menu.menu_edit + +menu.overview_page: + title: 'List' + route_name: menu.overview_page + tab_root_id: menu.overview_page + +menu.settings: + title: 'Settings' + route_name: menu.settings + tab_root_id: menu.overview_page + weight: 100 diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index fc149ee..3a30bfc 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -71,16 +71,6 @@ function menu_menu() { 'description' => 'Add new menus to your site, edit existing menus, and rename and reorganize menu links.', 'route_name' => 'menu.overview_page', ); - $items['admin/structure/menu/list'] = array( - 'title' => 'List menus', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/structure/menu/settings'] = array( - 'title' => 'Settings', - 'route_name' => 'menu.settings', - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); $items['admin/structure/menu/manage/%menu'] = array( 'title' => 'Edit menu', 'route_name' => 'menu.menu_edit', diff --git a/core/modules/node/node.local_tasks.yml b/core/modules/node/node.local_tasks.yml index ecf6298..4c6379b 100644 --- a/core/modules/node/node.local_tasks.yml +++ b/core/modules/node/node.local_tasks.yml @@ -20,3 +20,7 @@ node.type_edit: title: 'Edit' route_name: node.type_edit tab_root_id: node.type_edit +node.overview_types: + title: List + route_name: node.overview_types + tab_root_id: node.overview_types diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a1bde76..68a9f92 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -995,10 +995,6 @@ function node_menu() { 'description' => 'Manage content types, including default status, front page promotion, comment settings, etc.', 'route_name' => 'node.overview_types', ); - $items['admin/structure/types/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['node/add'] = array( 'title' => 'Add content', 'route_name' => 'node.add_page', diff --git a/core/modules/path/path.local_tasks.yml b/core/modules/path/path.local_tasks.yml new file mode 100644 index 0000000..84e74d2 --- /dev/null +++ b/core/modules/path/path.local_tasks.yml @@ -0,0 +1,4 @@ +path.admin_overview: + title: List + route_name: path.admin_overview + tab_root_id: path.admin_overview diff --git a/core/modules/path/path.module b/core/modules/path/path.module index d33f881..7e48e74 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -62,10 +62,6 @@ function path_menu() { 'route_name' => 'path.admin_overview', 'weight' => -5, ); - $items['admin/config/search/path/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['admin/config/search/path/edit/%path'] = array( 'title' => 'Edit alias', 'route_name' => 'path.admin_edit', diff --git a/core/modules/picture/picture.local_tasks.yml b/core/modules/picture/picture.local_tasks.yml new file mode 100644 index 0000000..29b8446 --- /dev/null +++ b/core/modules/picture/picture.local_tasks.yml @@ -0,0 +1,5 @@ +picture.mapping_page_edit: + title: Edit + route_name: picture.mapping_page_edit + tab_root_id: picture.mapping_page_edit + weight: -10 diff --git a/core/modules/picture/picture.module b/core/modules/picture/picture.module index b9b3b01..72f52a5 100644 --- a/core/modules/picture/picture.module +++ b/core/modules/picture/picture.module @@ -63,11 +63,6 @@ function picture_menu() { 'title' => 'Edit picture mapping', 'route_name' => 'picture.mapping_page_edit', ); - $items['admin/config/media/picturemapping/%picture_mapping/edit'] = array( - 'title' => 'Edit', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); $items['admin/config/media/picturemapping/%picture_mapping/duplicate'] = array( 'title' => 'Duplicate picture mapping', 'route_name' => 'picture.mapping_page_duplicate', diff --git a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php index 0ceef4b..5d2335c 100644 --- a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php +++ b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php @@ -6,6 +6,7 @@ namespace Drupal\search\Form; +use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\Context\ContextInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -263,6 +264,7 @@ public function submitForm(array &$form, array &$form_state) { $this->searchSettings->set('active_plugins', $new_plugins); drupal_set_message($this->t('The active search plugins have been changed.')); $this->state->set('menu_rebuild_needed', TRUE); + Cache::deleteTags(array('local_task' => TRUE)); } $this->searchSettings->save(); } diff --git a/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php b/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php new file mode 100644 index 0000000..f18e699 --- /dev/null +++ b/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php @@ -0,0 +1,42 @@ +derivatives = array(); + + $default_info = search_get_default_plugin_info(); + if ($default_info) { + foreach (\Drupal::service('plugin.manager.search')->getActiveDefinitions() as $plugin_id => $search_info) { + $this->derivatives[$plugin_id] = array( + 'title' => $search_info['title'], + 'route_name' => 'search.view_' . $plugin_id, + 'tab_root_id' => 'search.plugins:' . $default_info['id'], + ); + if ($plugin_id == $default_info['id']) { + $this->derivatives[$plugin_id]['weight'] = -10; + } + else { + $this->derivatives[$plugin_id]['weight'] = 0; + } + } + } + return $this->derivatives; + } + +} diff --git a/core/modules/search/search.local_tasks.yml b/core/modules/search/search.local_tasks.yml new file mode 100644 index 0000000..ac332d7 --- /dev/null +++ b/core/modules/search/search.local_tasks.yml @@ -0,0 +1,3 @@ +search.plugins: + class: \Drupal\Core\Menu\LocalTaskDefault + derivative: \Drupal\search\Plugin\Derivative\SearchLocalTask diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 56e6859..4afd6dc 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -167,25 +167,6 @@ function search_menu() { 'type' => MENU_VISIBLE_IN_BREADCRUMB, ); - // Add paths for searching. We add each plugin search path twice: once without - // and once with %menu_tail appended. The reason for this is that we want to - // preserve keywords when switching tabs, and also to have search tabs - // highlighted properly. The only way to do that within the Drupal menu - // system appears to be having two sets of tabs. See discussion on issue - // http://drupal.org/node/245103 for details. - - $default_info = search_get_default_plugin_info(); - if ($default_info) { - foreach (\Drupal::service('plugin.manager.search')->getActiveDefinitions() as $plugin_id => $search_info) { - $path = 'search/' . $search_info['path']; - $items[$path] = array( - 'title' => $search_info['title'], - 'route_name' => 'search.view_' . $plugin_id, - 'type' => MENU_LOCAL_TASK, - 'weight' => $plugin_id == $default_info['id'] ? -10 : 0, - ); - } - } return $items; } diff --git a/core/modules/simpletest/simpletest.local_tasks.yml b/core/modules/simpletest/simpletest.local_tasks.yml new file mode 100644 index 0000000..b6eea38 --- /dev/null +++ b/core/modules/simpletest/simpletest.local_tasks.yml @@ -0,0 +1,9 @@ +simpletest.test_form: + title: List + route_name: simpletest.test_form + tab_root_id: simpletest.test_form +simpletest.settings: + title: Settings + route_name: simpletest.settings + tab_root_id: simpletest.test_form + weight: 100 diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 5d15878..bd50676 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -38,17 +38,6 @@ function simpletest_menu() { 'route_name' => 'simpletest.test_form', 'weight' => -5, ); - $items['admin/config/development/testing/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/config/development/testing/settings'] = array( - 'title' => 'Settings', - 'route_name' => 'simpletest.settings', - 'access arguments' => array('administer unit tests'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); $items['admin/config/development/testing/results/%'] = array( 'title' => 'Test result', 'description' => 'View result of tests.', diff --git a/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml b/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml new file mode 100644 index 0000000..ea4a6fd --- /dev/null +++ b/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml @@ -0,0 +1,46 @@ +batch_test.test_form: + title: Simple + route_name: batch_test.test_form + tab_root_id: batch_test.test_form + +batch_test.multistep: + title: Multistep + route_name: batch_test.multistep + tab_root_id: batch_test.test_form + weight: 1 + +batch_test.chained: + title: Chained + route_name: batch_test.chained + tab_root_id: batch_test.test_form + weight: 2 + +batch_test.programmatic: + title: Chained + route_name: batch_test.programmatic + tab_root_id: batch_test.test_form + weight: 3 + +batch_test.no_form: + title: 'No form' + route_name: batch_test.no_form + tab_root_id: batch_test.test_form + weight: 4 + +batch_test.large_percentage: + title: 'Large percentage' + route_name: batch_test.large_percentage + tab_root_id: batch_test.test_form + weight: 5 + +batch_test.nested_programmatic: + title: 'Nested programmatic' + route_name: batch_test.nested_programmatic + tab_root_id: batch_test.test_form + weight: 6 + +batch_test.redirect: + title: 'Redirect' + route_name: batch_test.redirect + tab_root_id: batch_test.test_form + weight: 7 diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index 0dbbff8..ba8b273 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -15,57 +15,6 @@ function batch_test_menu() { 'title' => 'Batch test', 'route_name' => 'batch_test.test_form', ); - // Simple form: one submit handler, setting a batch. - $items['batch-test/simple'] = array( - 'title' => 'Simple', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 0, - ); - // Multistep form: two steps, each setting a batch. - $items['batch-test/multistep'] = array( - 'title' => 'Multistep', - 'route_name' => 'batch_test.multistep', - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - // Chained form: four submit handlers, several of which set a batch. - $items['batch-test/chained'] = array( - 'title' => 'Chained', - 'route_name' => 'batch_test.chained', - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - // Programmatic form: the page submits the 'Chained' form through - // drupal_form_submit(). - $items['batch-test/programmatic'] = array( - 'route_name' => 'batch_test.programmatic', - 'type' => MENU_LOCAL_TASK, - 'weight' => 3, - ); - // No form: fire a batch simply by accessing a page. - $items['batch-test/no-form'] = array( - 'route_name' => 'batch_test.no_form', - 'type' => MENU_LOCAL_TASK, - 'weight' => 4, - ); - // No form: fire a batch; return > 100% complete - $items['batch-test/large-percentage'] = array( - 'route_name' => 'batch_test.large_percentage', - 'type' => MENU_LOCAL_TASK, - 'weight' => 5, - ); - // Tests programmatic form submission within a batch operation. - $items['batch-test/nested-programmatic'] = array( - 'route_name' => 'batch_test.nested_programmatic', - 'type' => MENU_LOCAL_TASK, - 'weight' => 6, - ); - // Landing page to test redirects. - $items['batch-test/redirect'] = array( - 'route_name' => 'batch_test.redirect', - 'type' => MENU_LOCAL_TASK, - 'weight' => 7, - ); return $items; } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index c5f6153..1db21da 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -260,15 +260,6 @@ function taxonomy_menu() { 'title callback' => 'entity_page_label', 'title arguments' => array(4), ); - $items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/edit'] = array( - 'title' => 'Edit', - 'route_name' => 'taxonomy.vocabulary_edit', - 'type' => MENU_LOCAL_TASK, - ); return $items; } diff --git a/core/modules/user/user.local_tasks.yml b/core/modules/user/user.local_tasks.yml index c418f0b..91553d0 100644 --- a/core/modules/user/user.local_tasks.yml +++ b/core/modules/user/user.local_tasks.yml @@ -41,3 +41,13 @@ user.edit: route_name: user.edit tab_root_id: user.view title: Edit + +user.admin_account: + title: List + route_name: user.admin_account + tab_root_id: user.admin_account + +user.admin_permissions: + title: Permissions + route_name: user.admin_permissions + tab_root_id: user.admin_account diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 91e18d5..e924e0c 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -770,16 +770,13 @@ function user_menu() { 'position' => 'left', 'weight' => -4, ); - $items['admin/people/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); + // Permissions and role forms. $items['admin/people/permissions'] = array( 'title' => 'Permissions', 'description' => 'Determine access to features by selecting permissions for roles.', 'route_name' => 'user.admin_permissions', - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_SIBLING_LOCAL_TASK, ); $items['admin/people/roles/manage/%user_role'] = array(