' . PHP_EOL; } /** * {@inheritdoc } */ public function getCloseTagWrapper() { return PHP_EOL . '' . PHP_EOL; } /** * {@inheritdoc } */ public function getMenuWithoutDropdownWrapper($item) { return 'getActiveState($item) . '>' . $item->getIcon() . ' ' . $item->title . '' . PHP_EOL; } /** * {@inheritdoc } */ public function getActiveState(MenuItem $item) { $active = ' class="active open"'; if (empty($item->getChilds())) { // for direct menu input return if page is active return \Request::is($item->getRequest()) ? $active : null; } else { // on nested menu inputs loop over children and in case any of them is active, mark active also root level foreach ($item->getChilds() as $child) { if ($this->getActiveState($child)) { return $active; } } } return null; } /** * {@inheritdoc } */ public function getDividerWrapper() { return '
  • ' . PHP_EOL; } public function getMultiLevelDropdownWrapper($item) { return $this->getMenuWithDropDownWrapper($item); } /** * {@inheritdoc } */ public function getMenuWithDropDownWrapper($item) { $active = $this->getActiveState($item); return '
  • ' . $item->getIcon() . ' ' . $item->title . '
  • ' . PHP_EOL; } }