aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu/default.php
blob: 13ff9f1e2282b015211c3437625ea59f61985f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
 * Default menu
 *
 * @uses $vars['name']
 * @uses $vars['menu']
 * @uses $vars['class']
 */

// we want css classes to use dashes
$vars['name'] = str_replace('_', '-', $vars['name']);

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

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