Commit e2e80e49 authored by matio89's avatar matio89

add administration devel link

parent 73f65584
......@@ -34,12 +34,12 @@ system.run_cron:
parent: admin_toolbar_tools.help
system.db_update:
title: Run Updates
weight: -7
weight: -6
route_name: system.db_update
parent: admin_toolbar_tools.help
admin_toolbar_tools.drupalorg:
title: Drupal.org
weight: -6
weight: -5
route_name: admin_toolbar_tools.drupalorg
parent: admin_toolbar_tools.help
admin_toolbar_tools.listchanges:
......@@ -52,3 +52,8 @@ admin_toolbar_tools.doc:
weight: -5
route_name: admin_toolbar_tools.doc
parent: admin_toolbar_tools.drupalorg
admin_development:
title: Development
weight: -8
route_name: admin_development
parent: admin_toolbar_tools.help
\ No newline at end of file
......@@ -34,4 +34,77 @@ function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match)
$output .= '<p>' . t('The Admin Toolbar Tools module allows you to to add more fonctionalities to the toolbar like flush caches, runnig cron.') . '</p>';
return $output;
}
}
\ No newline at end of file
}
/**
* Implements hook_menu_links_discovered_alter().
*/
function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
if (\Drupal::moduleHandler()->moduleExists('devel')) {
$links['devel.admin_settings'] = array(
'title' => 'Devel settings',
'route_name' => 'devel.admin_settings',
'parent' => 'admin_development'
);
$links['devel.configs_list'] = array(
'title' => 'Config editor',
'route_name' => 'devel.configs_list',
'parent' => 'admin_development'
);
$links['devel.reinstall'] = array(
'title' => 'Reinstall Modules',
'route_name' => 'devel.reinstall',
'parent' => 'admin_development'
);
$links['devel.menu_rebuild'] = array(
'title' => 'Rebuild Menu',
'route_name' => 'devel.menu_rebuild',
'parent' => 'admin_development'
);
$links['devel.state_system_page'] = array(
'title' => 'State editor',
'route_name' => 'devel.state_system_page',
'parent' => 'admin_development'
);
$links['devel.theme_registry'] = array(
'title' => 'Theme registry',
'route_name' => 'devel.theme_registry',
'parent' => 'admin_development'
);
$links['devel.entity_info_page'] = array(
'title' => 'Entity Info',
'route_name' => 'devel.entity_info_page',
'parent' => 'admin_development'
);
$links['devel.execute_php'] = array(
'title' => 'Execute PHP',
'route_name' => 'devel.execute_php',
'parent' => 'admin_development'
);
$links['devel.session'] = array(
'title' => 'View Session',
'route_name' => 'devel.session',
'parent' => 'admin_development'
);
$links['devel.elements_page'] = array(
'title' => 'Hook_elements',
'route_name' => 'devel.elements_page',
'parent' => 'admin_development'
);
$links['devel.cache_clear'] = array(
'title' => 'Cache clear',
'route_name' => 'devel.cache_clear',
'parent' => 'admin_development'
);
$links['devel.run_cron'] = array(
'title' => 'Run cron',
'route_name' => 'devel.run_cron',
'parent' => 'admin_development'
);
}
$links['node.add_page']['parent'] = 'system.admin_content';
return $links;
}
......@@ -52,5 +52,12 @@ admin_toolbar_tools.doc:
defaults:
_controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::documentation'
_title: 'Documentation D8'
requirements:
_permission: 'access administration pages'
admin_development:
path: '/admin/development'
defaults:
_controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::development'
_title: 'Development'
requirements:
_permission: 'access administration pages'
\ No newline at end of file
......@@ -47,7 +47,6 @@ class ToolbarController extends ControllerBase {
drupal_set_message(t('Plugin cache cleared.'));
return new RedirectResponse($this->reload_page());
}
// Reset all static caches.
public function flush_static() {
drupal_static_reset();
......@@ -75,5 +74,9 @@ class ToolbarController extends ControllerBase {
$response->send();
return $response;
}
//This function display the administration link Development
public function development(){
return new RedirectResponse('/admin/structure/menu/');
}
}
\ No newline at end of file
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