X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigrouplist.php;h=319a1e424d3c15285df9921ddcdb74a7f1d71fc4;hb=78ed0348b0eaaebf7a51d55adc7e746cc5b43bbf;hp=66b67a030e0899bf3aceb60e6ae568d748d6af59;hpb=15b88697a7c182faead1bbddfe38b59fdc54a0a2;p=quix0rs-gnu-social.git diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 66b67a030e..319a1e424d 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -26,6 +26,7 @@ * @author Jeffery To * @author Zach Copley * @copyright 2009 StatusNet, Inc. + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -66,7 +67,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 +93,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) { @@ -152,8 +157,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()) { @@ -209,6 +213,7 @@ class ApiGroupListAction extends ApiBareAuthAction return '"' . implode( ':', array($this->arg('action'), + common_user_cache_hash($this->auth_user), common_language(), $this->user->id, strtotime($this->groups[0]->created),