]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/managedaction.php
FormAction extends ManagedAction
[quix0rs-gnu-social.git] / lib / managedaction.php
index 580d8c09e3c72e3abb6b73affd82178544534711..318df320e1cf6c19cf4e12ece68782aaea80682a 100644 (file)
@@ -39,6 +39,14 @@ class ManagedAction extends Action
     {
         parent::handle();
 
+        if ($this->canPost && $this->isPost()) {
+            try {
+                $this->msg = $this->handlePost();
+            } catch (Exception $e) {
+                $this->error = $e->getMessage();
+            }
+        }
+
         if (StatusNet::isAjax()) {
             $this->showAjax();
         } else {
@@ -46,6 +54,11 @@ class ManagedAction extends Action
         }
     }
 
+    protected function handlePost()
+    {
+        // This will only be run if the Action has the property canPost==true
+    }
+
     public function showAjax()
     {
         $this->startHTML('text/xml;charset=utf-8');