diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/navigation/menu/default.php | 5 | ||||
-rw-r--r-- | views/default/navigation/menu/elements/section.php | 10 | ||||
-rw-r--r-- | views/default/navigation/menu/page.php | 15 |
3 files changed, 22 insertions, 8 deletions
diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php index 13ff9f1e2..0dc6dd6b3 100644 --- a/views/default/navigation/menu/default.php +++ b/views/default/navigation/menu/default.php @@ -5,10 +5,12 @@ * @uses $vars['name'] * @uses $vars['menu'] * @uses $vars['class'] + * @uses $vars['show_section_headers'] */ // we want css classes to use dashes $vars['name'] = str_replace('_', '-', $vars['name']); +$headers = elgg_extract('show_section_headers', $vars, false); $class = "elgg-menu elgg-menu-{$vars['name']}"; if (isset($vars['class'])) { @@ -19,5 +21,8 @@ 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", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers )); } diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php index f72db847f..9b31f54b1 100644 --- a/views/default/navigation/menu/elements/section.php +++ b/views/default/navigation/menu/elements/section.php @@ -4,10 +4,20 @@ * * @uses $vars['items'] * @uses $vars['class'] + * @uses $vars['name'] + * @uses $vars['section'] + * @uses $vars['show_section_headers'] */ +$headers = elgg_extract('show_section_headers', $vars, false); $class = elgg_extract('class', $vars, ''); +if ($headers) { + $name = elgg_extract('name', $vars); + $section = elgg_extract('section', $vars); + echo elgg_echo("menu:$name:header:$section"); +} + echo "<ul class=\"$class\">"; foreach ($vars['items'] as $menu_item) { echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); diff --git a/views/default/navigation/menu/page.php b/views/default/navigation/menu/page.php index bd2611790..c7d858e1d 100644 --- a/views/default/navigation/menu/page.php +++ b/views/default/navigation/menu/page.php @@ -5,24 +5,23 @@ * @uses $vars['menu'] * @uses $vars['selected_item'] * @uses $vars['class'] + * @uses $vars['name'] + * @uses $vars['show_section_headers'] */ +$headers = elgg_extract('show_section_headers', $vars, false); + $class = 'elgg-menu elgg-menu-page'; 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/section', array( 'items' => $menu_items, 'class' => "$class elgg-menu-page-$section", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers )); } |