Commit 3c6fe339 authored by romainj's avatar romainj

Fixes issue #2713899

parent f98362c4
......@@ -6,6 +6,7 @@
*/
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_toolbar_alter().
......@@ -14,6 +15,23 @@ function admin_toolbar_toolbar_alter(&$items) {
$items['administration']['tray']['toolbar_administration']['#pre_render'] = array('admin_toolbar_prerender_toolbar_administration_tray');
$items['administration']['#attached']['library'][] = 'admin_toolbar/toolbar.tree';
}
/**
* Implements hook_help().
*/
function admin_toolbar_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.admin_toolbar':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Admin Toolbar module enhances the <a href=":toolbar">Toolbar</a> module by providing fast \'hover\' access to all the administrative links at the top of your site. Admin Toolbar remains a very "lightweight" module by closely integrating with all Toolbar functionality. It can be used in conjunction with all the sub or complimentary modules, listed on <a href="https://www.drupal.org/project/admin_toolbar">Admin Toolbar</a>, for quick access to such system commands as Flush all cache, <a href=":automated_cron">Run Cron</a> , Run Updates, etc.. For more information, see the <a href=":admin_toolbar_documentation">online documentation for the Admin Toolbar module</a>.', array(':toolbar' => \Drupal::url('help.page', array('name' => 'toolbar')), ':automated_cron' => (\Drupal::moduleHandler()->moduleExists('automated_cron')) ? \Drupal::url('help.page', array('name' => 'automated_cron')) : '#', ':admin_toolbar_documentation' => 'https://www.drupal.org/node/2713693')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<p>' . t('The Admin Toolbar greatly improves the user experience for those who regularly interact with the Drupal Toolbar by providing fast, full access to all links in the Drupal Toolbar without having to click to get there.') . '</p>';
return $output;
}
}
/**
* Renders the toolbar's administration tray.
* This is a clone of core's toolbar_prerender_toolbar_administration_tray()
......@@ -26,7 +44,7 @@ function admin_toolbar_toolbar_alter(&$items) {
*
* @see toolbar_prerender_toolbar_administration_tray()
*/
function admin_toolbar_prerender_toolbar_administration_tray(array $element) {
function admin_toolbar_prerender_toolbar_administration_tray(array $element) {
$menu_tree = \Drupal::service('toolbar.menu_tree');
$parameters = new MenuTreeParameters();
$parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth(4)->onlyEnabledLinks();
......
......@@ -35,8 +35,9 @@ function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match)
switch ($route_name) {
case 'help.page.admin_toolbar_tools':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Admin Toolbar Extra Tools module allows you to to add more functionalities to the default toolbar like flushing caches, running cron.') . '</p>';
$output .= '<p>' . t('The Admin Toolbar Extra Tools module comes packaged with the <a href="https://www.drupal.org/project/admin_toolbar"> Admin Toolbar</a> module and adds functionality to it. The additional functionality is accessed thru extra links on the main administration <a href="https://www.drupal.org/project/toolbar">Toolbar</a>. Some links to Admin Toolbar Extra Tools administration pages are located at the bottom of this page. For more information, see the <a href="https://www.drupal.org/node/2713693">online documentation for Admin Toolbar</a>') . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<p>' . t('To use Admin Toolbar Extra Tools just install it like any other module. There is no other configuration required. The Admin Toolbar functionality can be further extended by installing complimentary modules. See <a href="https://www.drupal.org/project/toolbar">Admin Toolbar</a> for a complete listing of these complimentary modules.') . '</p>';
return $output;
}
......
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