* @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)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if (empty($this->list)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
*
* @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()
- );
+ // 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()));
return;
}
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return array notices
*/
-
function getNotices()
{
$fn = array($this->list, 'getNotices');
*
* @return boolean true
*/
-
function isReadOnly($args)
{
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;
}
-
}