Issue #2147501 by dawehner: Convert most of the left over local tasks.

8.0.x
webchick 2013-12-07 15:16:21 -08:00
parent b833c53dc5
commit a16eb5a389
29 changed files with 165 additions and 156 deletions

View File

@ -126,7 +126,7 @@ class LocalTaskManager extends DefaultPluginManager {
$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));
}
/**

View File

@ -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

View File

@ -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;
}

View File

@ -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.

View File

@ -7,3 +7,13 @@ 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.form_mode_list:
title: List
route_name: entity.form_mode_list
tab_root_id: entity.form_mode_list

View File

@ -62,10 +62,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',
@ -84,10 +80,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',

View File

@ -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

View File

@ -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),

View File

@ -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

View File

@ -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.',

View File

@ -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

View File

@ -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',

View File

@ -24,3 +24,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

View File

@ -991,10 +991,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',

View File

@ -0,0 +1,4 @@
path.admin_overview:
title: List
route_name: path.admin_overview
tab_root_id: path.admin_overview

View File

@ -63,10 +63,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',

View File

@ -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

View File

@ -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',

View File

@ -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 @@ class SearchSettingsForm extends ConfigFormBase {
$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();
}

View File

@ -0,0 +1,42 @@
<?php
/**
* @file
* Contains \Drupal\search\Plugin\Derivative\SearchLocalTask.
*/
namespace Drupal\search\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DerivativeBase;
/**
* Provides local tasks for each search plugin.
*/
class SearchLocalTask extends DerivativeBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions(array $base_plugin_definition) {
$this->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;
}
}

View File

@ -0,0 +1,3 @@
search.plugins:
class: \Drupal\Core\Menu\LocalTaskDefault
derivative: \Drupal\search\Plugin\Derivative\SearchLocalTask

View File

@ -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;
}

View File

@ -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

View File

@ -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.',

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -767,16 +767,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(