ILMSToolbarHooks
in package
uses
StringTranslationTrait
Hook implementations for ILMS toolbar.
Table of Contents
Properties
- $menu_link : MenuLinkTreeInterface
Methods
- __construct() : mixed
- Constructs a new ILMSToolbarHooks object.
- preprocessMenuIlms() : mixed
- Implements preprocess_HOOK().
- toolbar() : mixed
- Implements hook_toolbar().
- toolbarAlter() : void
- Implements hook_toolbar_alter().
- applyClassesToItems() : mixed
- Helper function to attach icons to sub-menus.
Properties
$menu_link read-only
protected
MenuLinkTreeInterface
$menu_link
Methods
__construct()
Constructs a new ILMSToolbarHooks object.
public
__construct(MenuLinkTreeInterface $menu_link) : mixed
Parameters
- $menu_link : MenuLinkTreeInterface
-
The menu link tree service.
preprocessMenuIlms()
Implements preprocess_HOOK().
public
preprocessMenuIlms(array<string|int, mixed> &$variables) : mixed
This hook is currently used to attach css classes to the top level (tray) menu items, so they can have icons added to them.
Parameters
- $variables : array<string|int, mixed>
-
The variables array to modify.
Attributes
- #[Hook]
- 'preprocess_menu__ilms'
toolbar()
Implements hook_toolbar().
public
toolbar() : mixed
Generates the ILMS toolbar.
Attributes
- #[Hook]
- 'toolbar'
toolbarAlter()
Implements hook_toolbar_alter().
public
toolbarAlter(mixed &$items) : void
Attaches the toolbar-icons library to the administration toolbar.
Parameters
- $items : mixed
Attributes
- #[Hook]
- 'toolbar_alter'
applyClassesToItems()
Helper function to attach icons to sub-menus.
protected
applyClassesToItems(array<string|int, mixed> &$items) : mixed
Parameters
- $items : array<string|int, mixed>
-
The items array to modify.