* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiGroupListAction extends ApiBareAuthAction
{
var $groups = null;
* @param array $args $_REQUEST args
*
* @return boolean success flag
- *
*/
-
function prepare($args)
{
parent::prepare($args);
$this->user = $this->getTargetUser(null);
if (empty($this->user)) {
+ // TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
$sitename = common_config('site', 'name');
- // TRANS: %s is a user name
+ // TRANS: Used as title in check for group membership. %s is a user name.
$title = sprintf(_("%s's groups"), $this->user->nickname);
$taguribase = TagURI::base();
$id = "tag:$taguribase:Groups";
);
$subtitle = sprintf(
- // 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."),
+ // TRANS: Used as subtitle in check for group membership. %1$s is the site name, %2$s is a user name.
+ _('%1$s groups %2$s is a member of.'),
$sitename,
$this->user->nickname
);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
);
break;
}
-
}
/**
*
* @return array groups
*/
-
function getGroups()
{
$groups = array();
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->groups) && (count($this->groups) > 0)) {
return '"' . implode(
':',
array($this->arg('action'),
+ common_user_cache_hash($this->auth_user),
common_language(),
$this->user->id,
strtotime($this->groups[0]->created),
return null;
}
-
}