aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu/page.php
blob: 00fa1ef51cabda6dbf3a7d16fcd3f2049de36d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
 * Page menu
 *
 * @uses $vars['menu']
 * @uses $vars['selected_item']
 * @uses $vars['class']
 */

$class = 'elgg-menu elgg-page-menu';
if (isset($vars['class'])) {
	$class = "$class {$vars['class']}";
}

if (isset($vars['selected_item'])) {
	$parent = $vars['selected_item']->getParent();
	while ($parent) {
		$parent->setSelected();
		$parent = $parent->getParent();
	}
}

foreach ($vars['menu'] as $section => $menu_items) {
	echo elgg_view('navigation/menu/elements/group', array(
		'items' => $menu_items,
		'section' => $section,
		'class' => $class,
	));
}