Skip to content

Commit

Permalink
Add current link
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarat87 committed Dec 6, 2024
1 parent 2826377 commit ef5ffb9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/local/envbarlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ public static function config() {
* @return array New menu items.
*/
public static function add_menuuser(): array {
global $PAGE;
$userfirstmenu = new stdClass();
$userfirstmenu->itemtype = 'divider';
$here = (new moodle_url('/'))->out();
Expand All @@ -706,7 +707,9 @@ public static function add_menuuser(): array {
$usermenu = new stdClass();
$usermenu->itemtype = 'link';
$usermenu->title = $env->showtext;
$usermenu->url = new moodle_url($env->matchpattern);
$pathurl = (new moodle_url( $PAGE->__get('url')))->get_path();
$currenturl = $env->matchpattern.$pathurl;
$usermenu->url = new moodle_url($currenturl);
// Which env matches?
if (self::is_match($here, $env->matchpattern)) {
$usermenu->pix = 'e/tick';
Expand Down

0 comments on commit ef5ffb9

Please sign in to comment.