X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigrouplist.php;h=a3fc3fc43573eface1437988d14726234b6a02d8;hb=cc34bb48c7243f78e198ad4d8c1806d5fe886a81;hp=319a1e424d3c15285df9921ddcdb74a7f1d71fc4;hpb=8aa9c271dffe6ec6766b94486c0635c9db588db7;p=quix0rs-gnu-social.git diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 319a1e424d..a3fc3fc435 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -35,8 +35,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apibareauth.php'; - /** * Returns whether a user is a member of a specified group. * @@ -49,7 +47,6 @@ require_once INSTALLDIR . '/lib/apibareauth.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 ApiGroupListAction extends ApiBareAuthAction { var $groups = null; @@ -60,9 +57,7 @@ class ApiGroupListAction extends ApiBareAuthAction * @param array $args $_REQUEST args * * @return boolean success flag - * */ - function prepare($args) { parent::prepare($args); @@ -70,6 +65,7 @@ class ApiGroupListAction extends ApiBareAuthAction $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; } @@ -88,13 +84,12 @@ class ApiGroupListAction extends ApiBareAuthAction * * @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"; @@ -104,8 +99,8 @@ class ApiGroupListAction extends ApiBareAuthAction ); $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 ); @@ -134,13 +129,13 @@ class ApiGroupListAction extends ApiBareAuthAction break; default: $this->clientError( + // TRANS: Client error displayed when coming across a non-supported API method. _('API method not found.'), 404, $this->format ); break; } - } /** @@ -148,7 +143,6 @@ class ApiGroupListAction extends ApiBareAuthAction * * @return array groups */ - function getGroups() { $groups = array(); @@ -174,7 +168,6 @@ class ApiGroupListAction extends ApiBareAuthAction * * @return boolean true */ - function isReadOnly($args) { return true; @@ -203,7 +196,6 @@ class ApiGroupListAction extends ApiBareAuthAction * * @return string etag */ - function etag() { if (!empty($this->groups) && (count($this->groups) > 0)) { @@ -224,5 +216,4 @@ class ApiGroupListAction extends ApiBareAuthAction return null; } - }