Commit 5cbc892c authored by matio89's avatar matio89

test if module update exist or no to display install and udate module.

parent 3b58d56d
......@@ -61,21 +61,6 @@ admin_development:
weight: -8
route_name: admin_development
parent: admin_toolbar_tools.help
update.module_update:
title: Update
route_name: update.module_update
parent: system.modules_list
weight: -1
system.modules_uninstall:
title: Uninstall
route_name: system.modules_uninstall
parent: system.modules_list
weight: -2
update.module_install:
title: Install new module
route_name: update.module_install
parent: system.modules_list
weight: -3
#add menu to people
user.admin_create:
title: Add user
......
......@@ -40,6 +40,27 @@ function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match)
*/
function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
// If module update is enabled.
if(\Drupal::moduleHandler()->moduleExists('update')){
$links['update.module_update'] = array(
'title' => 'Update',
'route_name' => 'update.module_update',
'parent' => 'system.modules_list',
'weight' => -1
);
$links['system.modules_uninstall'] = array(
'title' => 'Uninstall',
'route_name' => 'update.module_update',
'parent' => 'system.modules_list',
'weight' => -2
);
$links['update.module_install'] = array(
'title' => 'Install new module',
'route_name' => 'update.module_install',
'parent' => 'system.modules_list',
'weight' => -3
);
}
if (\Drupal::moduleHandler()->moduleExists('devel')) {
$links['devel.admin_settings'] = array(
'title' => 'Devel settings',
......
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