X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupshow.php;h=9a45d231a99e7fc94020e92499c4cb8cdeb0f68e;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=471aa141f9c1684cfa814eddcfbe6e45a51b0e8c;hpb=c4b8f68a1a3ed6422a2ed1cb7a8b5b5c65011b5f;p=quix0rs-gnu-social.git diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 471aa141f9..9a45d231a9 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -35,8 +35,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiprivateauth.php'; - /** * Outputs detailed information about the group specified by ID * @@ -61,14 +59,14 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * @return boolean success flag */ - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); $this->group = $this->getTargetGroup($this->arg('id')); if (empty($this->group)) { - $alias = Group_alias::staticGet( + $alias = Group_alias::getKV( 'alias', common_canonical_nickname($this->arg('id')) ); @@ -76,12 +74,8 @@ class ApiGroupShowAction extends ApiPrivateAuthAction $args = array('id' => $alias->group_id, 'format' => $this->format); common_redirect(common_local_url('ApiGroupShow', $args), 301); } else { - $this->clientError( - // TRANS: Client error displayed when trying to show a group that could not be found. - _('Group not found.'), - 404, - $this->format - ); + // TRANS: Client error displayed when trying to show a group that could not be found. + $this->clientError(_('Group not found.'), 404); } return; } @@ -94,13 +88,11 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * Check the format and show the user info * - * @param array $args $_REQUEST data (unused) - * * @return void */ - function handle($args) + protected function handle() { - parent::handle($args); + parent::handle(); switch($this->format) { case 'xml': @@ -110,9 +102,8 @@ class ApiGroupShowAction extends ApiPrivateAuthAction $this->showSingleJsonGroup($this->group); break; default: - // TRANS: Client error displayed trying to execute an unknown API method showing a group. - $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); } } @@ -165,7 +156,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; }