]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add more events to profile list
authorEvan Prodromou <evan@status.net>
Thu, 15 Oct 2009 10:01:26 +0000 (06:01 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 15 Oct 2009 10:01:26 +0000 (06:01 -0400)
EVENTS.txt
actions/groupmembers.php
lib/profilelist.php

index 9de2f8bc6bbfffaa271a442be37e8c36ba811ad3..5d34a9e13b75ef7ab3730037af4277cfdbd67216 100644 (file)
@@ -390,3 +390,68 @@ EndProfilePageProfileTags: after showing the tags on the profile page
 - $action: the current action
 - &$profile: the profile being shown
 
+StartProfileList: when starting a list of profiles (before <ul>)
+- $profilelist: ProfileList widget, with $profile, $action, and $out
+
+EndProfileList: when ending a list of profiles (after </ul>)
+- $profilelist: ProfileList widget
+
+StartProfileListItem: when starting to show a profile list item
+- $item: ProfileListItem widget
+
+EndProfileListItem: after showing a profile list item
+- $item: ProfileListItem widget
+
+StartProfileListItemProfile: the profile data part of the item
+- $item: ProfileListItem widget
+
+EndProfileListItemProfile: the profile data part of the item
+- $item: ProfileListItem widget
+
+StartProfileListItemActions: the actions (buttons) for an item
+- $item: ProfileListItem widget
+
+EndProfileListItemActions: the actions (buttons) for an item
+- $item: ProfileListItem widget
+
+StartProfileListItemProfileElements: inside the <div>
+- $item: ProfileListItem widget
+
+EndProfileListItemProfileElements: inside the <div>
+- $item: ProfileListItem widget
+
+StartProfileListItemAvatar: Showing a profile list avatar
+- $item: ProfileListItem widget
+
+EndProfileListItemAvatar: Showing a profile list avatar
+- $item: ProfileListItem widget
+
+StartProfileListItemFullName: Showing the profile list full name
+- $item: ProfileListItem widget
+
+EndProfileListItemFullName: Showing the profile list full name
+- $item: ProfileListItem widget
+
+StartProfileListItemLocation: Showing the profile list location
+- $item: ProfileListItem widget
+
+EndProfileListItemLocation: Showing the profile list location
+- $item: ProfileListItem widget
+
+StartProfileListItemHomepage: Showing the profile list homepage
+- $item: ProfileListItem widget
+
+EndProfileListItemHomepage: Showing the profile list homepage
+- $item: ProfileListItem widget
+
+StartProfileListItemBio: Showing the profile list bio
+- $item: ProfileListItem widget
+
+EndProfileListItemBio: Showing the profile list bio
+- $item: ProfileListItem widget
+
+StartProfileListItemActionElements: Showing the profile list actions (prepend a button here, or replace all buttons)
+- $item: ProfileListItem widget
+
+EndProfileListItemActionElements: Showing profile list actions (append a button here)
+- $item: ProfileListItem widget
index dcbdd375972272a709afe0fee6cb7c2805095653..b326a0df75f2b8f80b05f24c039789be96791bbd 100644 (file)
@@ -179,9 +179,12 @@ class GroupMemberListItem extends ProfileListItem
     function showActions()
     {
         $this->startActions();
-        $this->showSubscribeButton();
-        $this->showMakeAdminForm();
-        $this->showGroupBlockForm();
+        if (Event::handle('StartProfileListItemActionElements', array($this))) {
+            $this->showSubscribeButton();
+            $this->showMakeAdminForm();
+            $this->showGroupBlockForm();
+            Event::handle('EndProfileListItemActionElements', array($this));
+        }
         $this->endActions();
     }
 
index 331430b3ef67b4565541e216be71ee3662967355..5cc211e362156be6e9cebcbcf36d32206c135812 100644 (file)
@@ -62,9 +62,15 @@ class ProfileList extends Widget
 
     function show()
     {
-        $this->startList();
-        $cnt = $this->showProfiles();
-        $this->endList();
+        $cnt = 0;
+
+        if (Event::handle('StartProfileList', array($this))) {
+            $this->startList();
+            $cnt = $this->showProfiles();
+            $this->endList();
+            Event::handle('EndProfileList', array($this));
+        }
+
         return $cnt;
     }
 
@@ -117,10 +123,19 @@ class ProfileListItem extends Widget
 
     function show()
     {
-        $this->startItem();
-        $this->showProfile();
-        $this->showActions();
-        $this->endItem();
+        if (Event::handle('StartProfileListItem', array($this))) {
+            $this->startItem();
+            if (Event::handle('StartProfileListItemProfile', array($this))) {
+                $this->showProfile();
+                Event::handle('EndProfileListItemProfile', array($this));
+            }
+            if (Event::handle('StartProfileListItemActions', array($this))) {
+                $this->showActions();
+                Event::handle('EndProfileListItemActions', array($this));
+            }
+            $this->endItem();
+            Event::handle('EndProfileListItem', array($this));
+        }
     }
 
     function startItem()
@@ -132,11 +147,29 @@ class ProfileListItem extends Widget
     function showProfile()
     {
         $this->startProfile();
-        $this->showAvatar();
-        $this->showFullName();
-        $this->showLocation();
-        $this->showHomepage();
-        $this->showBio();
+        if (Event::handle('StartProfileListItemProfileElements', array($this))) {
+            if (Event::handle('StartProfileListItemAvatar', array($this))) {
+                $this->showAvatar();
+                Event::handle('EndProfileListItemAvatar', array($this));
+            }
+            if (Event::handle('StartProfileListItemFullName', array($this))) {
+                $this->showFullName();
+                Event::handle('EndProfileListItemFullName', array($this));
+            }
+            if (Event::handle('StartProfileListItemLocation', array($this))) {
+                $this->showLocation();
+                Event::handle('EndProfileListItemLocation', array($this));
+            }
+            if (Event::handle('StartProfileListItemHomepage', array($this))) {
+                $this->showHomepage();
+                Event::handle('EndProfileListItemHomepage', array($this));
+            }
+            if (Event::handle('StartProfileListItemBio', array($this))) {
+                $this->showBio();
+                Event::handle('EndProfileListItemBio', array($this));
+            }
+            Event::handle('EndProfileListItemProfileElements', array($this));
+        }
         $this->endProfile();
     }
 
@@ -225,7 +258,10 @@ class ProfileListItem extends Widget
     function showActions()
     {
         $this->startActions();
-        $this->showSubscribeButton();
+        if (Event::handle('StartProfileListItemActionElements', array($this))) {
+            $this->showSubscribeButton();
+            Event::handle('EndProfileListItemActionElements', array($this));
+        }
         $this->endActions();
     }