]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/formaction.php
Introduced isCurrentProfileInScope() which shall check if current profile is
[quix0rs-gnu-social.git] / lib / formaction.php
index 60d9b3ce130a843ab458fbd3f995ae21d7704ac2..2599153870cf426c54adaba956fed7a14523776b 100644 (file)
@@ -44,6 +44,7 @@ if (!defined('STATUSNET')) {
 class FormAction extends ManagedAction
 {
     protected $form = null;
+    protected $formOpts = array();
     protected $type = null;
     protected $needLogin = true;
     protected $canPost = true;
@@ -64,7 +65,7 @@ class FormAction extends ManagedAction
         return true;
     }
 
-    public function isReadOnly($args) {
+    public function isReadOnly(array $args=array()) {
         return !$this->isPost();
     }
 
@@ -98,6 +99,26 @@ class FormAction extends ManagedAction
         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