summaryrefslogtreecommitdiff
path: root/actions/showgroup.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-03-03 12:01:38 -0500
committerSarven Capadisli <csarven@status.net>2010-03-03 12:01:38 -0500
commitb65ee23e8293c301f8b142320eabff6c4acdfcfe (patch)
tree69e316b3b20b56ac81247815c24817f79e87fa7d /actions/showgroup.php
parentea10805e3f68f5781321e7c93144242478081a1f (diff)
Added event hooks for group subscribe
Diffstat (limited to 'actions/showgroup.php')
-rw-r--r--actions/showgroup.php24
1 files changed, 13 insertions, 11 deletions
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');
}