diff options
author | Evan Prodromou <evan@status.net> | 2009-11-01 13:04:23 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-01 13:04:23 -0500 |
commit | 5f5413624d166a9b2116d266c7698dd6dcd2d8c4 (patch) | |
tree | 3f7f85bbfb747d68bf518df026eea6ac686ad0c0 /lib/profilelist.php | |
parent | 658683e240ef6e44c6450a16448fe7cb82f792f2 (diff) | |
parent | 44ce8e2fcd1eba0d0f2723c246c1a021614e2763 (diff) |
Merge branch '0.9.x' into userflag
Diffstat (limited to 'lib/profilelist.php')
-rw-r--r-- | lib/profilelist.php | 62 |
1 files changed, 49 insertions, 13 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php index 331430b3e..5cc211e36 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -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(); } |