class FormAction extends ManagedAction
{
protected $form = null;
+ protected $formOpts = array();
protected $type = null;
protected $needLogin = true;
protected $canPost = true;
return true;
}
- public function isReadOnly($args) {
+ public function isReadOnly(array $args=array()) {
return !$this->isPost();
}
return null;
}
+ public function showForm($msg=null, $success=false)
+ {
+ $this->msg = $msg;
+ $this->success = $success;
+ $this->showPage();
+ }
+
+ protected function showContent()
+ {
+ $form = $this->getForm();
+ $form->show();
+ }
+
+ protected function getForm()
+ {
+ $class = $this->form.'Form';
+ $form = new $class($this, $this->formOpts);
+ return $form;
+ }
+
/**
* Gets called from handle() if isPost() is true;
* @return void