X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpeopletagged.php;h=98e0cd7125c009b8306881c7ddf2e88816117c9c;hb=3f28b17c86c4cd88d4f39629ea8a89ec3a820790;hp=5038d1e213b2c4114dde89d364e1611521863073;hpb=ad86eb78d3dc395b438d1543a36eca509f53e9d4;p=quix0rs-gnu-social.git diff --git a/actions/peopletagged.php b/actions/peopletagged.php index 5038d1e213..98e0cd7125 100644 --- a/actions/peopletagged.php +++ b/actions/peopletagged.php @@ -22,7 +22,7 @@ * @category Group * @package StatusNet * @author Shashi Gowda - * @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/ */ @@ -42,24 +42,28 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - -class PeopletaggedAction extends OwnerDesignAction +class PeopletaggedAction extends Action { var $page = null; var $peopletag = null; var $tagger = null; - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - $tagger_arg = $this->arg('tagger'); + if (common_config('singleuser', 'enabled')) { + $tagger_arg = User::singleUserNickname(); + } else { + $tagger_arg = $this->arg('tagger'); + } + $tag_arg = $this->arg('tag'); $tagger = common_canonical_nickname($tagger_arg); $tag = common_canonical_tag($tag_arg); @@ -72,27 +76,26 @@ class PeopletaggedAction extends OwnerDesignAction $args['page'] = $this->page; } common_redirect(common_local_url('peopletagged', $args), 301); - return false; } if (!$tagger) { + // TRANS: Client error displayed when a tagger is expected but not provided. $this->clientError(_('No tagger.'), 404); - return false; } - $user = User::staticGet('nickname', $tagger); + $user = User::getKV('nickname', $tagger); if (!$user) { + // TRANS: Client error displayed when referring to non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagger = $user->getProfile(); $this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag)); if (!$this->peopletag) { - $this->clientError(_('No such peopletag.'), 404); - return false; + // TRANS: Client error displayed when referring to a non-existing list. + $this->clientError(_('No such list.'), 404); } return true; @@ -101,16 +104,20 @@ class PeopletaggedAction extends OwnerDesignAction function title() { if ($this->page == 1) { - return sprintf(_('People tagged %s by %s'), + // TRANS: Title for list of people listed by the user. + // TRANS: %1$s is a list, %2$s is a username. + return sprintf(_('People listed in %1$s by %2$s'), $this->peopletag->tag, $this->tagger->nickname); } else { - return sprintf(_('People tagged %s by %s, page %d'), + // TRANS: Title for list of people listed by the user. + // TRANS: %1$s is a list, %2$s is a username, %2$s is a page number. + return sprintf(_('People listed in %1$s by %2$s, page %3$d'), $this->peopletag->tag, $this->user->nickname, $this->page); } } - function handle($args) + function handle(array $args=array()) { parent::handle($args); $this->showPage(); @@ -160,7 +167,7 @@ class PeopletagMemberList extends ProfileList $this->peopletag = $peopletag; } - function newListItem($profile) + function newListItem(Profile $profile) { return new PeopletagMemberListItem($profile, $this->peopletag, $this->action); } @@ -182,6 +189,7 @@ class PeopletagMemberListItem extends ProfileListItem parent::showFullName(); if ($this->profile->id == $this->peopletag->tagger) { $this->out->text(' '); + // TRANS: Addition in tag membership list for creator of a tag. $this->out->element('span', 'role', _('Creator')); } } @@ -206,7 +214,7 @@ class PeopletagMemberListItem extends ProfileListItem /** * Fetch necessary return-to arguments for the profile forms * to return to this list when they're done. - * + * * @return array */ protected function returnToArgs()