blob: df750aff7816caef7632f09a0e33e281f0693df2 (
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
30
31
32
33
34
35
36
37
38
39
40
|
<?php
/**
* Elgg submenu group. Writes the <ul> for a submenu and passes items one by one
* to navigation/submenu_item
*
* @uses $vars['group_name']
* @uses $vars['items']
* @package Elgg
* @subpackage Core
*/
$group = (isset($vars['group'])) ? $vars['group'] : 'default';
$items = (isset($vars['items'])) ? $vars['items'] : array();
$hidden = (isset($vars['hidden']) && $vars['hidden']) ? 'hidden' : '';
$child = (isset($vars['child']) && $vars['child']) ? 'child' : '';
echo "<ul class='submenu $group $hidden $child'>\n";
foreach ($items as $item) {
$item_vars = array('item' => $item, 'group' => $group);
if (isset($item->vars) && is_array($item->vars)) {
$item_vars = array_merge($item->vars, $item_vars);
}
if (isset($item->children)) {
$child_vars = array(
'group' => $group,
'items' => $item->children,
// if this menu item is selected, make sure to display the full tree
// ie, don't hide it.
'hidden' => !$item->selected,
'child' => TRUE
);
$item_vars['children_html'] = elgg_view('navigation/submenu_group', $child_vars);
}
echo elgg_view('navigation/submenu_item', $item_vars);
}
echo "</ul>\n";
|