]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add a hook for group action list
authorEvan Prodromou <evan@status.net>
Mon, 7 Feb 2011 15:23:56 +0000 (10:23 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 7 Feb 2011 15:23:56 +0000 (10:23 -0500)
EVENTS.txt
actions/showgroup.php

index 98927127b74fdf74b73510f73d8db94ee7c843b2..d6d80046745f7f6d75b290bd5b82434581fdf725 100644 (file)
@@ -1082,3 +1082,11 @@ EndInterpretCommand: Before running a command
 - $user: User who issued the 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
+
index f38cd420ac7b0a74d25b4332612f6e4167705197..58d7ec7c6f4a63679982713c3f5c0d341f94a360 100644 (file)
@@ -303,25 +303,28 @@ class ShowgroupAction extends GroupDesignAction
         // TRANS: Group actions header (h2). Text hidden by default.
         $this->element('h2', null, _('Group actions'));
         $this->elementStart('ul');
-        $this->elementStart('li', 'entity_subscribe');
-        if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
-            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('StartGroupActionsList', array($this, $this->group))) {
+            $this->elementStart('li', 'entity_subscribe');
+            if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
+                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();
+                    }
                 }
+                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');
+            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('div');