예제 #1
0
파일: menubar.php 프로젝트: stonyyi/anahita
 /**
  * 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;
 }