]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groups.php
Add machine-readable pagination using HTML4.01 `<link rel="next">`, etc.
[quix0rs-gnu-social.git] / actions / groups.php
index 39dc2232bc5d82574b658b22883d8e831f11c531..b0bf7cfc2af57417f09e59940df24bbd31380fef 100644 (file)
@@ -129,4 +129,24 @@ 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')));
+    }
 }