X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fothersettings.php;h=13460a4bfbd4822fd922e99066a7ebe7ada716b1;hb=2306f7a7f4f746215d432af4351452ed4aa423f0;hp=d32a2d651cb390b2d248064d43543f0a233dbb9f;hpb=201cbb56b6faa33b814344034954a9efdde65e49;p=quix0rs-gnu-social.git diff --git a/actions/othersettings.php b/actions/othersettings.php index d32a2d651c..13460a4bfb 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.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 OthersettingsAction extends AccountSettingsAction { /** @@ -54,10 +53,10 @@ class OthersettingsAction extends AccountSettingsAction * * @return string Title of the page */ - function title() { - return _('Other Settings'); + // Page title for a tab in user profile settings. + return _('Other settings'); } /** @@ -68,6 +67,7 @@ class OthersettingsAction extends AccountSettingsAction function getInstructions() { + // TRANS: Instructions for tab "Other" in user profile settings. return _('Manage various other options.'); } @@ -96,34 +96,42 @@ class OthersettingsAction extends AccountSettingsAction common_local_url('othersettings'))); $this->elementStart('fieldset'); $this->hidden('token', common_session_token()); + $this->elementStart('ul', 'form_data'); - $services=array(); - global $_shorteners; - if($_shorteners){ - foreach($_shorteners as $name=>$value) - { - $services[$name]=$name; - if(!empty($value['info']['freeService'])){ - // I18N - $services[$name].=' (free service)'; - } + $shorteners = array(); + Event::handle('GetUrlShorteners', array(&$shorteners)); + $services = array(); + foreach($shorteners as $name=>$value) + { + $services[$name]=$name; + if($value['freeService']){ + // TRANS: Used as a suffix for free URL shorteners in a dropdown list in the tab "Other" of a + // TRANS: user's profile settings. This message has one space at the beginning. Use your + // TRANS: language's word separator here if it has one (most likely a single space). + $services[$name].=_(' (free service)'); } } - asort($services); - $services['']='None'; - - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - $this->dropdown('urlshorteningservice', _('Shorten URLs with'), - $services, _('Automatic shortening service to use.'), - false, $user->urlshorteningservice); - $this->elementEnd('li'); + if($services) + { + asort($services); + + $this->elementStart('li'); + // TRANS: Label for dropdown with URL shortener services. + $this->dropdown('urlshorteningservice', _('Shorten URLs with'), + // TRANS: Tooltip for for dropdown with URL shortener services. + $services, _('Automatic shortening service to use.'), + false, $user->urlshorteningservice); + $this->elementEnd('li'); + } $this->elementStart('li'); + // TRANS: Label for checkbox. $this->checkbox('viewdesigns', _('View profile designs'), + // TRANS: Tooltip for checkbox. $user->viewdesigns, _('Show or hide profile designs.')); $this->elementEnd('li'); $this->elementEnd('ul'); - $this->submit('save', _('Save')); + // TRANS: Button text for saving "Other settings" in profile. + $this->submit('save', _m('BUTTON','Save')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -150,7 +158,8 @@ class OthersettingsAction extends AccountSettingsAction $urlshorteningservice = $this->trimmed('urlshorteningservice'); if (!is_null($urlshorteningservice) && strlen($urlshorteningservice) > 50) { - $this->showForm(_('URL shortening service is too long (max 50 chars).')); + // TRANS: Form validation error for form "Other settings" in user profile. + $this->showForm(_('URL shortening service is too long (maximum 50 characters).')); return; } @@ -171,6 +180,7 @@ class OthersettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); + // TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server. $this->serverError(_('Couldn\'t update user.')); return; }