]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showgroup.php
switch between conversation and stream for public and group
[quix0rs-gnu-social.git] / actions / showgroup.php
index 9d4051bd89dd03db8b39d38ca2629b88f018629c..5e1012e9d8ad88d0219cd30be5be4a2ae10c17a8 100644 (file)
@@ -50,6 +50,7 @@ class ShowgroupAction extends GroupAction
     var $page = null;
     var $userProfile = null;
     var $notice = null;
+    var $mode = 'conversation';
 
     /**
      * Is this page read-only?
@@ -97,10 +98,15 @@ class ShowgroupAction extends GroupAction
 
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
 
+        $this->mode = $this->trimmed('mode', 'conversation');
 
         $this->userProfile = Profile::current();
 
-        $stream = new ThreadingGroupNoticeStream($this->group, $this->userProfile);
+        if ($this->mode == 'stream') {
+            $stream = new GroupNoticeStream($this->group, $this->userProfile);
+        } else {
+            $stream = new ThreadingGroupNoticeStream($this->group, $this->userProfile);
+        }
 
         $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
                                             NOTICES_PER_PAGE + 1);
@@ -140,7 +146,12 @@ class ShowgroupAction extends GroupAction
      */
     function showGroupNotices()
     {
-        $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
+        if ($this->mode == 'stream') {
+            $nl = new NoticeList($this->notice, $this);
+        } else {
+            $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
+        } 
+
         $cnt = $nl->show();
 
         $this->pagination($this->page > 1,