summaryrefslogtreecommitdiff
path: root/plugins/UserFlag
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserFlag')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php2
-rw-r--r--plugins/UserFlag/flagprofile.php26
-rw-r--r--plugins/UserFlag/flagprofileform.php12
3 files changed, 39 insertions, 1 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index 4717a63dd..60c0c2c0a 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -97,7 +97,7 @@ class UserFlagPlugin extends Plugin
{
$user = common_current_user();
- if (!empty($user)) {
+ if (!empty($user) && ($user->id != $profile->id)) {
$action->elementStart('li', 'entity_flag');
diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php
index 8ff2f1f72..9bce7865b 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() {
diff --git a/plugins/UserFlag/flagprofileform.php b/plugins/UserFlag/flagprofileform.php
index 262dad4a7..c20929a20 100644
--- a/plugins/UserFlag/flagprofileform.php
+++ b/plugins/UserFlag/flagprofileform.php
@@ -48,6 +48,18 @@ require_once INSTALLDIR.'/lib/form.php';
class FlagProfileForm extends ProfileActionForm
{
/**
+ * class of the form
+ * Action this form provides
+ *
+ * @return string class of the form
+ */
+
+ function formClass()
+ {
+ return 'form_entity_flag';
+ }
+
+ /**
* Action this form provides
*
* @return string Name of the action, lowercased.