From 06fb1124f5cd328bc0b3028a0cc0499b1c916653 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 3 Mar 2010 11:14:39 -0500 Subject: Added event hooks for start and end of subscriptions mini list --- EVENTS.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index bb4936b35..a40855134 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -776,6 +776,12 @@ StartShowAllContent: before showing the all (you and friends) content EndShowAllContent: after showing the all (you and friends) content - $action: the current action +StartShowSubscriptionsMiniList: at the start of subscriptions mini list +- $action: the current action + +EndShowSubscriptionsMiniList: at the end of subscriptions mini list +- $action: the current action + StartDeleteUserForm: starting the data in the form for deleting a user - $action: action being shown - $user: user being deleted -- cgit v1.2.3-54-g00ecf From b65ee23e8293c301f8b142320eabff6c4acdfcfe Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 3 Mar 2010 12:01:38 -0500 Subject: Added event hooks for group subscribe --- EVENTS.txt | 8 ++++++++ actions/showgroup.php | 24 +++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index a40855134..2c3863f22 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -363,6 +363,14 @@ EndProfileRemoteSubscribe: After showing the link to remote subscription - $userprofile: UserProfile widget - &$profile: the profile being shown +StartGroupSubscribe: Before showing the link to remote subscription +- $action: the current action +- $group: the group being shown + +EndGroupSubscribe: After showing the link to remote subscription +- $action: the current action +- $group: the group 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/actions/showgroup.php b/actions/showgroup.php index 4e1fcb6c7..a1dc3865b 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -300,20 +300,22 @@ class ShowgroupAction extends GroupDesignAction $this->elementStart('div', 'entity_actions'); $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); - $this->elementStart('li', 'entity_subscribe'); - $cur = common_current_user(); - if ($cur) { - if ($cur->isMember($this->group)) { - $lf = new LeaveForm($this, $this->group); - $lf->show(); - } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) { - $jf = new JoinForm($this, $this->group); - $jf->show(); + if (Event::handle('StartGroupSubscribe', array($this, $this->group))) { + $this->elementStart('li', 'entity_subscribe'); + $cur = common_current_user(); + if ($cur) { + if ($cur->isMember($this->group)) { + $lf = new LeaveForm($this, $this->group); + $lf->show(); + } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) { + $jf = new JoinForm($this, $this->group); + $jf->show(); + } } + $this->elementEnd('li'); + Event::handle('EndGroupSubscribe', array($this, $this->group)); } - $this->elementEnd('li'); - $this->elementEnd('ul'); $this->elementEnd('div'); } -- cgit v1.2.3-54-g00ecf