summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-02-13 18:40:36 +0100
committerSarven Capadisli <csarven@status.net>2010-02-13 18:40:36 +0100
commitfc19179bc54de1837bbc64f052a93628be9c6a3d (patch)
tree8b077887a04ed668859e671b215ec63334d85971
parentf3a82e787c70e8cf749c79f22fe37ce6c9c9d4d3 (diff)
Added event hook to remote subscription
-rw-r--r--EVENTS.txt10
-rw-r--r--lib/userprofile.php9
2 files changed, 15 insertions, 4 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index 6bf12bf13..69fe2ddcc 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -1,4 +1,4 @@
-InitializePlugin: a chance to initialize a plugin in a complete environment
+\InitializePlugin: a chance to initialize a plugin in a complete environment
CleanupPlugin: a chance to cleanup a plugin at the end of a program
@@ -355,6 +355,14 @@ EndShowHeadElements: Right before the </head> tag; put <script>s here if you nee
CheckSchema: chance to check the schema
+StartProfileRemoteSubscribe: Before showing the link to remote subscription
+- $userprofile: UserProfile widget
+- &$profile: the profile being shown
+
+EndProfileRemoteSubscribe: After showing the link to remote subscription
+- $userprofile: UserProfile widget
+- &$profile: the profile being shown
+
StartProfilePageProfileSection: Starting to show the section of the
profile page with the actual profile data;
hook to prevent showing the profile (e.g.)
diff --git a/lib/userprofile.php b/lib/userprofile.php
index 07e575085..43dfd05be 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -238,9 +238,12 @@ class UserProfile extends Widget
if (Event::handle('StartProfilePageActionsElements', array(&$this->out, $this->profile))) {
if (empty($cur)) { // not logged in
- $this->out->elementStart('li', 'entity_subscribe');
- $this->showRemoteSubscribeLink();
- $this->out->elementEnd('li');
+ if (Event::handle('StartProfileRemoteSubscribe', array(&$this->out, $this->profile))) {
+ $this->out->elementStart('li', 'entity_subscribe');
+ $this->showRemoteSubscribeLink();
+ $this->out->elementEnd('li');
+ Event::handle('EndProfileRemoteSubscribe', array(&$this->out, $this->profile));
+ }
} else {
if ($cur->id == $this->profile->id) { // your own page
$this->out->elementStart('li', 'entity_edit');