aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu/elements/item.php
blob: 5a9a8743dac94ca01aec740a474ea2bbe4ab29d0 (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
<?php

$item = $vars['item'];

$class = '';
$link_class = 'elgg-menu-closed';
if ($item->getSelected()) {
	$class = 'class="elgg-state-selected"';
	$link_class = 'elgg-menu-opened';
}

$link_vars = array();

$children = $item->getChildren();
if ($children) {
	$link_vars['class'] = "elgg-menu-parent $link_class";
}

echo "<li $class>";
echo $item->getLink($link_vars);
if ($children) {
	echo elgg_view('navigation/menu/elements/group', array(
		'items' => $children,
		'class' => 'elgg-menu elgg-child-menu',
	));
}
echo '</li>';