L10n/i18n fixes.
Update whitespace.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class NoticeTitlePlugin extends Plugin
{
*
* @return boolean hook value; true means continue processing, false means stop.
*/
-
function onCheckSchema()
{
$schema = Schema::get();
*
* @return boolean hook value; true means continue processing, false means stop.
*/
-
function onAutoload($cls)
{
$dir = dirname(__FILE__);
*
* @return boolean hook value
*/
-
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:NoticeTitle';
'author' => 'Evan Prodromou',
'homepage' => $url,
'rawdescription' =>
+ // TRANS: Plugin description.
_m('Adds optional titles to notices.'));
return true;
}
*
* @return boolean hook value
*/
-
function onStartShowNoticeFormData($form)
{
if ($this->isAllowedRichEdit()) {
*
* @return boolean hook value
*/
-
function onStartNoticeSaveWeb($action, &$authorId, &$text, &$options)
{
$title = $action->trimmed('notice_title');
if (!empty($title) && $this->isAllowedRichEdit()) {
if (mb_strlen($title) > Notice_title::MAXCHARS) {
- throw new Exception(sprintf(_m("The notice title is too long (max %d characters).",
- Notice_title::MAXCHARS)));
+ // TRANS: Exception thrown when a notice title is too long.
+ // TRANS: %d is the maximum number of characters allowed in a title (used for plural).
+ throw new Exception(sprintf(_m('The notice title is too long (maximum %d character).',
+ 'The notice title is too long (maximum %d characters).',
+ Notice_title::MAXCHARS),
+ Notice_title::MAXCHARS));
}
}
return true;
*
* @return boolean hook value
*/
-
function onEndNoticeSaveWeb($action, $notice)
{
if (!empty($notice)) {
*
* @return boolean hook value
*/
-
function onStartShowNoticeItem($nli)
{
$title = Notice_title::fromNotice($nli->notice);
*
* @return boolean hook value
*/
-
function onEndRssEntryArray($notice, &$entry)
{
$title = Notice_title::fromNotice($notice);
*
* @return boolean hook value
*/
-
function onEndNoticeAsActivity($notice, &$activity)
{
$title = Notice_title::fromNotice($notice);
*
* @return boolean hook value
*/
-
function onNoticeDeleteRelated($notice)
{
$nt = Notice_title::staticGet('notice_id', $notice->id);
*
* @return boolean hook value
*/
-
function onStartShowHeadTitle($action)
{
$actionName = $action->trimmed('action');
*
* @return boolean hook value
*/
-
function onStartShowPageTitle($action)
{
$actionName = $action->trimmed('action');
* Always true unless the plugin's "restricted" setting is on, in which
* case it's limited to users with the "richedit" role.
*
- * @fixme make that more sanely configurable :)
+ * @todo FIXME: make that more sanely configurable :)
*
* @return boolean
*/
return true;
}
}
-
}
*
* @see DB_DataObject
*/
-
class Notice_title extends Memcached_DataObject
{
const MAXCHARS = 255;
* @return Notice_title object found, or null for no hits
*
*/
-
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Notice_title', $k, $v);
*
* @return array array of column definitions
*/
-
function table()
{
return array('notice_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
*
* @return array list of key field names
*/
-
function keys()
{
return array_keys($this->keyTypes());
*
* @return array list mapping field names to key types
*/
-
function keyTypes()
{
return array('notice_id' => 'K');
*
* @return array magic three-false array that stops auto-incrementing.
*/
-
function sequenceKey()
{
return array(false, false, false);
*
* @return string title of the notice, or null if none
*/
-
static function fromNotice($notice)
{
$nt = Notice_title::staticGet('notice_id', $notice->id);
'author' => 'Sarven Capadisli',
'homepage' => 'http://status.net/wiki/Plugin:OpenExternalLinkTarget',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('Opens external links (i.e. with rel=external) on a new window or tab.'));
return true;
}
common_redirect(common_local_url('openidsettings'));
exit(0);
} else if ($action == 'recoverpassword') {
- throw new ClientException('Unavailable action');
+ throw new ClientException('Unavailable action.');
}
}
}
{
if (common_config('site', 'openidonly') && !common_logged_in()) {
// TRANS: Tooltip for main menu option "Login"
- $tooltip = _m('TOOLTIP', 'Login to the site');
+ $tooltip = _m('TOOLTIP', 'Login to the site.');
$action->menuItem(common_local_url('openidlogin'),
// TRANS: Main menu option when not logged in to log in
_m('MENU', 'Login'),
'nav_help');
if (!common_config('site', 'private')) {
// TRANS: Tooltip for main menu option "Search"
- $tooltip = _m('TOOLTIP', 'Search for people or text');
+ $tooltip = _m('TOOLTIP', 'Search for people or text.');
$action->menuItem(common_local_url('peoplesearch'),
// TRANS: Main menu option when logged in or when the StatusNet instance is not private
_m('MENU', 'Search'), $tooltip, false, 'nav_search');
// TRANS: OpenID plugin menu item on site logon page.
_m('MENU', 'OpenID'),
// TRANS: OpenID plugin tooltip for logon menu item.
- _m('Login or register with OpenID'),
+ _m('Login or register with OpenID.'),
$action_name === 'openidlogin');
}
// TRANS: OpenID plugin menu item on user settings page.
_m('MENU', 'OpenID'),
// TRANS: OpenID plugin tooltip for user settings menu item.
- _m('Add or remove OpenIDs'),
+ _m('Add or remove OpenIDs.'),
$action_name === 'openidsettings');
return true;
function onEndLoadDoc($title, &$output)
{
if ($title == 'help') {
- $menuitem = '* [OpenID](%%doc.openid%%) - what OpenID is and how to use it with this service';
+ // TRANS: Item on help page. This message contains Markdown links in the form [description](link).
+ $menuitem = _m('* [OpenID](%%doc.openid%%) - What OpenID is and how to use it with this service.');
$output .= common_markup_to_html($menuitem);
}
// TRANS: OpenID configuration menu item.
_m('MENU','OpenID'),
// TRANS: Tooltip for OpenID configuration menu item.
- _m('OpenID configuration'),
+ _m('OpenID configuration.'),
$action_name == 'openidadminpanel',
'nav_openid_admin_panel'
);
'author' => 'Evan Prodromou, Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:OpenID',
'rawdescription' =>
- // TRANS: OpenID plugin description.
+ // TRANS: Plugin description.
_m('Use <a href="http://openid.net/">OpenID</a> to login to the site.'));
return true;
}
{
$action->elementStart('fieldset');
// TRANS: OpenID plugin logon form legend.
- $action->element('legend', null, _m('OpenID login'));
+ $action->element('legend', null, _m('LEGEND','OpenID login'));
$action->elementStart('ul', 'form_data');
$action->elementStart('li');
$action->input('openid_url', _m('OpenID URL'),
'',
// TRANS: OpenID plugin logon form field instructions.
- _m('Your OpenID URL'));
+ _m('Your OpenID URL.'));
}
$action->elementEnd('li');
$action->elementEnd('ul');
/**
* Add link in user's XRD file to allow OpenID login.
- *
+ *
* This link in the XRD should let users log in with their
* Webfinger identity to services that support it. See
* http://webfinger.org/login for an example.
*
* @param XRD &$xrd Currently-displaying XRD object
* @param User $user The user that it's for
- *
+ *
* @return boolean hook value (always true)
*/
function onEndXrdActionLinks(&$xrd, $user)
{
$profile = $user->getProfile();
-
+
if (!empty($profile)) {
$xrd->links[] = array('rel' => 'http://specs.openid.net/auth/2.0/provider',
'href' => $profile->profileurl);
}
-
+
return true;
}
}
function table()
{
-
$db = $this->getDatabaseConnection();
$dbtype = $db->phptype; // Database type is stored here. Crazy but true.
{
return array('trustroot' => 'K', 'user_id' => 'K');
}
-
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class FinishaddopenidAction extends Action
{
var $msg = null;
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
*
* @return void
*/
-
function tryLogin()
{
$consumer = oid_consumer();
} else if ($response->status == Auth_OpenID_FAILURE) {
// TRANS: OpenID authentication failed; display the error message.
// TRANS: %s is the error message.
- $this->message(sprintf(_m('OpenID authentication failed: %s'),
+ $this->message(sprintf(_m('OpenID authentication failed: %s.'),
$response->message));
} else if ($response->status == Auth_OpenID_SUCCESS) {
// Launchpad teams extension
if (!oid_check_teams($response)) {
- $this->message(_m('OpenID authentication aborted: you are not allowed to login to this site.'));
+ // TRANS: OpenID authentication error.
+ $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.'));
return;
}
if ($other) {
if ($other->id == $cur->id) {
- // TRANS: message in case a user tries to add an OpenID that is already connected to them.
+ // TRANS: Message in case a user tries to add an OpenID that is already connected to them.
$this->message(_m('You already have this OpenID!'));
} else {
- // TRANS: message in case a user tries to add an OpenID that is already used by another user.
+ // TRANS: Message in case a user tries to add an OpenID that is already used by another user.
$this->message(_m('Someone else already has this OpenID.'));
}
return;
$result = oid_link_user($cur->id, $canonical, $display);
if (!$result) {
- // TRANS: message in case the OpenID object cannot be connected to the user.
+ // TRANS: Message in case the OpenID object cannot be connected to the user.
$this->message(_m('Error connecting user.'));
return;
}
if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) {
if ($sreg) {
if (!oid_update_user($cur, $sreg)) {
- // TRANS: message in case the user or the user profile cannot be saved in StatusNet.
- $this->message(_m('Error updating profile'));
+ // TRANS: Message in case the user or the user profile cannot be saved in StatusNet.
+ $this->message(_m('Error updating profile.'));
return;
}
}
*
* @return void
*/
-
function message($msg)
{
$this->message = $msg;
*
* @return string title
*/
-
function title()
{
// TRANS: Title after getting the status of the OpenID authorisation request.
*
* @return void
*/
-
function showPageNotice()
{
if ($this->message) {
if ($this->arg('create')) {
if (!$this->boolean('license')) {
// TRANS: Message given if user does not agree with the site's license.
- $this->showForm(_m('You can\'t register if you don\'t agree to the license.'),
+ $this->showForm(_m('You cannot register if you do not agree to the license.'),
$this->trimmed('newname'));
return;
}
$this->element('div', 'instructions',
// TRANS: Instructions given after a first successful logon using OpenID.
// TRANS: %s is the site name.
- sprintf(_m('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
+ sprintf(_m('This is the first time you have logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
}
}
function title()
{
// TRANS: Title
- return _m('OpenID Account Setup');
+ return _m('TITLE','OpenID Account Setup');
}
function showForm($error=null, $username=null)
$this->hidden('token', common_session_token());
$this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
$this->element('legend', null,
+ // TRANS: Fieldset legend.
_m('Create new account'));
$this->element('p', null,
+ // TRANS: Form guide.
_m('Create a new user with this nickname.'));
$this->elementStart('ul', 'form_data');
Event::handle('StartRegistrationFormData', array($this));
$this->elementStart('li');
+ // TRANS: Field label.
$this->input('newname', _m('New nickname'),
($this->username) ? $this->username : '',
+ // TRANS: Field title.
_m('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->elementEnd('li');
$this->elementStart('li');
+ // TRANS: Field label.
$this->input('email', _m('Email'), $this->getEmail(),
+ // TRANS: Field title.
_m('Used only for updates, announcements, '.
'and password recovery.'));
$this->elementEnd('li');
$this->elementStart('label', array('for' => 'license',
'class' => 'checkbox'));
// TRANS: OpenID plugin link text.
- // TRANS: %s is a link to a licese with the license name as link text.
+ // TRANS: %s is a link to a license with the license name as link text.
$message = _m('My text and files are available under %s ' .
'except this private data: password, ' .
'email address, IM address, and phone number.');
$this->password('password', _m('Password'));
$this->elementEnd('li');
$this->elementEnd('ul');
- // TRANS: Button label in form in which to connect an OpenID to an existing user on the site.
+ // TRANS: Button text in form in which to connect an OpenID to an existing user on the site.
$this->submit('connect', _m('BUTTON', 'Connect'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
return;
} else if ($response->status == Auth_OpenID_FAILURE) {
// TRANS: OpenID authentication failed; display the error message. %s is the error message.
- $this->message(sprintf(_m('OpenID authentication failed: %s'), $response->message));
+ $this->message(sprintf(_m('OpenID authentication failed: %s.'), $response->message));
} else if ($response->status == Auth_OpenID_SUCCESS) {
// This means the authentication succeeded; extract the
// identity URL and Simple Registration data (if it was
// Launchpad teams extension
if (!oid_check_teams($response)) {
- $this->message(_m('OpenID authentication aborted: you are not allowed to login to this site.'));
+ // TRANS: Message displayed when OpenID authentication is aborted.
+ $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.'));
return;
}
function bestNewNickname($display, $sreg)
{
-
// Try the passed-in nickname
if (!empty($sreg['nickname'])) {
// 1. Plain hostname, like http://evanp.myopenid.com/
// 2. One element in path, like http://profile.typekey.com/EvanProdromou/
// or http://getopenid.com/evanprodromou
-
function urlToNickname($openid)
{
return common_url_to_nickname($openid);
}
// Given a string, try to make it work as a nickname
-
function nicknamize($str)
{
return common_nicknamize($str);
function oid_link_user($id, $canonical, $display)
{
-
$oid = new User_openid();
$oid->user_id = $id;
$oid->canonical = $canonical;
common_log(LOG_ERR, __METHOD__ . ": OpenID fail to $openid_url: $auth_request->message");
// TRANS: OpenID plugin server error. Given when the OpenID authentication request fails.
// TRANS: %s is the failure message.
- return sprintf(_m('OpenID failure: %s'), $auth_request->message);
+ return sprintf(_m('OpenID failure: %s.'), $auth_request->message);
}
$sreg_request = Auth_OpenID_SRegRequest::build(// Required
} else if (Auth_OpenID::isFailure($redirect_url)) {
// TRANS: OpenID plugin server error. Given when the OpenID authentication request cannot be redirected.
// TRANS: %s is the failure message.
- return sprintf(_m('Could not redirect to server: %s'), $redirect_url->message);
+ return sprintf(_m('Could not redirect to server: %s.'), $redirect_url->message);
} else {
common_redirect($redirect_url, 303);
}
}
}
// TRANS: OpenID plugin client exception (403).
- throw new ClientException(_m("Unauthorized URL used for OpenID login."), 403);
+ throw new ClientException(_m('Unauthorized URL used for OpenID login.'), 403);
}
}
function showContent()
{
$this->raw('<p style="margin: 20px 80px">');
- // @fixme this would be better using standard CSS class, but the present theme's a bit scary.
+ // @todo FIXME: This would be better using standard CSS class, but the present theme's a bit scary.
$this->element('img', array('src' => Theme::path('images/icons/icon_processing.gif', 'base'),
// for some reason the base CSS sets <img>s as block display?!
'style' => 'display: inline'));
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class OpenidadminpanelAction extends AdminPanelAction
{
/**
*
* @return string page title
*/
-
function title()
{
- return _m('OpenID');
+ // TRANS: Title for OpenID bridge administration page.
+ return _m('TITLE','OpenID Settings');
}
/**
*
* @return string instructions
*/
-
function getInstructions()
{
+ // TRANS: Page instructions.
return _m('OpenID settings');
}
*
* @return void
*/
-
function showForm()
{
$form = new OpenIDAdminPanelForm($this);
*
* @return void
*/
-
function saveSettings()
{
static $settings = array(
if (mb_strlen($values['openid']['trusted_provider']) > 255) {
$this->clientError(
- _m("Invalid provider URL. Max length is 255 characters.")
+ // TRANS: Client error displayed when OpenID provider URL is too long.
+ _m('Invalid provider URL. Maximum length is 255 characters.')
);
}
if (mb_strlen($values['openid']['required_team']) > 255) {
$this->clientError(
- _m("Invalid team name. Max length is 255 characters.")
+ // TRANS: Client error displayed when Launchpad team name is too long.
+ _m('Invalid team name. Maximum length is 255 characters.')
);
}
}
*
* @return int ID of the form
*/
-
function id()
{
return 'openidadminpanel';
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_settings';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('openidadminpanel');
* Make sure that the acting administrator has a valid OpenID matching,
* or more carefully warn folks.
*/
-
function formData()
{
$this->out->elementStart(
'fieldset',
array('id' => 'settings_openid')
);
- $this->out->element('legend', null, _m('Trusted provider'));
+ // TRANS: Fieldset legend.
+ $this->out->element('legend', null, _m('LEGEND','Trusted provider'));
$this->out->element('p', 'form_guide',
+ // TRANS: Form guide.
_m('By default, users are allowed to authenticate with any OpenID provider. ' .
'If you are using your own OpenID service for shared sign-in, ' .
'you can restrict access to only your own users here.'));
$this->li();
$this->input(
'trusted_provider',
+ // TRANS: Field label.
_m('Provider URL'),
+ // TRANS: Field title.
_m('All OpenID logins will be sent to this URL; other providers may not be used.'),
'openid'
);
$this->li();
$this->out->checkbox(
+ // TRANS: Checkbox label.
'append_username', _m('Append a username to base URL'),
(bool) $this->value('append_username', 'openid'),
+ // TRANS: Checkbox title.
_m('Login form will show the base URL and prompt for a username to add at the end. Use when OpenID provider URL should be the profile page for individual users.'),
'true'
);
$this->li();
$this->input(
'required_team',
- _m('Required team'),
+ // TRANS: Field label.
+ _m('Required team'),
+ // TRANS: Field title.
_m('Only allow logins from users in the given team (Launchpad extension).'),
'openid'
);
'fieldset',
array('id' => 'settings_openid-options')
);
- $this->out->element('legend', null, _m('Options'));
+ // TRANS: Fieldset legend.
+ $this->out->element('legend', null, _m('LEGEND','Options'));
$this->out->elementStart('ul', 'form_data');
$this->li();
$this->out->checkbox(
+ // TRANS: Checkbox label.
'openidonly', _m('Enable OpenID-only mode'),
(bool) $this->value('openidonly', 'site'),
+ // TRANS: Checkbox title.
_m('Require all users to login via OpenID. Warning: disables password authentication for all users!'),
'true'
);
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _m('Save'), 'submit', null, _m('Save OpenID settings.'));
+ // TRANS: Button text to save OpenID settings.
+ $this->out->submit('submit', _m('BUTTON','Save'), 'submit', null,
+ // TRANS: Button title to save OpenID settings.
+ _m('Save OpenID settings.'));
}
}
function title()
{
// TRANS: OpenID plugin message. Title.
- return _m('OpenID Login');
+ return _m('TITLE','OpenID Login');
}
function showForm($error=null, $openid_url)
'action' => $formaction));
$this->elementStart('fieldset');
// TRANS: OpenID plugin logon form legend.
- $this->element('legend', null, _m('OpenID login'));
+ $this->element('legend', null, _m('LEGEND','OpenID login'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$provider = common_config('openid', 'trusted_provider');
$appendUsername = common_config('openid', 'append_username');
if ($provider) {
- $this->element('label', array(), _m('OpenID provider'));
+ $this->element('label', array(), _m('LABEL','OpenID provider'));
$this->element('span', array(), $provider);
if ($appendUsername) {
$this->element('input', array('id' => 'openid_username',
'style' => 'float: none'));
}
$this->element('p', 'form_guide',
+ // TRANS: Form guide.
($appendUsername ? _m('Enter your username.') . ' ' : '') .
+ // TRANS: Form guide.
_m('You will be sent to the provider\'s site for authentication.'));
$this->hidden('openid_url', $provider);
} else {
// TRANS: OpenID plugin logon form field label.
$this->input('openid_url', _m('OpenID URL'),
$this->openid_url,
- // TRANS: OpenID plugin logon form field instructions.
- _m('Your OpenID URL'));
+ // TRANS: OpenID plugin logon form field title.
+ _m('Your OpenID URL.'));
}
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'settings_rememberme'));
// TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie.
$this->checkbox('rememberme', _m('Remember me'), false,
- // TRANS: OpenID plugin logon form field instructions.
+ // TRANS: OpenID plugin logon form field title.
_m('Automatically login in the future; ' .
'not for shared computers!'));
$this->elementEnd('li');
} else {
//invalid
// TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403).
+ // TRANS: %s is a request identity.
$this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403);
}
} else {
function generateAllowResponse($request, $user){
$response = $request->answer(true, null, common_profile_url($user->nickname));
-
+
$profile = $user->getProfile();
$sreg_data = array(
'fullname' => $profile->fullname,
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class OpenidsettingsAction extends SettingsAction
{
/**
*
* @return string Page title
*/
-
function title()
{
- return _m('OpenID settings');
+ // TRANS: Title of OpenID settings page for a user.
+ return _m('TITLE','OpenID settings');
}
/**
*
* @return string Instructions for use
*/
-
function getInstructions()
{
- return _m('[OpenID](%%doc.openid%%) lets you log into many sites' .
- ' with the same user account.'.
- ' Manage your associated OpenIDs from here.');
+ // TRANS: Form instructions for OpenID settings.
+ // TRANS: This message contains Markdown links in the form [description](link).
+ return _m('[OpenID](%%doc.openid%%) lets you log into many sites ' .
+ 'with the same user account. '.
+ 'Manage your associated OpenIDs from here.');
}
function showScripts()
*
* @return void
*/
-
function showContent()
{
$user = common_current_user();
common_local_url('openidsettings')));
$this->elementStart('fieldset', array('id' => 'settings_openid_add'));
- $this->element('legend', null, _m('Add OpenID'));
+ // TRANS: Fieldset legend.
+ $this->element('legend', null, _m('LEGEND','Add OpenID'));
$this->hidden('token', common_session_token());
$this->element('p', 'form_guide',
+ // TRANS: Form guide.
_m('If you want to add an OpenID to your account, ' .
'enter it in the box below and click "Add".'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->element('label', array('for' => 'openid_url'),
+ // TRANS: Field label.
_m('OpenID URL'));
$this->element('input', array('name' => 'openid_url',
'type' => 'text',
'id' => 'settings_openid_add_action-submit',
'name' => 'add',
'class' => 'submit',
- 'value' => _m('Add')));
+ // TRANS: Button text for adding an OpenID URL.
+ 'value' => _m('BUTTON','Add')));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
$cnt = $oid->find();
if ($cnt > 0) {
-
- $this->element('h2', null, _m('Remove OpenID'));
+ // TRANS: Header on OpenID settings page.
+ $this->element('h2', null, _m('HEADER','Remove OpenID'));
if ($cnt == 1 && !$user->password) {
$this->element('p', 'form_guide',
+ // TRANS: Form guide.
_m('Removing your only OpenID '.
'would make it impossible to log in! ' .
'If you need to remove it, '.
} else {
$this->element('p', 'form_guide',
+ // TRANS: Form guide.
_m('You can remove an OpenID from your account '.
'by clicking the button marked "Remove".'));
$idx = 0;
'id' => 'remove'.$idx,
'name' => 'remove',
'class' => 'submit remove',
- 'value' => _m('Remove')));
+ // TRANS: Button text to remove an OpenID.
+ 'value' => _m('BUTTON','Remove')));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$idx++;
'action' =>
common_local_url('openidsettings')));
$this->elementStart('fieldset', array('id' => 'settings_openid_trustroots'));
+ // TRANS: Fieldset legend.
$this->element('legend', null, _m('OpenID Trusted Sites'));
$this->hidden('token', common_session_token());
$this->element('p', 'form_guide',
+ // TRANS: Form guide.
_m('The following sites are allowed to access your ' .
'identity and log you in. You can remove a site from ' .
'this list to deny it access to your OpenID.'));
'id' => 'settings_openid_trustroots_action-submit',
'name' => 'remove_trustroots',
'class' => 'submit',
- 'value' => _m('Remove')));
+ // TRANS: Button text to remove an OpenID trustroot.
+ 'value' => _m('BUTTON','Remove')));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
*
* @return void
*/
-
function handlePost()
{
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
+ // TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_m('There was a problem with your session token. '.
'Try again, please.'));
return;
if ($this->arg('add')) {
if (common_config('openid', 'trusted_provider')) {
- $this->showForm(_m("Can't add new providers."));
+ // TRANS: Form validation error if no OpenID providers can be added.
+ $this->showForm(_m('Cannot add new providers.'));
} else {
$result = oid_authenticate($this->trimmed('openid_url'),
'finishaddopenid');
} else if($this->arg('remove_trustroots')) {
$this->removeTrustroots();
} else {
+ // TRANS: Unexpected form validation error.
$this->showForm(_m('Something weird happened.'));
}
}
*
* @return void
*/
-
function removeTrustroots()
{
$user = common_current_user();
if($user_openid_trustroot) {
$user_openid_trustroot->delete();
} else {
+ // TRANS: Form validation error when trying to remove a non-existing trustroot.
$this->showForm(_m('No such OpenID trustroot.'));
return;
}
}
- $this->showForm(_m('Trustroots removed'), true);
+ // TRANS: Success message after removing trustroots.
+ $this->showForm(_m('Trustroots removed.'), true);
} else {
$this->showForm();
}
*
* @return void
*/
-
function removeOpenid()
{
$openid_url = $this->trimmed('openid_url');
$oid = User_openid::staticGet('canonical', $openid_url);
if (!$oid) {
+ // TRANS: Form validation error for a non-existing OpenID.
$this->showForm(_m('No such OpenID.'));
return;
}
$cur = common_current_user();
if (!$cur || $oid->user_id != $cur->id) {
+ // TRANS: Form validation error if OpenID is connected to another user.
$this->showForm(_m('That OpenID does not belong to you.'));
return;
}
$oid->delete();
+ // TRANS: Success message after removing an OpenID.
$this->showForm(_m('OpenID removed.'), true);
return;
}
*
* @return boolean false
*/
-
function isReadOnly($args)
{
return false;
*
* @return string title of the page
*/
-
function title()
{
+ // TRANS: Title for identity verification page.
return _m('OpenID Identity Verification');
}
$this->allowUrl = $_SESSION['openid_allow_url'];
$this->denyUrl = $_SESSION['openid_deny_url'];
if(empty($this->trust_root) || empty($this->allowUrl) || empty($this->denyUrl)){
+ // TRANS: Client error when visiting page directly.
$this->clientError(_m('This page should only be reached during OpenID processing, not directly.'));
return;
}
*
* @return void
*/
-
function showPageNotice()
{
- $this->element('p',null,sprintf(_m('%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password.'),$this->trust_root));
+ // TRANS: Page notice. %s is a trustroot name.
+ $this->element('p',null,sprintf(_m('%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password.'),$this->trust_root));
}
/**
*
* @return void
*/
-
function showContent()
{
$this->elementStart('form', array('method' => 'post',
'class' => 'form_settings',
'action' => common_local_url('openidtrust')));
$this->elementStart('fieldset');
- $this->submit('allow', _m('Continue'));
- $this->submit('deny', _m('Cancel'));
+ // TRANS: Button text to continue OpenID identity verification.
+ $this->submit('allow', _m('BUTTON','Continue'));
+ // TRANS: Button text to cancel OpenID identity verification.
+ $this->submit('deny', _m('BUTTON','Cancel'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
function onEndAdminPanelNav($menu) {
if (AdminPanelAction::canAdmin('openx')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _m('OpenX configuration');
+ // TRANS: Menu item title.
+ $menu_title = _m('OpenX configuration.');
// TRANS: Menu item for site administration
$menu->out->menuItem(common_local_url('openxadminpanel'), _m('OpenX'),
$menu_title, $action_name == 'openxadminpanel', 'nav_openx_admin_panel');
'submit',
null,
// TRANS: Submit button title in OpenX admin panel.
- _m('Save OpenX settings'));
+ _m('Save OpenX settings.'));
}
}