exit(1);
}
-require_once INSTALLDIR . '/lib/apiprivateauth.php';
require_once INSTALLDIR . '/lib/atomlistnoticefeed.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 ApiTimelineListAction extends ApiPrivateAuthAction
{
* @return boolean success flag
*
*/
-
- function prepare($args)
+ protected function prepare(array $args=array())
{
parent::prepare($args);
*
* Just show the notices
*
- * @param array $args $_REQUEST data (unused)
- *
* @return void
*/
-
- function handle($args)
+ protected function handle()
{
- parent::handle($args);
+ parent::handle();
if (empty($this->list)) {
- $this->clientError(_('List not found.'), 404, $this->format);
- return false;
+ // TRANS: Client error displayed trying to perform an action related to a non-existing list.
+ $this->clientError(_('List not found.'), 404);
}
$this->getNotices();
*
* @return void
*/
-
function showTimeline()
{
// We'll pull common formatting out of this for other formats
);
break;
case 'atom':
-
header('Content-Type: application/atom+xml; charset=utf-8');
try {
$atom->addEntryFromNotices($this->notices);
$this->raw($atom->getString());
} catch (Atom10FeedException $e) {
- $this->serverError(
- 'Could not generate feed for list - ' . $e->getMessage()
- );
- return;
+ // TRANS: Server error displayed whe trying to get a timeline fails.
+ // TRANS: %s is the error message.
+ $this->serverError(sprintf(_('Could not generate feed for list - %s'), $e->getMessage()));
}
break;
$this->initDocument('json');
break;
default:
- $this->clientError(
- _('API method not found.'),
- 404,
- $this->format
- );
- break;
+ // TRANS: Client error displayed when coming across a non-supported API method.
+ $this->clientError(_('API method not found.'), 404);
}
}
*
* @return array notices
*/
-
function getNotices()
{
$fn = array($this->list, 'getNotices');
*
* @return boolean true
*/
-
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return string datestamp of the latest notice in the stream
*/
-
function lastModified()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
return null;
}
-
}