* @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/
*/
* @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?
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;
*/
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,
$this->raw(common_markup_to_html($m));
$this->elementEnd('div');
}
+
+ function noticeFormOptions()
+ {
+ $options = parent::noticeFormOptions();
+ $cur = common_current_user();
+
+ if (!empty($cur) && $cur->isMember($this->group)) {
+ $options['to_group'] = $this->group;
+ }
+
+ return $options;
+ }
}
class GroupAdminSection extends ProfileSection
return $aAttrs;
}
}
+
+class ThreadingGroupNoticeStream extends ThreadingNoticeStream
+{
+ function __construct($group, $profile)
+ {
+ parent::__construct(new GroupNoticeStream($group, $profile));
+ }
+}
\ No newline at end of file