* @category Group
* @package StatusNet
* @author Evan Prodromou <evan@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 PeopletagsubscribersAction extends OwnerDesignAction
+class PeopletagsubscribersAction extends Action
{
var $page = null;
var $peopletag = null;
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);
$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 trying to perform an action related to a 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) {
- // TRANS: Client error displayed trying to reference a non-existing people tag.
- $this->clientError(_('No such people tag.'), 404);
- return false;
+ // TRANS: Client error displayed trying to reference a non-existing list.
+ $this->clientError(_('No such list.'), 404);
}
return true;
function title()
{
if ($this->page == 1) {
- // TRANS: Page title for list of people tag subscribers.
- // TRANS: %1$s is a tag, %2$s is a user nickname.
- return sprintf(_('Subscribers of people tagged %1$s by %2$s'),
+ // TRANS: Page title for list of list subscribers.
+ // TRANS: %1$s is a list, %2$s is a user nickname.
+ return sprintf(_('Subscribers to list %1$s by %2$s'),
$this->peopletag->tag, $this->tagger->nickname);
} else {
- // TRANS: Page title for list of people tag subscribers.
- // TRANS: %1$s is a tag, %2$s is a user nickname, %3$d is a page number.
- return sprintf(_('Subscribers of people tagged %1$s by %2$s, page %3$d'),
+ // TRANS: Page title for list of list subscribers.
+ // TRANS: %1$s is a list, %2$s is a user nickname, %3$d is a page number.
+ return sprintf(_('Subscribers to list %1$s by %2$s, page %3$d'),
$this->peopletag->tag, $this->tagger->nickname,
$this->page);
}
}
- function handle($args)
+ function handle()
{
- parent::handle($args);
+ parent::handle();
$this->showPage();
}
$this->peopletag = $peopletag;
}
- function newListItem($profile)
+ function newListItem(Profile $profile)
{
return new PeopletagSubscriberListItem($profile, $this->peopletag, $this->action);
}