* update/add translator documentation

* remove superfluous whitespace
This commit is contained in:
Siebrand Mazeland 2010-09-13 00:57:35 +02:00
parent 8c94ebf537
commit 39802077a8
6 changed files with 10 additions and 45 deletions

View File

@ -30,7 +30,7 @@
* @author Evan Prodromou <evan@status.net> * @author Evan Prodromou <evan@status.net>
* @author mEDI <medi@milaro.net> * @author mEDI <medi@milaro.net>
* @author Sarven Capadisli <csarven@status.net> * @author Sarven Capadisli <csarven@status.net>
* @author Zach Copley <zach@status.net> * @author Zach Copley <zach@status.net>
* @copyright 2009 StatusNet, Inc. * @copyright 2009 StatusNet, Inc.
* @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@ -60,7 +60,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ApiBareAuthAction extends ApiAuthAction class ApiBareAuthAction extends ApiAuthAction
{ {
@ -72,7 +71,6 @@ class ApiBareAuthAction extends ApiAuthAction
* @return boolean success flag * @return boolean success flag
* *
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -84,18 +82,15 @@ class ApiBareAuthAction extends ApiAuthAction
* *
* @return boolean true or false * @return boolean true or false
*/ */
function requiresAuth() function requiresAuth()
{ {
// If the site is "private", all API methods except statusnet/config // If the site is "private", all API methods except statusnet/config
// need authentication // need authentication
if (common_config('site', 'private')) { if (common_config('site', 'private')) {
return true; return true;
} }
// check whether a user has been specified somehow // check whether a user has been specified somehow
$id = $this->arg('id'); $id = $this->arg('id');
$user_id = $this->arg('user_id'); $user_id = $this->arg('user_id');
$screen_name = $this->arg('screen_name'); $screen_name = $this->arg('screen_name');
@ -106,5 +101,4 @@ class ApiBareAuthAction extends ApiAuthAction
return false; return false;
} }
} }

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR . '/lib/apioauthstore.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ApiOauthAction extends Action class ApiOauthAction extends Action
{ {
/** /**
@ -52,7 +51,6 @@ class ApiOauthAction extends Action
* *
* @return boolean false * @return boolean false
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return false; return false;
@ -73,7 +71,6 @@ class ApiOauthAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -83,7 +80,6 @@ class ApiOauthAction extends Action
static function cleanRequest() static function cleanRequest()
{ {
// kill evil effects of magical slashing // kill evil effects of magical slashing
if (get_magic_quotes_gpc() == 1) { if (get_magic_quotes_gpc() == 1) {
$_POST = array_map('stripslashes', $_POST); $_POST = array_map('stripslashes', $_POST);
$_GET = array_map('stripslashes', $_GET); $_GET = array_map('stripslashes', $_GET);
@ -93,7 +89,6 @@ class ApiOauthAction extends Action
// XXX: should we strip anything else? Or alternatively // XXX: should we strip anything else? Or alternatively
// only allow a known list of params? // only allow a known list of params?
unset($_GET['p']); unset($_GET['p']);
unset($_POST['p']); unset($_POST['p']);
} }
@ -118,5 +113,4 @@ class ApiOauthAction extends Action
return ($url . '&' . $k . '=' . $v); return ($url . '&' . $k . '=' . $v);
} }
} }
} }

View File

@ -23,7 +23,6 @@ require_once INSTALLDIR . '/lib/oauthstore.php';
class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
{ {
function lookup_consumer($consumer_key) function lookup_consumer($consumer_key)
{ {
$con = Consumer::staticGet('consumer_key', $consumer_key); $con = Consumer::staticGet('consumer_key', $consumer_key);
@ -39,7 +38,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
function getAppByRequestToken($token_key) function getAppByRequestToken($token_key)
{ {
// Look up the full req tokenx // Look up the full req tokenx
$req_token = $this->lookup_token(null, $req_token = $this->lookup_token(null,
'request', 'request',
$token_key); $token_key);
@ -50,7 +48,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
} }
// Look up the full Token // Look up the full Token
$token = new Token(); $token = new Token();
$token->tok = $req_token->key; $token->tok = $req_token->key;
$result = $token->find(true); $result = $token->find(true);
@ -150,7 +147,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
} }
// Okay, good // Okay, good
return new OAuthToken($at->tok, $at->secret); return new OAuthToken($at->tok, $at->secret);
} }
@ -172,19 +168,18 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
* *
* @return void * @return void
*/ */
public function revoke_token($token_key, $type = 0) { public function revoke_token($token_key, $type = 0) {
$rt = new Token(); $rt = new Token();
$rt->tok = $token_key; $rt->tok = $token_key;
$rt->type = $type; $rt->type = $type;
$rt->state = 0; $rt->state = 0;
if (!$rt->find(true)) { if (!$rt->find(true)) {
throw new Exception('Tried to revoke unknown token'); // TRANS: Exception thrown when an attempt is made to revoke an unknown token.
throw new Exception(_('Tried to revoke unknown token'));
} }
if (!$rt->delete()) { if (!$rt->delete()) {
throw new Exception('Failed to delete revoked token'); // TRANS: Exception thrown when an attempt is made to remove a revoked token.
throw new Exception(_('Failed to delete revoked token'));
} }
} }
} }

View File

@ -29,7 +29,7 @@
* @author Evan Prodromou <evan@status.net> * @author Evan Prodromou <evan@status.net>
* @author mEDI <medi@milaro.net> * @author mEDI <medi@milaro.net>
* @author Sarven Capadisli <csarven@status.net> * @author Sarven Capadisli <csarven@status.net>
* @author Zach Copley <zach@status.net> * @author Zach Copley <zach@status.net>
* @copyright 2009 StatusNet, Inc. * @copyright 2009 StatusNet, Inc.
* @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@ -58,26 +58,21 @@ require_once INSTALLDIR.'/lib/apiauth.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ApiPrivateAuthAction extends ApiAuthAction class ApiPrivateAuthAction extends ApiAuthAction
{ {
/** /**
* Does this API resource require authentication? * Does this API resource require authentication?
* *
* @return boolean true or false * @return boolean true or false
*/ */
function requiresAuth() function requiresAuth()
{ {
// If the site is "private", all API methods except statusnet/config // If the site is "private", all API methods except statusnet/config
// need authentication // need authentication
if (common_config('site', 'private')) { if (common_config('site', 'private')) {
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -43,13 +43,11 @@ require_once INSTALLDIR . '/lib/form.php';
* @link http://status.net/ * @link http://status.net/
* *
*/ */
class ApplicationEditForm extends Form class ApplicationEditForm extends Form
{ {
/** /**
* group for user to join * group for user to join
*/ */
var $application = null; var $application = null;
/** /**
@ -58,7 +56,6 @@ class ApplicationEditForm extends Form
* @param Action $out output channel * @param Action $out output channel
* @param User_group $group group to join * @param User_group $group group to join
*/ */
function __construct($out=null, $application=null) function __construct($out=null, $application=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -71,7 +68,6 @@ class ApplicationEditForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
if ($this->application) { if ($this->application) {
@ -89,7 +85,6 @@ class ApplicationEditForm extends Form
* *
* @return string the method to use for submitting * @return string the method to use for submitting
*/ */
function method() function method()
{ {
$this->enctype = 'multipart/form-data'; $this->enctype = 'multipart/form-data';
@ -101,7 +96,6 @@ class ApplicationEditForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_settings'; return 'form_settings';
@ -112,7 +106,6 @@ class ApplicationEditForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
$cur = common_current_user(); $cur = common_current_user();
@ -130,7 +123,6 @@ class ApplicationEditForm extends Form
* *
* @return void * @return void
*/ */
function formLegend() function formLegend()
{ {
// TRANS: Form legend. // TRANS: Form legend.
@ -142,7 +134,6 @@ class ApplicationEditForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
if ($this->application) { if ($this->application) {
@ -350,16 +341,15 @@ class ApplicationEditForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
// TRANS: Button label // TRANS: Button label in the "Edit application" form.
$this->out->submit('cancel', _m('BUTTON','Cancel'), 'submit form_action-primary', $this->out->submit('cancel', _m('BUTTON','Cancel'), 'submit form_action-primary',
// TRANS: Submit button title // TRANS: Submit button title.
'cancel', _('Cancel')); 'cancel', _('Cancel'));
// TRANS: Button label // TRANS: Button label in the "Edit application" form.
$this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary', $this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary',
// TRANS: Submit button title // TRANS: Submit button title.
'save', _('Save')); 'save', _('Save'));
} }
} }

View File

@ -45,7 +45,6 @@ define('APPS_PER_PAGE', 20);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ApplicationList extends Widget class ApplicationList extends Widget
{ {
/** Current application, application query */ /** Current application, application query */
@ -164,10 +163,8 @@ class ApplicationList extends Widget
} }
/* Override this in subclasses. */ /* Override this in subclasses. */
function showOwnerControls() function showOwnerControls()
{ {
return; return;
} }
} }