Skip to content

Commit 41f1149

Browse files
committed
override function that searches for active node in order to also work with associative arrays.
1 parent 4023fad commit 41f1149

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

classes/output/navigation/primary.php

+14
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ public function __construct($page) {
5757
parent::__construct($page);
5858
}
5959

60+
/**
61+
* Override the parent function, so that it also works with associative arrays.
62+
*
63+
* @param object|array $node
64+
* @param bool $expandedmenu
65+
* @return bool
66+
*/
67+
protected function flag_active_nodes(object|array $node, bool $expandedmenu = false): bool {
68+
if (is_array($node)) {
69+
$node = (object) $node;
70+
}
71+
return parent::flag_active_nodes($node, $expandedmenu);
72+
}
73+
6074
/**
6175
* Combine the various menus into a standardized output.
6276
*

0 commit comments

Comments
 (0)