Skip to content

Commit

Permalink
Add call to hook update_navigation_item and add env in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarat87 committed Dec 4, 2024
1 parent 42f3e23 commit 8b0d5c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions classes/hook_callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public static function before_standard_top_of_body_html_generation(before_standa
$hook->add_html(envbarlib::get_inject_code());
}

/**
* This is the hook enables the plugin to add one or more menu item.
*
* @param extend_user_menu $hook
*/
public static function extend_user_menu(extend_user_menu $hook): void {
// Get items to add.
$hook->add_navitems(envbarlib::add_menuuser());
}

/**
* Listener for the after_config hook.
*
Expand Down
5 changes: 5 additions & 0 deletions db/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
'hook' => \core\hook\after_config::class,
'callback' => [\local_envbar\hook_callbacks::class, 'after_config'],
],
[
'hook' => core_user\hook\extend_user_menu::class,
'callback' => '\local_envbar\hook_callbacks::extend_user_menu',
'priority' => 0,
],
[
'hook' => core_user\hook\extend_user_menu::class,
'callback' => '\local_envbar\hook_callbacks::extend_user_menu',
Expand Down

0 comments on commit 8b0d5c6

Please sign in to comment.