/** * If the method is called with one of the standard Joomla toolbar buttons * translate the label correctly */ public function addCommand($name, $config = array()) { if (version_compare(JVERSION, '1.6', '>=') && !isset($config['label']) && in_array($name, self::$_default_buttons)) { $config['label'] = 'JTOOLBAR_' . $name; } return parent::addCommand($name, $config); }
/** * Add a command * * Disable the menubar only for singular views that are editable. * * @param string The command name * @param mixed Parameters to be passed to the command * @return KControllerToolbarInterface */ public function addCommand($name, $config = array()) { parent::addCommand($name, $config); $controller = $this->getController(); if ($controller->isEditable() && KInflector::isSingular($controller->getView()->getName())) { $this->_commands[$name]->disabled = true; } return $this; }