12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * Page menu
- *
- * @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);
- if (empty($vars['name'])) {
- $msg = elgg_echo('view:missing_param', array('name', 'navigation/menu/page'));
- elgg_log($msg, 'WARNING');
- $vars['name'] = '';
- }
- $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
- ));
- }
|