Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
item.php
Go to the documentation of this file.
1 <?php
12 $item = $vars['item'];
13 
14 $link_class = 'elgg-menu-closed';
15 if ($item->getSelected()) {
16  // @todo switch to addItemClass when that is implemented
17  //$item->setItemClass('elgg-state-selected');
18  $link_class = 'elgg-menu-opened';
19 }
20 
21 $children = $item->getChildren();
22 if ($children) {
23  $item->addLinkClass($link_class);
24  $item->addLinkClass('elgg-menu-parent');
25 }
26 
27 $item_class = $item->getItemClass();
28 if ($item->getSelected()) {
29  $item_class = "$item_class elgg-state-selected";
30 }
31 if (isset($vars['item_class']) && $vars['item_class']) {
32  $item_class .= ' ' . $vars['item_class'];
33 }
34 
35 echo "<li class=\"$item_class\">";
37 if ($children) {
38  echo elgg_view('navigation/menu/elements/section', array(
39  'items' => $children,
40  'class' => 'elgg-menu elgg-child-menu',
41  ));
42 }
43 echo '</li>';
$link_class
Definition: item.php:14
$vars['entity']
if($children) $item_class
Definition: item.php:27
$item
Definition: item.php:12
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_view_menu_item(\ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
Definition: views.php:774
if($item->getSelected()) $children
Definition: item.php:21