Ejemplo n.º 1
0
 /**
  * Add default action commands and set the action bar title
  * .
  *
  * @param KControllerContextInterface $context A command context object
  */
 protected function _afterRead(KControllerContextInterface $context)
 {
     $controller = $this->getController();
     $translator = $this->getObject('translator');
     $name = $translator->translate(strtolower($context->subject->getIdentifier()->name));
     if ($controller->getModel()->getState()->isUnique()) {
         $title = $translator->translate('Edit {item_type}', array('item_type' => $name));
     } else {
         $title = $translator->translate('Create new {item_type}', array('item_type' => $name));
     }
     $this->getCommand('title')->title = $title;
     parent::_afterRead($context);
 }