protected function getLabel(MenuElem $menu_elem) { $label = $this->translateLabel($menu_elem->getLabel()); if ($menu_elem->hasChildren() and $level == 0) { $label .= ' <b class="right-caret"></b>'; } return $label; }
protected function canSeeElem(MenuElem $menu_elem) { return $menu_elem->hasChildren() or $this->profile->hasPage($menu_elem->getUrl()); }
protected function buildAttrs(MenuElem $menu_elem) { $attr_li = $attr_a = array(); if ($menu_elem->hasChildren()) { if ($level > 0) { $attr_li['class'][] = 'dropdown-submenu'; if (!$this->isParentElemClickable()) { $attr_a['class'][] = 'dropdown-toggle'; } else { $attr_a['class'][] = 'dropdown-submenu-toggle'; } } else { $attr_li['class'][] = 'dropdown'; } $attr_a['data-toggle'][] = 'dropdown'; } if ($this->getActiveLink() and $this->getActiveLink() == $menu_elem->getUrl()) { $attr_li['class'][] = 'active'; } else { if ($menu_elem->getLabel() == 'divider' && $menu_elem->getUrl() == 'divider') { $attr_li['class'] = 'divider'; } } $attr_string_li = $this->attrToString($attr_li); $attr_string_a = $this->attrToString($attr_a); return array('li' => $attr_string_li, 'a' => $attr_string_a); }