Elgg  Version 1.9
page.php
Go to the documentation of this file.
1 <?php
12 $headers = elgg_extract('show_section_headers', $vars, false);
13 
14 if (empty($vars['name'])) {
15  $msg = elgg_echo('view:missing_param', array('name', 'navigation/menu/page'));
16  elgg_log($msg, 'WARNING');
17  $vars['name'] = '';
18 }
19 
20 $class = 'elgg-menu elgg-menu-page';
21 if (isset($vars['class'])) {
22  $class = "$class {$vars['class']}";
23 }
24 
25 if (isset($vars['selected_item'])) {
26  $parent = $vars['selected_item']->getParent();
27 
28  while ($parent) {
29  $parent->setSelected();
30  $parent = $parent->getParent();
31  }
32 }
33 
34 foreach ($vars['menu'] as $section => $menu_items) {
35  echo elgg_view('navigation/menu/elements/section', array(
36  'items' => $menu_items,
37  'class' => "$class elgg-menu-page-$section",
38  'section' => $section,
39  'name' => $vars['name'],
40  'show_section_headers' => $headers
41  ));
42 }
$headers
Page menu.
Definition: page.php:12
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$menu_items
Definition: save.php:14
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1083
if(empty($vars['name'])) $class
Definition: page.php:20
if(file_exists($welcome)) $vars
Definition: upgrade.php:93