]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added event hook to remote subscription
authorSarven Capadisli <csarven@status.net>
Sat, 13 Feb 2010 17:40:36 +0000 (18:40 +0100)
committerSarven Capadisli <csarven@status.net>
Sat, 13 Feb 2010 17:40:36 +0000 (18:40 +0100)
EVENTS.txt
lib/userprofile.php

index 6bf12bf13fb15db9ea94507971c635266db383ee..69fe2ddccb37f24de7cd429b2151abdabe4e3f6c 100644 (file)
@@ -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.)
index 07e5750852eaa77a8e86eafd73e939296dd71eb0..43dfd05be5988e0d912af9f28124b5fa8b56da70 100644 (file)
@@ -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');