]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showgroup.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / showgroup.php
index 3d369e9ebfbf7d46577be5ba3f0b31d559b76640..9a12bafaf62aba1b4ff763738f1125c558f8cf19 100644 (file)
@@ -316,6 +316,12 @@ class ShowgroupAction extends GroupDesignAction
             Event::handle('EndGroupSubscribe', array($this, $this->group));
         }
         $this->elementEnd('li');
+        if ($cur->hasRight(Right::DELETEGROUP)) {
+            $this->elementStart('li', 'entity_delete');
+            $df = new DeleteGroupForm($this, $this->group);
+            $df->show();
+            $this->elementEnd('li');
+        }
         $this->elementEnd('ul');
         $this->elementEnd('div');
     }
@@ -430,14 +436,6 @@ class ShowgroupAction extends GroupDesignAction
 
     function showStatistics()
     {
-        // XXX: WORM cache this
-        $members = $this->group->getMembers();
-        $members_count = 0;
-        /** $member->count() doesn't work. */
-        while ($members->fetch()) {
-            $members_count++;
-        }
-
         $this->elementStart('div', array('id' => 'entity_statistics',
                                          'class' => 'section'));
 
@@ -451,7 +449,7 @@ class ShowgroupAction extends GroupDesignAction
 
         $this->elementStart('dl', 'entity_members');
         $this->element('dt', null, _('Members'));
-        $this->element('dd', null, (is_int($members_count)) ? $members_count : '0');
+        $this->element('dd', null, $this->group->getMemberCount());
         $this->elementEnd('dl');
 
         $this->elementEnd('div');