|
@@ -48,13 +48,26 @@ function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match)
|
|
* Implements hook_menu_links_discovered_alter().
|
|
* Implements hook_menu_links_discovered_alter().
|
|
*/
|
|
*/
|
|
function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
|
|
+ $languageManager = \Drupal::languageManager();
|
|
|
|
+ $config_override_language = $languageManager->getConfigOverrideLanguage();
|
|
|
|
+ $languageManager->setConfigOverrideLanguage($languageManager->getLanguage('en'));
|
|
|
|
+
|
|
$moduleHandler = \Drupal::moduleHandler();
|
|
$moduleHandler = \Drupal::moduleHandler();
|
|
$entityTypeManager = \Drupal::entityTypeManager();
|
|
$entityTypeManager = \Drupal::entityTypeManager();
|
|
$routeProvider = \Drupal::service('router.route_provider');
|
|
$routeProvider = \Drupal::service('router.route_provider');
|
|
- $routes = [];
|
|
|
|
- foreach ($routeProvider->getAllRoutes() as $route_name => $route) {
|
|
|
|
- $routes[] = $route_name;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Determine if a route exists by name.
|
|
|
|
+ *
|
|
|
|
+ * @param $routeName
|
|
|
|
+ * The name of the route to check.
|
|
|
|
+ *
|
|
|
|
+ * @return bool
|
|
|
|
+ * Whether a route with that route name exists.
|
|
|
|
+ */
|
|
|
|
+ $routeExists = function ($routeName) use ($routeProvider) {
|
|
|
|
+ return (count($routeProvider->getRoutesByNames([$routeName])) === 1);
|
|
|
|
+ };
|
|
|
|
|
|
$entityTypes = $entityTypeManager->getDefinitions();
|
|
$entityTypes = $entityTypeManager->getDefinitions();
|
|
$content_entities = [];
|
|
$content_entities = [];
|
|
@@ -71,14 +84,16 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('views')) {
|
|
if ($moduleHandler->moduleExists('views')) {
|
|
$links['admin_toolbar_tools.flush_views'] = [
|
|
$links['admin_toolbar_tools.flush_views'] = [
|
|
'title' => t('Flush views cache'),
|
|
'title' => t('Flush views cache'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'admin_toolbar_tools.flush_views',
|
|
'route_name' => 'admin_toolbar_tools.flush_views',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_toolbar_tools.flush',
|
|
'parent' => 'admin_toolbar_tools.flush',
|
|
];
|
|
];
|
|
// Adding a menu link to Files.
|
|
// Adding a menu link to Files.
|
|
- if ($moduleHandler->moduleExists('file') && in_array('view.files.page_1', $routes)) {
|
|
|
|
|
|
+ if ($moduleHandler->moduleExists('file') && $routeExists('view.files.page_1')) {
|
|
$links['admin_toolbar_tools.view.files'] = [
|
|
$links['admin_toolbar_tools.view.files'] = [
|
|
'title' => t('Files'),
|
|
'title' => t('Files'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'view.files.page_1',
|
|
'route_name' => 'view.files.page_1',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.admin_content',
|
|
'parent' => 'system.admin_content',
|
|
@@ -93,21 +108,23 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
foreach ($entityTypeManager->getStorage($content_entity_bundle)->loadMultiple() as $machine_name => $bundle) {
|
|
foreach ($entityTypeManager->getStorage($content_entity_bundle)->loadMultiple() as $machine_name => $bundle) {
|
|
// Normally, the edit form for the bundle would be its root link.
|
|
// Normally, the edit form for the bundle would be its root link.
|
|
$content_entity_bundle_root = NULL;
|
|
$content_entity_bundle_root = NULL;
|
|
- if (in_array('entity.' . $content_entity_bundle . '.overview_form', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.' . $content_entity_bundle . '.overview_form')) {
|
|
// Some bundles have an overview/list form that make a better root link.
|
|
// Some bundles have an overview/list form that make a better root link.
|
|
$content_entity_bundle_root = 'entity.' . $content_entity_bundle . '.overview_form.' . $machine_name;
|
|
$content_entity_bundle_root = 'entity.' . $content_entity_bundle . '.overview_form.' . $machine_name;
|
|
$links[$content_entity_bundle_root] = [
|
|
$links[$content_entity_bundle_root] = [
|
|
'title' => t($bundle->label()),
|
|
'title' => t($bundle->label()),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.overview_form',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.overview_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.' . $content_entity_bundle . '.collection',
|
|
'parent' => 'entity.' . $content_entity_bundle . '.collection',
|
|
'route_parameters' => [$content_entity_bundle => $machine_name],
|
|
'route_parameters' => [$content_entity_bundle => $machine_name],
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- if (in_array('entity.' . $content_entity_bundle . '.edit_form', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.' . $content_entity_bundle . '.edit_form')) {
|
|
$key = 'entity.' . $content_entity_bundle . '.edit_form.' . $machine_name;
|
|
$key = 'entity.' . $content_entity_bundle . '.edit_form.' . $machine_name;
|
|
$links[$key] = [
|
|
$links[$key] = [
|
|
'title' => t($bundle->label()),
|
|
'title' => t($bundle->label()),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.edit_form',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.edit_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.' . $content_entity_bundle . '.collection',
|
|
'parent' => 'entity.' . $content_entity_bundle . '.collection',
|
|
@@ -122,9 +139,10 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
- if (in_array('entity.' . $content_entity . '.field_ui_fields', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.' . $content_entity . '.field_ui_fields')) {
|
|
$links['entity.' . $content_entity . '.field_ui_fields' . $machine_name] = [
|
|
$links['entity.' . $content_entity . '.field_ui_fields' . $machine_name] = [
|
|
'title' => t('Manage fields'),
|
|
'title' => t('Manage fields'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.' . $content_entity . '.field_ui_fields',
|
|
'route_name' => 'entity.' . $content_entity . '.field_ui_fields',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => $content_entity_bundle_root,
|
|
'parent' => $content_entity_bundle_root,
|
|
@@ -132,9 +150,10 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
'weight' => 1,
|
|
'weight' => 1,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- if (in_array('entity.entity_form_display.' . $content_entity . '.default', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.entity_form_display.' . $content_entity . '.default')) {
|
|
$links['entity.entity_form_display.' . $content_entity . '.default' . $machine_name] = [
|
|
$links['entity.entity_form_display.' . $content_entity . '.default' . $machine_name] = [
|
|
'title' => t('Manage form display'),
|
|
'title' => t('Manage form display'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.entity_form_display.' . $content_entity . '.default',
|
|
'route_name' => 'entity.entity_form_display.' . $content_entity . '.default',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => $content_entity_bundle_root,
|
|
'parent' => $content_entity_bundle_root,
|
|
@@ -142,9 +161,10 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
'weight' => 2,
|
|
'weight' => 2,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- if (in_array('entity.entity_view_display.' . $content_entity . '.default', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.entity_view_display.' . $content_entity . '.default')) {
|
|
$links['entity.entity_view_display.' . $content_entity . '.default.' . $machine_name] = [
|
|
$links['entity.entity_view_display.' . $content_entity . '.default.' . $machine_name] = [
|
|
'title' => t('Manage display'),
|
|
'title' => t('Manage display'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.entity_view_display.' . $content_entity . '.default',
|
|
'route_name' => 'entity.entity_view_display.' . $content_entity . '.default',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => $content_entity_bundle_root,
|
|
'parent' => $content_entity_bundle_root,
|
|
@@ -153,9 +173,10 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ($moduleHandler->moduleExists('devel') && in_array('entity.' . $content_entity_bundle . '.devel_load', $routes)) {
|
|
|
|
|
|
+ if ($moduleHandler->moduleExists('devel') && $routeExists('entity.' . $content_entity_bundle . '.devel_load')) {
|
|
$links['entity.' . $content_entity_bundle . '.devel_load.' . $machine_name] = [
|
|
$links['entity.' . $content_entity_bundle . '.devel_load.' . $machine_name] = [
|
|
'title' => t('Devel'),
|
|
'title' => t('Devel'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.devel_load',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.devel_load',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => $content_entity_bundle_root,
|
|
'parent' => $content_entity_bundle_root,
|
|
@@ -163,9 +184,10 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
'weight' => 4,
|
|
'weight' => 4,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- if (in_array('entity.' . $content_entity_bundle . '.delete_form', $routes)) {
|
|
|
|
|
|
+ if ($routeExists('entity.' . $content_entity_bundle . '.delete_form')) {
|
|
$links['entity.' . $content_entity_bundle . '.delete_form.' . $machine_name] = [
|
|
$links['entity.' . $content_entity_bundle . '.delete_form.' . $machine_name] = [
|
|
'title' => t('Delete'),
|
|
'title' => t('Delete'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.delete_form',
|
|
'route_name' => 'entity.' . $content_entity_bundle . '.delete_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => $content_entity_bundle_root,
|
|
'parent' => $content_entity_bundle_root,
|
|
@@ -179,30 +201,35 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
// Add user links.
|
|
// Add user links.
|
|
$links['user.admin_create'] = [
|
|
$links['user.admin_create'] = [
|
|
'title' => t('Add a new user'),
|
|
'title' => t('Add a new user'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'user.admin_create',
|
|
'route_name' => 'user.admin_create',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.collection',
|
|
'parent' => 'entity.user.collection',
|
|
];
|
|
];
|
|
$links['user.admin_permissions'] = [
|
|
$links['user.admin_permissions'] = [
|
|
'title' => t('Permissions'),
|
|
'title' => t('Permissions'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'user.admin_permissions',
|
|
'route_name' => 'user.admin_permissions',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.collection',
|
|
'parent' => 'entity.user.collection',
|
|
];
|
|
];
|
|
$links['entity.user_role.collection'] = [
|
|
$links['entity.user_role.collection'] = [
|
|
'title' => t('Roles'),
|
|
'title' => t('Roles'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user_role.collection',
|
|
'route_name' => 'entity.user_role.collection',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.collection',
|
|
'parent' => 'entity.user.collection',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.user.logout'] = [
|
|
$links['admin_toolbar_tools.user.logout'] = [
|
|
'title' => t('Logout'),
|
|
'title' => t('Logout'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'user.logout',
|
|
'route_name' => 'user.logout',
|
|
'parent' => 'admin_toolbar_tools.help',
|
|
'parent' => 'admin_toolbar_tools.help',
|
|
'weight' => 10,
|
|
'weight' => 10,
|
|
];
|
|
];
|
|
$links['user.role_add'] = [
|
|
$links['user.role_add'] = [
|
|
'title' => t('Add a new role'),
|
|
'title' => t('Add a new role'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'user.role_add',
|
|
'route_name' => 'user.role_add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user_role.collection',
|
|
'parent' => 'entity.user_role.collection',
|
|
@@ -211,18 +238,21 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
$links['entity.user.field_ui_fields_'] = [
|
|
$links['entity.user.field_ui_fields_'] = [
|
|
'title' => t('Manage fields'),
|
|
'title' => t('Manage fields'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user.field_ui_fields',
|
|
'route_name' => 'entity.user.field_ui_fields',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.admin_form',
|
|
'parent' => 'entity.user.admin_form',
|
|
];
|
|
];
|
|
$links['entity.entity_form_display.user.default_'] = [
|
|
$links['entity.entity_form_display.user.default_'] = [
|
|
'title' => t('Manage form display'),
|
|
'title' => t('Manage form display'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.entity_form_display.user.default',
|
|
'route_name' => 'entity.entity_form_display.user.default',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.admin_form',
|
|
'parent' => 'entity.user.admin_form',
|
|
];
|
|
];
|
|
$links['entity.entity_view_display.user.default_'] = [
|
|
$links['entity.entity_view_display.user.default_'] = [
|
|
'title' => t('Manage display'),
|
|
'title' => t('Manage display'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.entity_view_display.user.default',
|
|
'route_name' => 'entity.entity_view_display.user.default',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user.admin_form',
|
|
'parent' => 'entity.user.admin_form',
|
|
@@ -231,6 +261,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
foreach (user_roles() as $role) {
|
|
foreach (user_roles() as $role) {
|
|
$links['entity.user_role.edit_form.' . $role->id()] = [
|
|
$links['entity.user_role.edit_form.' . $role->id()] = [
|
|
'title' => t($role->label()),
|
|
'title' => t($role->label()),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user_role.edit_form',
|
|
'route_name' => 'entity.user_role.edit_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user_role.collection',
|
|
'parent' => 'entity.user_role.collection',
|
|
@@ -238,6 +269,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['entity.user_role.edit_permissions_form.' . $role->id()] = [
|
|
$links['entity.user_role.edit_permissions_form.' . $role->id()] = [
|
|
'title' => t('Edit permissions'),
|
|
'title' => t('Edit permissions'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user_role.edit_permissions_form',
|
|
'route_name' => 'entity.user_role.edit_permissions_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
@@ -245,6 +277,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['entity.user_role.delete_form.' . $role->id()] = [
|
|
$links['entity.user_role.delete_form.' . $role->id()] = [
|
|
'title' => t('Delete'),
|
|
'title' => t('Delete'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user_role.delete_form',
|
|
'route_name' => 'entity.user_role.delete_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
@@ -253,6 +286,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('devel')) {
|
|
if ($moduleHandler->moduleExists('devel')) {
|
|
$links['entity.user_role.devel_load.' . $role->id()] = [
|
|
$links['entity.user_role.devel_load.' . $role->id()] = [
|
|
'title' => t('Devel'),
|
|
'title' => t('Devel'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.user_role.devel_load',
|
|
'route_name' => 'entity.user_role.devel_load',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
'parent' => 'entity.user_role.edit_form.' . $role->id(),
|
|
@@ -266,6 +300,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
$links['admin_toolbar_tools.add_content']['parent'] = 'system.admin_content';
|
|
$links['admin_toolbar_tools.add_content']['parent'] = 'system.admin_content';
|
|
$links['node.type_add'] = [
|
|
$links['node.type_add'] = [
|
|
'title' => t('Add content type'),
|
|
'title' => t('Add content type'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'node.type_add',
|
|
'route_name' => 'node.type_add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.node_type.collection',
|
|
'parent' => 'entity.node_type.collection',
|
|
@@ -275,6 +310,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
foreach ($entityTypeManager->getStorage('node_type')->loadMultiple() as $type) {
|
|
foreach ($entityTypeManager->getStorage('node_type')->loadMultiple() as $type) {
|
|
$links['node.add.' . $type->id()] = [
|
|
$links['node.add.' . $type->id()] = [
|
|
'title' => t($type->label()),
|
|
'title' => t($type->label()),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'node.add',
|
|
'route_name' => 'node.add',
|
|
'parent' => 'admin_toolbar_tools.add_content',
|
|
'parent' => 'admin_toolbar_tools.add_content',
|
|
'route_parameters' => ['node_type' => $type->id()],
|
|
'route_parameters' => ['node_type' => $type->id()],
|
|
@@ -285,12 +321,14 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
if ($moduleHandler->moduleExists('field_ui')) {
|
|
$links['field_ui.entity_form_mode_add'] = [
|
|
$links['field_ui.entity_form_mode_add'] = [
|
|
'title' => t('Add new form mode'),
|
|
'title' => t('Add new form mode'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'field_ui.entity_form_mode_add',
|
|
'route_name' => 'field_ui.entity_form_mode_add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.entity_form_mode.collection',
|
|
'parent' => 'entity.entity_form_mode.collection',
|
|
];
|
|
];
|
|
$links['field_ui.entity_view_mode_add'] = [
|
|
$links['field_ui.entity_view_mode_add'] = [
|
|
'title' => t('Add new view mode'),
|
|
'title' => t('Add new view mode'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'field_ui.entity_view_mode_add',
|
|
'route_name' => 'field_ui.entity_view_mode_add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.entity_view_mode.collection',
|
|
'parent' => 'entity.entity_view_mode.collection',
|
|
@@ -300,6 +338,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('taxonomy')) {
|
|
if ($moduleHandler->moduleExists('taxonomy')) {
|
|
$links['entity.taxonomy_vocabulary.add_form'] = [
|
|
$links['entity.taxonomy_vocabulary.add_form'] = [
|
|
'title' => t('Add vocabulary'),
|
|
'title' => t('Add vocabulary'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.taxonomy_vocabulary.add_form',
|
|
'route_name' => 'entity.taxonomy_vocabulary.add_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.taxonomy_vocabulary.collection',
|
|
'parent' => 'entity.taxonomy_vocabulary.collection',
|
|
@@ -310,6 +349,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('menu_ui')) {
|
|
if ($moduleHandler->moduleExists('menu_ui')) {
|
|
$links['entity.menu.add_form'] = [
|
|
$links['entity.menu.add_form'] = [
|
|
'title' => t('Add menu'),
|
|
'title' => t('Add menu'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.menu.add_form',
|
|
'route_name' => 'entity.menu.add_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.menu.collection',
|
|
'parent' => 'entity.menu.collection',
|
|
@@ -319,6 +359,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
foreach (menu_ui_get_menus() as $machine_name => $label) {
|
|
foreach (menu_ui_get_menus() as $machine_name => $label) {
|
|
$links['entity.menu.edit_form.' . $machine_name] = [
|
|
$links['entity.menu.edit_form.' . $machine_name] = [
|
|
'title' => t($label),
|
|
'title' => t($label),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.menu.edit_form',
|
|
'route_name' => 'entity.menu.edit_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.menu.collection',
|
|
'parent' => 'entity.menu.collection',
|
|
@@ -326,14 +367,16 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['entity.menu.delete_form.' . $machine_name] = [
|
|
$links['entity.menu.delete_form.' . $machine_name] = [
|
|
'title' => t('Delete'),
|
|
'title' => t('Delete'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.menu.delete_form',
|
|
'route_name' => 'entity.menu.delete_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
'route_parameters' => ['menu' => $machine_name],
|
|
'route_parameters' => ['menu' => $machine_name],
|
|
];
|
|
];
|
|
- if ($moduleHandler->moduleExists('devel')) {
|
|
|
|
|
|
+ if ($moduleHandler->moduleExists('devel') && $routeExists('entity.menu.devel_load')) {
|
|
$links['entity.menu.devel_load.' . $machine_name] = [
|
|
$links['entity.menu.devel_load.' . $machine_name] = [
|
|
'title' => t('Devel'),
|
|
'title' => t('Devel'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.menu.devel_load',
|
|
'route_name' => 'entity.menu.devel_load',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
@@ -342,6 +385,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
}
|
|
}
|
|
$links['entity.menu.add_link_form.' . $machine_name] = [
|
|
$links['entity.menu.add_link_form.' . $machine_name] = [
|
|
'title' => t('Add link'),
|
|
'title' => t('Add link'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.menu.add_link_form',
|
|
'route_name' => 'entity.menu.add_link_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
'parent' => 'entity.menu.edit_form.' . $machine_name,
|
|
@@ -354,6 +398,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('block_content')) {
|
|
if ($moduleHandler->moduleExists('block_content')) {
|
|
$links['block_content.add_page'] = [
|
|
$links['block_content.add_page'] = [
|
|
'title' => t('Add custom block'),
|
|
'title' => t('Add custom block'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'block_content.add_page',
|
|
'route_name' => 'block_content.add_page',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'block.admin_display',
|
|
'parent' => 'block.admin_display',
|
|
@@ -361,12 +406,14 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['entity.block_content.collection'] = [
|
|
$links['entity.block_content.collection'] = [
|
|
'title' => t('Custom block library'),
|
|
'title' => t('Custom block library'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.block_content.collection',
|
|
'route_name' => 'entity.block_content.collection',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'block.admin_display',
|
|
'parent' => 'block.admin_display',
|
|
];
|
|
];
|
|
$links['entity.block_content_type.collection'] = [
|
|
$links['entity.block_content_type.collection'] = [
|
|
'title' => t('Types'),
|
|
'title' => t('Types'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.block_content_type.collection',
|
|
'route_name' => 'entity.block_content_type.collection',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'block.admin_display',
|
|
'parent' => 'block.admin_display',
|
|
@@ -377,6 +424,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('contact')) {
|
|
if ($moduleHandler->moduleExists('contact')) {
|
|
$links['contact.form_add'] = [
|
|
$links['contact.form_add'] = [
|
|
'title' => t('Add contact form'),
|
|
'title' => t('Add contact form'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'contact.form_add',
|
|
'route_name' => 'contact.form_add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.contact_form.collection',
|
|
'parent' => 'entity.contact_form.collection',
|
|
@@ -388,12 +436,14 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('update')) {
|
|
if ($moduleHandler->moduleExists('update')) {
|
|
$links['update.module_update'] = [
|
|
$links['update.module_update'] = [
|
|
'title' => t('Update'),
|
|
'title' => t('Update'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'update.module_update',
|
|
'route_name' => 'update.module_update',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.modules_list',
|
|
'parent' => 'system.modules_list',
|
|
];
|
|
];
|
|
$links['update.module_install'] = [
|
|
$links['update.module_install'] = [
|
|
'title' => t('Install new module'),
|
|
'title' => t('Install new module'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'update.module_install',
|
|
'route_name' => 'update.module_install',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.modules_list',
|
|
'parent' => 'system.modules_list',
|
|
@@ -404,6 +454,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('devel')) {
|
|
if ($moduleHandler->moduleExists('devel')) {
|
|
$links['admin_development'] = [
|
|
$links['admin_development'] = [
|
|
'title' => t('Development'),
|
|
'title' => t('Development'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'system.admin_config_development',
|
|
'route_name' => 'system.admin_config_development',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_toolbar_tools.help',
|
|
'parent' => 'admin_toolbar_tools.help',
|
|
@@ -411,6 +462,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.admin_settings'] = [
|
|
$links['admin_toolbar_tools.devel.admin_settings'] = [
|
|
'title' => t('Devel settings'),
|
|
'title' => t('Devel settings'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.admin_settings',
|
|
'route_name' => 'devel.admin_settings',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
@@ -419,6 +471,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('webprofiler')) {
|
|
if ($moduleHandler->moduleExists('webprofiler')) {
|
|
$links['admin_toolbar_tools.devel.webprofiler'] = [
|
|
$links['admin_toolbar_tools.devel.webprofiler'] = [
|
|
'title' => t('Web Profiler settings'),
|
|
'title' => t('Web Profiler settings'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'webprofiler.settings',
|
|
'route_name' => 'webprofiler.settings',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
@@ -426,53 +479,55 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
}
|
|
}
|
|
$links['admin_toolbar_tools.devel.configs_list'] = [
|
|
$links['admin_toolbar_tools.devel.configs_list'] = [
|
|
'title' => t('Config editor'),
|
|
'title' => t('Config editor'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.configs_list',
|
|
'route_name' => 'devel.configs_list',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.reinstall'] = [
|
|
$links['admin_toolbar_tools.devel.reinstall'] = [
|
|
'title' => t('Reinstall modules'),
|
|
'title' => t('Reinstall modules'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.reinstall',
|
|
'route_name' => 'devel.reinstall',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.menu_rebuild'] = [
|
|
$links['admin_toolbar_tools.devel.menu_rebuild'] = [
|
|
'title' => t('Rebuild menu'),
|
|
'title' => t('Rebuild menu'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.menu_rebuild',
|
|
'route_name' => 'devel.menu_rebuild',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.state_system_page'] = [
|
|
$links['admin_toolbar_tools.devel.state_system_page'] = [
|
|
'title' => t('State editor'),
|
|
'title' => t('State editor'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.state_system_page',
|
|
'route_name' => 'devel.state_system_page',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.theme_registry'] = [
|
|
$links['admin_toolbar_tools.devel.theme_registry'] = [
|
|
'title' => t('Theme registry'),
|
|
'title' => t('Theme registry'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.theme_registry',
|
|
'route_name' => 'devel.theme_registry',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.entity_info_page'] = [
|
|
$links['admin_toolbar_tools.devel.entity_info_page'] = [
|
|
'title' => t('Entity Info'),
|
|
'title' => t('Entity Info'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.entity_info_page',
|
|
'route_name' => 'devel.entity_info_page',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
- $links['admin_toolbar_tools.devel.execute_php'] = [
|
|
|
|
- 'title' => t('Execute PHP Code'),
|
|
|
|
- 'route_name' => 'devel.execute_php',
|
|
|
|
- 'menu_name' => 'admin',
|
|
|
|
- 'parent' => 'admin_development',
|
|
|
|
- ];
|
|
|
|
$links['admin_toolbar_tools.devel.session'] = [
|
|
$links['admin_toolbar_tools.devel.session'] = [
|
|
'title' => t('Session viewer'),
|
|
'title' => t('Session viewer'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.session',
|
|
'route_name' => 'devel.session',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.devel.elements_page'] = [
|
|
$links['admin_toolbar_tools.devel.elements_page'] = [
|
|
'title' => t('Form API field types'),
|
|
'title' => t('Form API field types'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.elements_page',
|
|
'route_name' => 'devel.elements_page',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
@@ -480,16 +535,35 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
// Menu link for the Toolbar module.
|
|
// Menu link for the Toolbar module.
|
|
$links['admin_toolbar_tools.toolbar.settings'] = [
|
|
$links['admin_toolbar_tools.toolbar.settings'] = [
|
|
'title' => t('Toolbar settings'),
|
|
'title' => t('Toolbar settings'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'devel.toolbar.settings_form',
|
|
'route_name' => 'devel.toolbar.settings_form',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'devel.admin_settings',
|
|
'parent' => 'devel.admin_settings',
|
|
];
|
|
];
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // If module Devel PHP is enabled.
|
|
|
|
+ if ($moduleHandler->moduleExists('devel_php') && $routeExists('devel_php.execute_php')) {
|
|
|
|
+ $links['admin_toolbar_tools.devel_php.execute_php'] = [
|
|
|
|
+ 'title' => t('Execute PHP Code'),
|
|
|
|
+ 'route_name' => 'devel_php.execute_php',
|
|
|
|
+ 'menu_name' => 'admin',
|
|
|
|
+ 'parent' => 'admin_development',
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ elseif ($moduleHandler->moduleExists('devel') && $routeExists('devel.execute_php')) {
|
|
|
|
+ $links['admin_toolbar_tools.devel.execute_php'] = [
|
|
|
|
+ 'title' => t('Execute PHP Code'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
|
|
+ 'route_name' => 'devel.execute_php',
|
|
|
|
+ 'menu_name' => 'admin',
|
|
|
|
+ 'parent' => 'admin_development',
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
// If module Views Ui enabled.
|
|
// If module Views Ui enabled.
|
|
if ($moduleHandler->moduleExists('views_ui')) {
|
|
if ($moduleHandler->moduleExists('views_ui')) {
|
|
$links['admin_toolbar_tools.views_ui.add'] = [
|
|
$links['admin_toolbar_tools.views_ui.add'] = [
|
|
'title' => t('Add new view'),
|
|
'title' => t('Add new view'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'views_ui.add',
|
|
'route_name' => 'views_ui.add',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.view.collection',
|
|
'parent' => 'entity.view.collection',
|
|
@@ -497,6 +571,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.views_ui.field_list'] = [
|
|
$links['admin_toolbar_tools.views_ui.field_list'] = [
|
|
'title' => t('Used in views'),
|
|
'title' => t('Used in views'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'views_ui.reports_fields',
|
|
'route_name' => 'views_ui.reports_fields',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.field_storage_config.collection',
|
|
'parent' => 'entity.field_storage_config.collection',
|
|
@@ -505,6 +580,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
|
|
|
|
$links['admin_toolbar_tools.system.theme_settings'] = [
|
|
$links['admin_toolbar_tools.system.theme_settings'] = [
|
|
'title' => t('Settings'),
|
|
'title' => t('Settings'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'system.theme_settings',
|
|
'route_name' => 'system.theme_settings',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.themes_page',
|
|
'parent' => 'system.themes_page',
|
|
@@ -513,6 +589,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('webprofiler')) {
|
|
if ($moduleHandler->moduleExists('webprofiler')) {
|
|
$links['admin_toolbar_tools.devel.webprofiler'] = [
|
|
$links['admin_toolbar_tools.devel.webprofiler'] = [
|
|
'title' => t('Webprofiler settings'),
|
|
'title' => t('Webprofiler settings'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'webprofiler.settings',
|
|
'route_name' => 'webprofiler.settings',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'admin_development',
|
|
'parent' => 'admin_development',
|
|
@@ -522,12 +599,14 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('update')) {
|
|
if ($moduleHandler->moduleExists('update')) {
|
|
$links['update.theme_install_'] = [
|
|
$links['update.theme_install_'] = [
|
|
'title' => t('Install new theme'),
|
|
'title' => t('Install new theme'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'update.theme_install',
|
|
'route_name' => 'update.theme_install',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.themes_page',
|
|
'parent' => 'system.themes_page',
|
|
];
|
|
];
|
|
$links['update.theme_update_'] = [
|
|
$links['update.theme_update_'] = [
|
|
'title' => t('Update'),
|
|
'title' => t('Update'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'update.theme_update',
|
|
'route_name' => 'update.theme_update',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.themes_page',
|
|
'parent' => 'system.themes_page',
|
|
@@ -537,6 +616,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
foreach ($installed_themes as $key_theme => $label_theme) {
|
|
foreach ($installed_themes as $key_theme => $label_theme) {
|
|
$links['system.theme_settings_theme.' . $key_theme] = [
|
|
$links['system.theme_settings_theme.' . $key_theme] = [
|
|
'title' => t($label_theme),
|
|
'title' => t($label_theme),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'system.theme_settings_theme',
|
|
'route_name' => 'system.theme_settings_theme',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.theme_settings_',
|
|
'parent' => 'system.theme_settings_',
|
|
@@ -551,6 +631,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('language')) {
|
|
if ($moduleHandler->moduleExists('language')) {
|
|
$links['admin_toolbar_tools.language.negotiation'] = [
|
|
$links['admin_toolbar_tools.language.negotiation'] = [
|
|
'title' => t('Detection and selection'),
|
|
'title' => t('Detection and selection'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'language.negotiation',
|
|
'route_name' => 'language.negotiation',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'entity.configurable_language.collection',
|
|
'parent' => 'entity.configurable_language.collection',
|
|
@@ -561,14 +642,16 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('media')) {
|
|
if ($moduleHandler->moduleExists('media')) {
|
|
$links['admin_toolbar_tools.add_media'] = [
|
|
$links['admin_toolbar_tools.add_media'] = [
|
|
'title' => t('Add media'),
|
|
'title' => t('Add media'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.media.add_page',
|
|
'route_name' => 'entity.media.add_page',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'system.admin_content',
|
|
'parent' => 'system.admin_content',
|
|
];
|
|
];
|
|
// Add node links for each media type.
|
|
// Add node links for each media type.
|
|
- foreach (\Drupal::entityTypeManager()->getStorage('media_type')->loadMultiple() as $type) {
|
|
|
|
|
|
+ foreach ($entityTypeManager->getStorage('media_type')->loadMultiple() as $type) {
|
|
$links['media.add.' . $type->id()] = [
|
|
$links['media.add.' . $type->id()] = [
|
|
'title' => t($type->label()),
|
|
'title' => t($type->label()),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'entity.media.add_form',
|
|
'route_name' => 'entity.media.add_form',
|
|
'parent' => 'admin_toolbar_tools.add_media',
|
|
'parent' => 'admin_toolbar_tools.add_media',
|
|
'route_parameters' => ['media_type' => $type->id()],
|
|
'route_parameters' => ['media_type' => $type->id()],
|
|
@@ -580,6 +663,7 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
if ($moduleHandler->moduleExists('config')) {
|
|
if ($moduleHandler->moduleExists('config')) {
|
|
$links['admin_toolbar_tools.config.import'] = [
|
|
$links['admin_toolbar_tools.config.import'] = [
|
|
'title' => t('Import'),
|
|
'title' => t('Import'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'config.import_full',
|
|
'route_name' => 'config.import_full',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'config.sync',
|
|
'parent' => 'config.sync',
|
|
@@ -587,12 +671,15 @@ function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
|
|
];
|
|
];
|
|
$links['admin_toolbar_tools.config.export'] = [
|
|
$links['admin_toolbar_tools.config.export'] = [
|
|
'title' => t('Export'),
|
|
'title' => t('Export'),
|
|
|
|
+ 'provider' => 'admin_toolbar_tools',
|
|
'route_name' => 'config.export_full',
|
|
'route_name' => 'config.export_full',
|
|
'menu_name' => 'admin',
|
|
'menu_name' => 'admin',
|
|
'parent' => 'config.sync',
|
|
'parent' => 'config.sync',
|
|
'weight' => 2,
|
|
'weight' => 2,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ $languageManager->setConfigOverrideLanguage($config_override_language);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -613,20 +700,3 @@ function admin_toolbar_tools_installed_themes() {
|
|
|
|
|
|
return $themes_installed;
|
|
return $themes_installed;
|
|
}
|
|
}
|
|
-
|
|
|
|
-/**
|
|
|
|
- * Get all links related to entity.
|
|
|
|
- *
|
|
|
|
- * @param string $entity_type_id
|
|
|
|
- * The machine name for the entity type.
|
|
|
|
- *
|
|
|
|
- * @return array
|
|
|
|
- * The links for the entity type.
|
|
|
|
- */
|
|
|
|
-function admin_toolbar_tools_get_links($entity_type_id) {
|
|
|
|
- $entity = \Drupal::entityTypeManager()->getDefinition($entity_type_id);
|
|
|
|
- // Get all links related to entity.
|
|
|
|
- $links = $entity->getLinkTemplates();
|
|
|
|
-
|
|
|
|
- return $links;
|
|
|
|
-}
|
|
|