]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
switch between conversation and stream for public and group
authorEvan Prodromou <evan@status.net>
Fri, 23 Sep 2011 21:28:54 +0000 (17:28 -0400)
committerEvan Prodromou <evan@status.net>
Fri, 23 Sep 2011 21:28:54 +0000 (17:28 -0400)
actions/public.php
actions/showgroup.php

index 75217cb2293965ed4394a4701bad86f590650ce0..847aba666e6c41d2e97856d90ad3e50e3de68e06 100644 (file)
@@ -60,6 +60,7 @@ class PublicAction extends Action
     var $page = null;
     var $notice;
     var $userProfile = null;
+    var $mode = 'conversation';
 
     function isReadOnly($args)
     {
@@ -88,7 +89,13 @@ class PublicAction extends Action
 
         $this->userProfile = Profile::current();
 
-        $stream = new ThreadingPublicNoticeStream($this->userProfile);
+        $this->mode = $this->trimmed('mode', 'conversation');
+
+        if ($this->mode == 'stream') {
+            $stream = new PublicNoticeStream($this->userProfile);
+        } else {
+            $stream = new ThreadingPublicNoticeStream($this->userProfile);
+        }
 
         $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
                                             NOTICES_PER_PAGE + 1);
@@ -213,7 +220,11 @@ class PublicAction extends Action
      */
     function showContent()
     {
-        $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();
 
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,