]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groups.php
Merge branch 'tos' into 0.8.x
[quix0rs-gnu-social.git] / actions / groups.php
index b0bf7cfc2af57417f09e59940df24bbd31380fef..3d62843ed678d54d08c9fd3ccb5ca897568a5c75 100644 (file)
@@ -51,7 +51,7 @@ class GroupsAction extends Action
     var $page = null;
     var $profile = null;
 
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return true;
     }
@@ -100,11 +100,13 @@ class GroupsAction extends Action
 
     function showContent()
     {
-        $this->elementStart('p', array('id' => 'new_group'));
-        $this->element('a', array('href' => common_local_url('newgroup'),
-                                  'class' => 'more'),
-                       _('Create a new group'));
-        $this->elementEnd('p');
+        if (common_logged_in()) {
+            $this->elementStart('p', array('id' => 'new_group'));
+            $this->element('a', array('href' => common_local_url('newgroup'),
+                                      'class' => 'more'),
+                           _('Create a new group'));
+            $this->elementEnd('p');
+        }
 
         $offset = ($this->page-1) * GROUPS_PER_PAGE;
         $limit =  GROUPS_PER_PAGE + 1;
@@ -113,6 +115,7 @@ class GroupsAction extends Action
         $groups->orderBy('created DESC');
         $groups->limit($offset, $limit);
 
+        $cnt = 0;
         if ($groups->find()) {
             $gl = new GroupList($groups, null, $this);
             $cnt = $gl->show();
@@ -129,24 +132,4 @@ class GroupsAction extends Action
         $gbm = new GroupsByMembersSection($this);
         $gbm->show();
     }
-
-    /**
-     * Output document relationship links
-     *
-     * @return void
-     */
-    function showRelationshipLinks()
-    {
-        // Machine-readable pagination
-        if ($this->page > 1) {
-            $this->element('link', array('rel' => 'next',
-                                         'href' => common_local_url('groups',
-                                                                    array('page' => $this->page - 1)),
-                                         'title' => _('Next Groups')));
-        }
-        $this->element('link', array('rel' => 'prev',
-                                     'href' => common_local_url('groups',
-                                                                array('page' => $this->page + 1)),
-                                     'title' => _('Previous Groups')));
-    }
 }