X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffavoritesrss.php;h=6b46b8dec7ecf94b94667aa81173a907b66b9257;hb=b4e649fe906a793cd5e62d6390065ea5d41c40db;hp=ad72dce9e729c3ec88d67728adbb714ef8a90ba8;hpb=d06a929d703e0ad776230234b3d821a83f22d492;p=quix0rs-gnu-social.git diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index ad72dce9e7..6b46b8dec7 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -44,22 +44,32 @@ require_once INSTALLDIR.'/lib/rssaction.php'; * @package Laconica * @author Evan Prodromou * @author Robin Millette + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://laconi.ca/ */ class FavoritesrssAction extends Rss10Action { - var $user = null; + /** The user whose favorites to display */ + + var $user = null; + /** - * Initialization. - * - * @return boolean false if user doesn't exist + * Find the user to display by supplied nickname + * + * @param array $args Arguments from $_REQUEST + * + * @return boolean success */ - function init() + + function prepare($args) { + parent::prepare($args); + $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); + if (!$this->user) { $this->clientError(_('No such user.')); return false; @@ -67,7 +77,7 @@ class FavoritesrssAction extends Rss10Action return true; } } - + /** * Get notices * @@ -94,30 +104,26 @@ class FavoritesrssAction extends Rss10Action function getChannel() { $user = $this->user; - $c = array('url' => common_local_url('favoritesrss', - array('nickname' => - $user->nickname)), - 'title' => sprintf(_("%s favorite notices"), $user->nickname), + $c = array('url' => common_local_url('favoritesrss', + array('nickname' => + $user->nickname)), + 'title' => sprintf(_("%s's favorite notices"), $user->nickname), 'link' => common_local_url('showfavorites', - array('nickname' => - $user->nickname)), - 'description' => sprintf(_('Feed of favorite notices of %s'), $user->nickname)); + array('nickname' => + $user->nickname)), + 'description' => sprintf(_('Feed of favorite notices of %s'), + $user->nickname)); return $c; } /** * Get image. * - * @return voir + * @return void */ function getImage() { return null; } - function isReadOnly() - { - return true; - } } -