/** * Overridden to be displayed if at least one of the children menus * should be displayed * * @see sfSympalMenu */ public function checkUserAccess(sfUser $user = null) { if (parent::checkUserAccess()) { return true; } foreach ($this->getChildren() as $child) { if ($child->checkUserAccess($user)) { return true; } } return false; }
public function renderChildBody() { if ($this->_isButton) { $class = $this->_isEditModeButton ? $this->_inputClass . ' sympal_inline_edit_bar_edit_buttons' : $this->_inputClass; if ($this->_route) { $html = '<a title="' . $this->_shortcut . '" type="button" href="' . url_for($this->_route) . '" class="' . $class . '">' . $this->renderLabel() . '</a>'; } else { $html = '<a title="' . $this->_shortcut . '" type="button" class="' . $class . '">' . $this->renderLabel() . '</a>'; } if ($this->_shortcut) { $html .= '<script type="text/javascript">$(function() { shortcut.add("' . $this->_shortcut . '", function() { $(\'.' . $this->_inputClass . '\').click(); }); });</script>'; } } else { $html = parent::renderChildBody(); } return $html; }
public function isCurrentAncestor() { $menuItem = sfSympalContext::getInstance()->getCurrentMenuItem(); if ($menuItem && $this->_menuItemArray) { $this->_currentObject = $this->findMenuItem($menuItem); return parent::isCurrentAncestor(); } return false; }