Esempio n. 1
0
 public function performEdit()
 {
     if (!user::current()->isAuthenticated()) {
         throw new http_exception(403);
     }
     $this->prepareControl();
     if (is_callable($this->viewCustomizer)) {
         call_user_func($this->viewCustomizer, $this, true);
     } else {
         $authenticated = user::current()->isAuthenticated();
         $this->editor->mayEdit($authenticated)->mayDelete($authenticated);
     }
     if ($this->editor->isEditable()) {
         $this->editor->form()->post();
     }
     if ($this->editor->processInput($this->editorValidator)) {
         txf::redirectTo($this->getUrls()->list);
     }
     return $this->editor->render();
 }
Esempio n. 2
0
 public function setEditor(model_editor $editor)
 {
     $editor->form()->post();
     return parent::setEditor($editor);
 }