X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowgroup.php;h=46d0a227f536ecc4253212e6b55cb5fe2ba71d1b;hb=2c5cba28b6a8e13a58fe7584835340aa9779b146;hp=5e1012e9d8ad88d0219cd30be5be4a2ae10c17a8;hpb=66c97a1a1ee782b364ab68eed27193f3caf34965;p=quix0rs-gnu-social.git diff --git a/actions/showgroup.php b/actions/showgroup.php index 5e1012e9d8..46d0a227f5 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -50,7 +50,6 @@ class ShowgroupAction extends GroupAction var $page = null; var $userProfile = null; var $notice = null; - var $mode = 'conversation'; /** * Is this page read-only? @@ -92,17 +91,17 @@ class ShowgroupAction extends GroupAction * * @return boolean success flag */ - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - $this->mode = $this->trimmed('mode', 'conversation'); - $this->userProfile = Profile::current(); - if ($this->mode == 'stream') { + $user = common_current_user(); + + if (!empty($user) && $user->streamModeOnly()) { $stream = new GroupNoticeStream($this->group, $this->userProfile); } else { $stream = new ThreadingGroupNoticeStream($this->group, $this->userProfile); @@ -124,8 +123,9 @@ class ShowgroupAction extends GroupAction * * @return void */ - function handle($args) + protected function handle() { + parent::handle(); $this->showPage(); } @@ -146,8 +146,10 @@ class ShowgroupAction extends GroupAction */ function showGroupNotices() { - if ($this->mode == 'stream') { - $nl = new NoticeList($this->notice, $this); + $user = common_current_user(); + + if (!empty($user) && $user->streamModeOnly()) { + $nl = new PrimaryNoticeList($this->notice, $this, array('show_n'=>NOTICES_PER_PAGE)); } else { $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile); } @@ -210,28 +212,34 @@ class ShowgroupAction extends GroupAction function showAnonymousMessage() { if (!(common_config('site','closed') || common_config('site','inviteonly'))) { - // @todo FIXME: use group full name here if available instead of (uglier) primary alias. // TRANS: Notice on group pages for anonymous users for StatusNet sites that accept new registrations. - // TRANS: **%s** is the group alias, %%%%site.name%%%% is the site name, + // TRANS: %s is the group name, %%%%site.name%%%% is the site name, // TRANS: %%%%action.register%%%% is the URL for registration, %%%%doc.help%%%% is a URL to help. // TRANS: This message contains Markdown links. Ensure they are formatted correctly: [Description](link). $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' . 'short messages about their life and interests. '. '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), - $this->group->nickname); + $this->group->getBestName()); } else { - // @todo FIXME: use group full name here if available instead of (uglier) primary alias. // TRANS: Notice on group pages for anonymous users for StatusNet sites that accept no new registrations. - // TRANS: **%s** is the group alias, %%%%site.name%%%% is the site name, + // TRANS: %s is the group name, %%%%site.name%%%% is the site name, // TRANS: This message contains Markdown links. Ensure they are formatted correctly: [Description](link). $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' . - 'short messages about their life and interests. '), - $this->group->nickname); + 'short messages about their life and interests.'), + $this->group->getBestName()); } $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); } + + function extraHead() + { + if ($this->page != 1) { + $this->element('link', array('rel' => 'canonical', + 'href' => $this->group->homeUrl())); + } + } }