summaryrefslogtreecommitdiff
path: root/plugins/UserFlag
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-19 19:29:55 -0800
committerZach Copley <zach@status.net>2009-11-19 19:29:55 -0800
commit3d2a2d4173739a36b45fa32535180b6534b083f9 (patch)
tree7b5921d853b17585cfbd24e7756d46e5a30584cb /plugins/UserFlag
parent2eed928837e767cb9d41bf73bdadd23df7cb8877 (diff)
Fixed HXR response for flag user
Diffstat (limited to 'plugins/UserFlag')
-rw-r--r--plugins/UserFlag/flagprofile.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php
index 8ff2f1f72..b01d07e34 100644
--- a/plugins/UserFlag/flagprofile.php
+++ b/plugins/UserFlag/flagprofile.php
@@ -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() {