X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FUserFlag%2Fflagprofile.php;h=9bce7865b8c973114d42b12dacb804473183c25f;hb=ce46cce73ef8e1c60888755586919afdf9afee14;hp=8ff2f1f7271edf338bfac92ae3f2e10be1724ec4;hpb=6a1afda259c5223449f679a64f932e36df5ebe39;p=quix0rs-gnu-social.git diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php index 8ff2f1f727..9bce7865b8 100644 --- a/plugins/UserFlag/flagprofile.php +++ b/plugins/UserFlag/flagprofile.php @@ -72,6 +72,28 @@ 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 ($_SERVER['REQUEST_METHOD'] == 'POST') { + $this->handlePost(); + if (!$this->boolean('ajax')) { + $this->returnToArgs(); + } + } + } + /** * Handle POST * @@ -97,6 +119,10 @@ class FlagprofileAction extends ProfileFormAction } $ufp->free(); + + if ($this->boolean('ajax')) { + $this->ajaxResults(); + } } function ajaxResults() {