X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelinelist.php;h=75c9da034da347ad23a21628602d8eaeb741201d;hb=627d84a1e2db2aca5d2ce1272f6e83fb7faa8ad2;hp=f28eb59d534cbd7d3d0f5ee77aef7447d0d666e9;hpb=f47027abbefe35d17df50c67eec7cd1156a5e39a;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinelist.php b/actions/apitimelinelist.php index f28eb59d53..75c9da034d 100644 --- a/actions/apitimelinelist.php +++ b/actions/apitimelinelist.php @@ -35,7 +35,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiprivateauth.php'; require_once INSTALLDIR . '/lib/atomlistnoticefeed.php'; /** @@ -50,7 +49,6 @@ 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 { @@ -68,8 +66,7 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * @return boolean success flag * */ - - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); @@ -84,18 +81,15 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * 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(); @@ -107,7 +101,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * @return void */ - function showTimeline() { // We'll pull common formatting out of this for other formats @@ -145,7 +138,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction ); break; case 'atom': - header('Content-Type: application/atom+xml; charset=utf-8'); try { @@ -154,10 +146,9 @@ class ApiTimelineListAction extends ApiPrivateAuthAction $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; @@ -181,12 +172,8 @@ class ApiTimelineListAction extends ApiPrivateAuthAction $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); } } @@ -195,7 +182,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * @return array notices */ - function getNotices() { $fn = array($this->list, 'getNotices'); @@ -213,8 +199,7 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * @return boolean true */ - - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } @@ -224,7 +209,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * @return string datestamp of the latest notice in the stream */ - function lastModified() { if (!empty($this->notices) && (count($this->notices) > 0)) { @@ -242,7 +226,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction * * @return string etag */ - function etag() { if (!empty($this->notices) && (count($this->notices) > 0)) { @@ -262,5 +245,4 @@ class ApiTimelineListAction extends ApiPrivateAuthAction return null; } - }