]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed HXR response for flag user
authorZach Copley <zach@status.net>
Fri, 20 Nov 2009 03:29:55 +0000 (19:29 -0800)
committerZach Copley <zach@status.net>
Fri, 20 Nov 2009 03:29:55 +0000 (19:29 -0800)
plugins/UserFlag/flagprofile.php

index 8ff2f1f7271edf338bfac92ae3f2e10be1724ec4..b01d07e34f626f737933669b8ada3f7cb925f9b1 100644 (file)
@@ -72,6 +72,34 @@ class FlagprofileAction extends ProfileFormAction
         return true;
     }
 
+
+    /**
+     * Handle request
+     *
+     * Overriding the base Action's handle() here to deal check
+     * for Ajax and return an HXR response if necessary
+     *
+     * @param array $args $_REQUEST args; handled in prepare()
+     *
+     * @return void
+     */
+
+    function handle($args)
+    {
+        if ($this->boolean('ajax')) {
+            common_debug("ajax called for");
+        } else {
+            common_debug("no ajax");
+        }
+        
+        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+            $this->handlePost();
+            if (!$this->boolean('ajax')) {
+                $this->returnToArgs();
+            }
+        }
+    }
+
     /**
      * Handle POST
      *
@@ -97,6 +125,10 @@ class FlagprofileAction extends ProfileFormAction
         }
 
         $ufp->free();
+        
+        if ($this->boolean('ajax')) {
+            $this->ajaxResults();
+        }
     }
 
     function ajaxResults() {