Commit a16eb5a3 authored by webchick's avatar webchick
Browse files

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

parent b833c53d
......@@ -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));
}
/**
......
......@@ -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
......@@ -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;
}
......
......@@ -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.
......
......@@ -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
......@@ -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',
......
......@@ -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
......@@ -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),
......
......@@ -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
......@@ -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.',
......
......@@ -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
......@@ -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',
......
......@@ -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
......@@ -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',
......
path.admin_overview:
title: List
route_name: path.admin_overview
tab_root_id: path.admin_overview
......@@ -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',
......
picture.mapping_page_edit:
title: Edit
route_name: picture.mapping_page_edit
tab_root_id: picture.mapping_page_edit
weight: -10
......@@ -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',
......
......@@ -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();
}
......
<?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;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment