Skip to content

Commit

Permalink
override function that searches for active node in order to also work…
Browse files Browse the repository at this point in the history
… with associative arrays.
  • Loading branch information
Menrath committed Aug 27, 2024
1 parent 4023fad commit 41f1149
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/output/navigation/primary.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ public function __construct($page) {
parent::__construct($page);
}

/**
* Override the parent function, so that it also works with associative arrays.
*
* @param object|array $node
* @param bool $expandedmenu
* @return bool
*/
protected function flag_active_nodes(object|array $node, bool $expandedmenu = false): bool {
if (is_array($node)) {
$node = (object) $node;
}
return parent::flag_active_nodes($node, $expandedmenu);
}

/**
* Combine the various menus into a standardized output.
*
Expand Down

0 comments on commit 41f1149

Please sign in to comment.