]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showgroup.php
Merge branch '1.0.x' of git://gitorious.org/statusnet/mainline
[quix0rs-gnu-social.git] / actions / showgroup.php
index a895f81b84bec6bce4a017b76d3086ed25329c57..411940ef9a2ed124a036e2db7d3fa53664aca0e2 100644 (file)
@@ -167,7 +167,7 @@ class ShowgroupAction extends GroupDesignAction
      *
      * @return void
      */
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
@@ -181,6 +181,7 @@ class ShowgroupAction extends GroupDesignAction
     function showContent()
     {
         $this->showGroupProfile();
+        $this->showGroupActions();
         $this->showGroupNotices();
     }
 
@@ -194,7 +195,7 @@ class ShowgroupAction extends GroupDesignAction
         $notice = $this->group->getNotices(($this->page-1)*NOTICES_PER_PAGE,
                                            NOTICES_PER_PAGE + 1);
 
-        $nl = new NoticeList($notice, $this);
+        $nl = new ThreadedNoticeList($notice, $this);
         $cnt = $nl->show();
 
         $this->pagination($this->page > 1,
@@ -258,34 +259,62 @@ class ShowgroupAction extends GroupDesignAction
                                'aliases entity_aliases',
                                implode(' ', $aliases));
             }
+
+            if ($this->group->description) {
+                $this->elementStart('dl', 'entity_note');
+                // TRANS: Label for group description or group note (dt). Text hidden by default.
+                $this->element('dt', null, _('Note'));
+                $this->element('dd', 'note', $this->group->description);
+                $this->elementEnd('dl');
+            }
+
+            if (common_config('group', 'maxaliases') > 0) {
+                $aliases = $this->group->getAliases();
+
+                if (!empty($aliases)) {
+                    $this->elementStart('dl', 'entity_aliases');
+                    // TRANS: Label for group aliases (dt). Text hidden by default.
+                    $this->element('dt', null, _('Aliases'));
+                    $this->element('dd', 'aliases', implode(' ', $aliases));
+                    $this->elementEnd('dl');
+                }
+            }
+
+            Event::handle('EndGroupProfileElements', array($this, $this->group));
         }
 
         $this->elementEnd('div');
+    }
 
+    function showGroupActions()
+    {
         $cur = common_current_user();
         $this->elementStart('div', 'entity_actions');
         // 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');