]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showgroup.php
Merge branch '1.0.x' into testing
[quix0rs-gnu-social.git] / actions / showgroup.php
index 512ca6a0ee262d71d89d49c1899164d0ce84bf8a..530deff622ff21a8b0cdf1668afb3245cbcb59a0 100644 (file)
@@ -23,7 +23,7 @@
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
  * @author    Sarven Capadisli <csarven@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -46,10 +46,12 @@ define('MEMBERS_PER_SECTION', 27);
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-class ShowgroupAction extends GroupDesignAction
+class ShowgroupAction extends Action
 {
     /** page we're viewing. */
     var $page = null;
+    var $userProfile = null;
+    var $notice = null;
 
     /**
      * Is this page read-only?
@@ -144,6 +146,13 @@ class ShowgroupAction extends GroupDesignAction
             return false;
         }
 
+        $this->userProfile = Profile::current();
+
+        $stream = new ThreadingGroupNoticeStream($this->group, $this->userProfile);
+
+        $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+                                            NOTICES_PER_PAGE + 1);
+
         common_set_returnto($this->selfUrl());
 
         return true;
@@ -190,10 +199,7 @@ class ShowgroupAction extends GroupDesignAction
      */
     function showGroupNotices()
     {
-        $notice = $this->group->getNotices(($this->page-1)*NOTICES_PER_PAGE,
-                                           NOTICES_PER_PAGE + 1);
-
-        $nl = new ThreadedNoticeList($notice, $this);
+        $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
         $cnt = $nl->show();
 
         $this->pagination($this->page > 1,
@@ -432,3 +438,11 @@ class GroupMembersMiniListItem extends ProfileMiniListItem
         return $aAttrs;
     }
 }
+
+class ThreadingGroupNoticeStream extends ThreadingNoticeStream
+{
+    function __construct($group, $profile)
+    {
+        parent::__construct(new GroupNoticeStream($group, $profile));
+    }
+}
\ No newline at end of file