Commit 8b203999 authored by Evan Prodromou's avatar Evan Prodromou

Add a hook for group action list

parent 4a435e66
...@@ -1082,3 +1082,11 @@ EndInterpretCommand: Before running a command ...@@ -1082,3 +1082,11 @@ EndInterpretCommand: Before running a command
- $user: User who issued the command - $user: User who issued the command
- $result: Resulting command - $result: Resulting command
StartGroupActionsList: Start the list of actions on a group profile page (after <ul>, before first <li>)
- $action: action being executed (for output and params)
- $group: group for the page
EndGroupActionsList: End the list of actions on a group profile page (before </ul>, after last </li>)
- $action: action being executed (for output and params)
- $group: group for the page
...@@ -303,25 +303,28 @@ class ShowgroupAction extends GroupDesignAction ...@@ -303,25 +303,28 @@ class ShowgroupAction extends GroupDesignAction
// TRANS: Group actions header (h2). Text hidden by default. // TRANS: Group actions header (h2). Text hidden by default.
$this->element('h2', null, _('Group actions')); $this->element('h2', null, _('Group actions'));
$this->elementStart('ul'); $this->elementStart('ul');
$this->elementStart('li', 'entity_subscribe'); if (Event::handle('StartGroupActionsList', array($this, $this->group))) {
if (Event::handle('StartGroupSubscribe', array($this, $this->group))) { $this->elementStart('li', 'entity_subscribe');
if ($cur) { if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
if ($cur->isMember($this->group)) { if ($cur) {
$lf = new LeaveForm($this, $this->group); if ($cur->isMember($this->group)) {
$lf->show(); $lf = new LeaveForm($this, $this->group);
} else if (!Group_block::isBlocked($this->group, $cur->getProfile())) { $lf->show();
$jf = new JoinForm($this, $this->group); } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
$jf->show(); $jf = new JoinForm($this, $this->group);
$jf->show();
}
} }
Event::handle('EndGroupSubscribe', array($this, $this->group));
} }
Event::handle('EndGroupSubscribe', array($this, $this->group));
}
$this->elementEnd('li');
if ($cur && $cur->hasRight(Right::DELETEGROUP)) {
$this->elementStart('li', 'entity_delete');
$df = new DeleteGroupForm($this, $this->group);
$df->show();
$this->elementEnd('li'); $this->elementEnd('li');
if ($cur && $cur->hasRight(Right::DELETEGROUP)) {
$this->elementStart('li', 'entity_delete');
$df = new DeleteGroupForm($this, $this->group);
$df->show();
$this->elementEnd('li');
}
Event::handle('EndGroupActionsList', array($this, $this->group));
} }
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->elementEnd('div'); $this->elementEnd('div');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment