X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffoafgroup.php;h=a9cf5d9dc0964e7fe01049c82030a3829ef85609;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=ebdf1cee2567555748fe04e9423203f4f1a7131b;hpb=b7037a49af97db73b3adc77d3f78ffb0805c7c68;p=quix0rs-gnu-social.git diff --git a/actions/foafgroup.php b/actions/foafgroup.php index ebdf1cee25..a9cf5d9dc0 100644 --- a/actions/foafgroup.php +++ b/actions/foafgroup.php @@ -27,22 +27,23 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +// @todo XXX: Documentation missing. class FoafGroupAction extends Action { - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); $nickname_arg = $this->arg('nickname'); if (empty($nickname_arg)) { + // TRANS: Client error displayed when requesting Friends of a Friend feed without providing a group nickname. $this->clientError(_('No such group.'), 404); - return false; } $this->nickname = common_canonical_nickname($nickname_arg); @@ -56,18 +57,18 @@ class FoafGroupAction extends Action return false; } - $local = Local_group::staticGet('nickname', $nickname); + $local = Local_group::getKV('nickname', $this->nickname); if (!$local) { + // TRANS: Client error displayed when requesting Friends of a Friend feed for a non-local group. $this->clientError(_('No such group.'), 404); - return false; } - $this->group = User_group::staticGet('id', $local->group_id); + $this->group = User_group::getKV('id', $local->group_id); if (!$this->group) { + // TRANS: Client error displayed when requesting Friends of a Friend feed for a nickname that is not a group. $this->clientError(_('No such group.'), 404); - return false; } common_set_returnto($this->selfUrl()); @@ -75,7 +76,7 @@ class FoafGroupAction extends Action return true; } - function handle($args) + function handle(array $args=array()) { parent::handle($args); @@ -126,7 +127,8 @@ class FoafGroupAction extends Action while ($members->fetch()) { $member_uri = common_local_url('userbyid', array('id'=>$members->id)); $member_details[$member_uri] = array( - 'nickname' => $members->nickname + 'nickname' => $members->nickname, + 'is_admin' => false, ); $this->element('member', array('rdf:resource' => $member_uri)); } @@ -146,7 +148,7 @@ class FoafGroupAction extends Action { $this->elementStart('Agent', array('rdf:about' => $uri)); $this->element('nick', null, $details['nickname']); - $this->elementStart('holdsAccount'); + $this->elementStart('account'); $this->elementStart('sioc:User', array('rdf:about'=>$uri.'#acct')); $this->elementStart('sioc:has_function'); $this->elementStart('statusnet:GroupAdminRole'); @@ -154,7 +156,7 @@ class FoafGroupAction extends Action $this->elementEnd('statusnet:GroupAdminRole'); $this->elementEnd('sioc:has_function'); $this->elementEnd('sioc:User'); - $this->elementEnd('holdsAccount'); + $this->elementEnd('account'); $this->elementEnd('Agent'); } else @@ -177,4 +179,4 @@ class FoafGroupAction extends Action $this->elementEnd('Document'); } -} \ No newline at end of file +}