예제 #1
0
파일: Backend.php 프로젝트: ktrzos/plethora
 /**
  * ACTION - Backend edit action.
  *
  * @access     public
  * @return     View
  * @throws     Exception\Code403
  * @throws     Exception\Code404
  * @throws     Exception\Fatal
  * @since      1.0.0-alpha
  * @version    1.0.0-alpha
  */
 public function actionEdit()
 {
     $sIdParam = Router::getParam('id');
     if ($sIdParam === FALSE) {
         throw new Exception\Code404();
     }
     $this->addeditJs();
     try {
         $this->loadModelForActions();
     } catch (Exception $oExc) {
         $this->addToTitle(__('Error'));
         $this->addSystemMessage('XXX', 'danger');
         die('TODO');
     }
     // check permissions
     $this->checkPermissions('edit');
     // add title ad breadcrumb
     $this->alterBreadcrumbsTitleEdit();
     $oConfig = new ModelCore\ModelFormConfig();
     $oConfig->setMessage(__('Edit operation was successful.'));
     $oModelForm = $this->getModel()->form('edit', $oConfig);
     /* @var $oModelForm \Plethora\ModelCore\ModelForm */
     $oForm = $oModelForm->generate();
     return View::factory($this->sViewForm)->bind('oForm', $oForm)->set('sTitle', $this->getTitle());
 }