]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Support mode in all
authorEvan Prodromou <evan@status.net>
Fri, 23 Sep 2011 21:18:21 +0000 (17:18 -0400)
committerEvan Prodromou <evan@status.net>
Fri, 23 Sep 2011 21:18:21 +0000 (17:18 -0400)
actions/all.php

index a987ebbadbc135aaa1b9af5b1f00a26b5182c736..bab59a7d03da2163d20b678995ccc5b7cb2ff9c6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
+ * Copyright (C) 2008-2011, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -46,6 +46,7 @@ require_once INSTALLDIR.'/lib/feedlist.php';
 class AllAction extends ProfileAction
 {
     var $notice;
+    var $mode = 'conversation';
 
     function isReadOnly($args)
     {
@@ -56,7 +57,13 @@ class AllAction extends ProfileAction
     {
         parent::prepare($args);
 
-        $stream = new ThreadingInboxNoticeStream($this->user, Profile::current());
+        $this->mode = $this->trimmed('mode', 'conversation');
+
+        if ($this->mode == 'stream') {
+            $stream = new InboxNoticeStream($this->user, Profile::current());
+        } else {
+            $stream = new ThreadingInboxNoticeStream($this->user, Profile::current());
+        }
 
         $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
                                             NOTICES_PER_PAGE + 1);
@@ -176,7 +183,11 @@ class AllAction extends ProfileAction
                 $profile = $current_user->getProfile();
             }
 
-            $nl = new ThreadedNoticeList($this->notice, $this, $profile);
+            if ($this->mode == 'stream') {
+                $nl = new NoticeList($this->notice, $this);
+            } else {
+                $nl = new ThreadedNoticeList($this->notice, $this, $profile);
+            }
 
             $cnt = $nl->show();