X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigrouplist.php;h=3ea2c30cbb8e55e11522ee036745d4a8df76b801;hb=2260d6ec7c1f2b9c63196a4d8c6c99750a89eb10;hp=4cf657579d6e7dcbff85d99c8ec71ecd7dbd391a;hpb=26b03240271d061177a258dbae46bc384dbc9d6a;p=quix0rs-gnu-social.git diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 4cf657579d..3ea2c30cbb 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -66,7 +66,13 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::prepare($args); - $this->user = $this->getTargetUser($id); + $this->user = $this->getTargetUser(null); + + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); + return false; + } + $this->groups = $this->getGroups(); return true; @@ -86,23 +92,21 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::handle($args); - if (empty($this->user)) { - $this->clientError(_('No such user.'), 404, $this->format); - return; - } - $sitename = common_config('site', 'name'); + // TRANS: %s is a user name $title = sprintf(_("%s's groups"), $this->user->nickname); - $taguribase = common_config('integration', 'taguri'); + $taguribase = TagURI::base(); $id = "tag:$taguribase:Groups"; $link = common_local_url( 'usergroups', array('nickname' => $this->user->nickname) ); + $subtitle = sprintf( - _("Groups %1$s is a member of on %2$s."), - $this->user->nickname, - $sitename + // TRANS: Meant to convey the user %2$s is a member of each of the groups listed on site %1$s + _("%1\$s groups %2\$s is a member of."), + $sitename, + $this->user->nickname ); switch($this->format) { @@ -129,7 +133,7 @@ class ApiGroupListAction extends ApiBareAuthAction break; default: $this->clientError( - _('API method not found!'), + _('API method not found.'), 404, $this->format ); @@ -152,8 +156,7 @@ class ApiGroupListAction extends ApiBareAuthAction ($this->page - 1) * $this->count, $this->count, $this->since_id, - $this->max_id, - $this->since + $this->max_id ); while ($group->fetch()) {