You are here

amswap.module in Admin Menu Swap 8

Same filename and directory in other branches
  1. 7.2 amswap.module

Contains amswap.module.

File

amswap.module
View source
<?php

/**
 * @file
 * Contains amswap.module.
 */
use Drupal\amswap\Render\Element\Amswap;
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function amswap_help($route_name, RouteMatchInterface $route_match) {
  if ($route_name === 'help.page.amswap') {
    $output = '<h3>' . t('About') . '</h3>';
    $output .= '<p>' . t('Allows the administration menu to be customised per user role.') . '</p>';
    return $output;
  }
}

/**
 * Implements hook_toolbar_alter().
 */
function amswap_toolbar_alter(&$items) {
  $items['administration']['tray']['toolbar_administration']['#pre_render'][] = [
    Amswap::class,
    'preRender',
  ];
}

Functions

Namesort descending Description
amswap_help Implements hook_help().
amswap_toolbar_alter Implements hook_toolbar_alter().