Make favorites RSS actually work (uiredesign)

This commit is contained in:
Zach Copley 2009-01-27 15:27:04 -08:00
parent 4a176eadcb
commit 745f733469

View File

@ -44,22 +44,32 @@ require_once INSTALLDIR.'/lib/rssaction.php';
* @package Laconica * @package Laconica
* @author Evan Prodromou <evan@controlyourself.ca> * @author Evan Prodromou <evan@controlyourself.ca>
* @author Robin Millette <millette@controlyourself.ca> * @author Robin Millette <millette@controlyourself.ca>
* @author Zach Copley <zach@controlyourself.ca>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://laconi.ca/ * @link http://laconi.ca/
*/ */
class FavoritesrssAction extends Rss10Action class FavoritesrssAction extends Rss10Action
{ {
/** The user whose favorites to display */
var $user = null; var $user = null;
/** /**
* Initialization. * Find the user to display by supplied nickname
* *
* @return boolean false if user doesn't exist * @param array $args Arguments from $_REQUEST
*
* @return boolean success
*/ */
function init()
function prepare($args)
{ {
parent::prepare($args);
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
@ -94,30 +104,26 @@ class FavoritesrssAction extends Rss10Action
function getChannel() function getChannel()
{ {
$user = $this->user; $user = $this->user;
$c = array('url' => common_local_url('favoritesrss', $c = array('url' => common_local_url('favoritesrss',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
'title' => sprintf(_("%s favorite notices"), $user->nickname), 'title' => sprintf(_("%s favorite notices"), $user->nickname),
'link' => common_local_url('showfavorites', 'link' => common_local_url('showfavorites',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
'description' => sprintf(_('Feed of favorite notices of %s'), $user->nickname)); 'description' => sprintf(_('Feed of favorite notices of %s'),
$user->nickname));
return $c; return $c;
} }
/** /**
* Get image. * Get image.
* *
* @return voir * @return void
*/ */
function getImage() function getImage()
{ {
return null; return null;
} }
function isReadOnly()
{
return true;
}
} }