X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupshow.php;h=9a45d231a99e7fc94020e92499c4cb8cdeb0f68e;hb=4160a3fb730113f3d712bd777884c4b0482f6df1;hp=9b90e6b3832df6717c2ef7165f778defa9a55f9a;hpb=78ed0348b0eaaebf7a51d55adc7e746cc5b43bbf;p=quix0rs-gnu-social.git diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 9b90e6b383..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 * @@ -50,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiprivateauth.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 ApiGroupShowAction extends ApiPrivateAuthAction { var $group = null; @@ -61,17 +58,15 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * @param array $args $_REQUEST args * * @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')) ); @@ -79,11 +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( - _('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; } @@ -96,14 +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': @@ -113,8 +102,8 @@ class ApiGroupShowAction extends ApiPrivateAuthAction $this->showSingleJsonGroup($this->group); 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); } } @@ -123,7 +112,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * @return string datestamp of the latest notice in the stream */ - function lastModified() { if (!empty($this->group)) { @@ -141,7 +129,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * @return string etag */ - function etag() { if (!empty($this->group)) { @@ -169,10 +156,8 @@ class ApiGroupShowAction extends ApiPrivateAuthAction * * @return boolean is read only action? */ - - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } - }