Merge branch '0.9.x' into json-activities

* 0.9.x:
  * update translator documentation. * remove superfluous whitespace. * tab to spaces. * add FIXME for undocumented class.
  * update translator documentation. * remove superfluous whitespace. * L10n updates. * small refactoring in publicrss.php. * remove PHP4-isms
  Localisation updates from http://translatewiki.net.
  Double quotes to single quotes.
  * improve L10n consistency for English. For example proper punctuation for all button and label titles. * fix some i18n bugs (in-message variables). * update/add translator documentation. * remove superfluous whitespace.
  add path separators for Plugin::path()
  argument to send email summary to all users on all sites
  fix indentation in siteemailsummaryhandler
  fix indentation in sendemailsummary.php
  fix indentation in Email_summary_status.php
  fix indentation in EmailSummaryPlugin.php
  fix indentation in usermailsummaryhandler.php
This commit is contained in:
Zach Copley 2011-02-17 19:11:29 -08:00
commit e98e443605
102 changed files with 14189 additions and 8840 deletions

View File

@ -141,7 +141,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
} else if (!$this->user->mutuallySubscribed($this->other)) { } else if (!$this->user->mutuallySubscribed($this->other)) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to direct message another user who's not a friend (403). // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
_('Can\'t send direct messages to users who aren\'t your friend.'), _('Cannot send direct messages to users who aren\'t your friend.'),
403, 403,
$this->format $this->format
); );

View File

@ -99,7 +99,7 @@ class ApiOauthAccessTokenAction extends ApiOauthAction
common_log(LOG_WARNING, $msg); common_log(LOG_WARNING, $msg);
// TRANS: Client error given from the OAuth API when the request token or verifier is invalid. // TRANS: Client error given from the OAuth API when the request token or verifier is invalid.
$this->clientError(_("Invalid request token or verifier."), 400, 'text'); $this->clientError(_('Invalid request token or verifier.'), 400, 'text');
} else { } else {
common_log( common_log(
LOG_INFO, LOG_INFO,

View File

@ -141,7 +141,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
default: default:
// TRANS: Exception thrown requesting an unsupported notice output format. // TRANS: Exception thrown requesting an unsupported notice output format.
// TRANS: %s is the requested output format. // TRANS: %s is the requested output format.
throw new Exception(sprintf(_("Unsupported format: %s"), $this->format)); throw new Exception(sprintf(_("Unsupported format: %s."), $this->format));
} }
} else { } else {
// XXX: Twitter just sets a 404 header and doens't bother // XXX: Twitter just sets a 404 header and doens't bother
@ -224,7 +224,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
{ {
if ($this->format != 'atom') { if ($this->format != 'atom') {
// TRANS: Client error displayed when trying to delete a notice not using the Atom format. // TRANS: Client error displayed when trying to delete a notice not using the Atom format.
$this->clientError(_("Can only delete using the Atom format.")); $this->clientError(_('Can only delete using the Atom format.'));
return; return;
} }

View File

@ -329,7 +329,6 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$saved = null; $saved = null;
if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user, &$saved))) { if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user, &$saved))) {
if ($activity->verb != ActivityVerb::POST) { if ($activity->verb != ActivityVerb::POST) {
// TRANS: Client error displayed when not using the POST verb. Do not translate POST. // TRANS: Client error displayed when not using the POST verb. Do not translate POST.
$this->clientError(_('Can only handle POST activities.')); $this->clientError(_('Can only handle POST activities.'));
@ -405,6 +404,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
if (!empty($notice)) { if (!empty($notice)) {
// TRANS: Client error displayed when using another format than AtomPub. // TRANS: Client error displayed when using another format than AtomPub.
// TRANS: %s is the notice URI.
$this->clientError(sprintf(_('Notice with URI "%s" already exists.'), $this->clientError(sprintf(_('Notice with URI "%s" already exists.'),
$note->id)); $note->id));
return; return;

View File

@ -142,7 +142,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function deleteMembership() function deleteMembership()
{ {
if (empty($this->auth_user) || if (empty($this->auth_user) ||

View File

@ -211,7 +211,7 @@ class AvatarsettingsAction extends AccountSettingsAction
array('id' => 'avatar_original', array('id' => 'avatar_original',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header on avatar upload crop form for thumbnail of originally uploaded avatar (h2). // TRANS: Header on avatar upload crop form for thumbnail of originally uploaded avatar (h2).
$this->element('h2', null, _("Original")); $this->element('h2', null, _('Original'));
$this->elementStart('div', array('id'=>'avatar_original_view')); $this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'], 'width' => $this->filedata['width'],
@ -224,7 +224,7 @@ class AvatarsettingsAction extends AccountSettingsAction
array('id' => 'avatar_preview', array('id' => 'avatar_preview',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header on avatar upload crop form for thumbnail of to be used rendition of uploaded avatar (h2). // TRANS: Header on avatar upload crop form for thumbnail of to be used rendition of uploaded avatar (h2).
$this->element('h2', null, _("Preview")); $this->element('h2', null, _('Preview'));
$this->elementStart('div', array('id'=>'avatar_preview_view')); $this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE, 'width' => AVATAR_PROFILE_SIZE,
@ -341,8 +341,8 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->mode = 'crop'; $this->mode = 'crop';
// TRANS: Avatar upload form unstruction after uploading a file. // TRANS: Avatar upload form instruction after uploading a file.
$this->showForm(_('Pick a square area of the image to be your avatar'), $this->showForm(_('Pick a square area of the image to be your avatar.'),
true); true);
} }

View File

@ -58,7 +58,7 @@ class BackupaccountAction extends Action
function title() function title()
{ {
// TRANS: Title for backup account page. // TRANS: Title for backup account page.
return _("Backup account"); return _('Backup account');
} }
/** /**
@ -249,6 +249,6 @@ class BackupAccountForm extends Form
'submit', 'submit',
null, null,
// TRANS: Title for submit button to backup an account on the backup account page. // TRANS: Title for submit button to backup an account on the backup account page.
_('Backup your account')); _('Backup your account.'));
} }
} }

View File

@ -155,14 +155,14 @@ class BlockAction extends ProfileFormAction
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when blocking a user. // TRANS: Submit button title for 'No' when blocking a user.
_('Do not block this user')); _('Do not block this user.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the user block form. // TRANS: Button label on the user block form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
'yes', 'yes',
// TRANS: Submit button title for 'Yes' when blocking a user. // TRANS: Submit button title for 'Yes' when blocking a user.
_('Block this user')); _('Block this user.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -158,13 +158,13 @@ class DeleteapplicationAction extends Action
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when deleting an application. // TRANS: Submit button title for 'No' when deleting an application.
_('Do not delete this application')); _('Do not delete this application.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the delete application form. // TRANS: Button label on the delete application form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
// TRANS: Submit button title for 'Yes' when deleting an application. // TRANS: Submit button title for 'Yes' when deleting an application.
'yes', _('Delete this application')); 'yes', _('Delete this application.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -221,14 +221,14 @@ class DeletegroupAction extends RedirectingAction
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when deleting a group. // TRANS: Submit button title for 'No' when deleting a group.
_('Do not delete this group')); _('Do not delete this group.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the delete group form. // TRANS: Button label on the delete group form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
'yes', 'yes',
// TRANS: Submit button title for 'Yes' when deleting a group. // TRANS: Submit button title for 'Yes' when deleting a group.
_('Delete this group')); _('Delete this group.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -156,14 +156,14 @@ class DeletenoticeAction extends Action
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when deleting a notice. // TRANS: Submit button title for 'No' when deleting a notice.
_("Do not delete this notice")); _('Do not delete this notice.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the delete notice form. // TRANS: Button label on the delete notice form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
'yes', 'yes',
// TRANS: Submit button title for 'Yes' when deleting a notice. // TRANS: Submit button title for 'Yes' when deleting a notice.
_('Delete this notice')); _('Delete this notice.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -155,14 +155,14 @@ class DeleteuserAction extends ProfileFormAction
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when deleting a user. // TRANS: Submit button title for 'No' when deleting a user.
_('Do not delete this user')); _('Do not delete this user.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the delete user form. // TRANS: Button label on the delete user form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
'yes', 'yes',
// TRANS: Submit button title for 'Yes' when deleting a user. // TRANS: Submit button title for 'Yes' when deleting a user.
_('Delete this user')); _('Delete this user.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -336,7 +336,7 @@ class DesignadminpanelAction extends AdminPanelAction
if (!in_array($values['theme'], Theme::listAvailable())) { if (!in_array($values['theme'], Theme::listAvailable())) {
// TRANS: Client error displayed when a theme is submitted through the form that is not in the theme list. // TRANS: Client error displayed when a theme is submitted through the form that is not in the theme list.
// TRANS: %s is the chosen unavailable theme. // TRANS: %s is the chosen unavailable theme.
$this->clientError(sprintf(_("Theme not available: %s."), $values['theme'])); $this->clientError(sprintf(_('Theme not available: %s.'), $values['theme']));
} }
} }
@ -443,7 +443,7 @@ class DesignAdminPanelForm extends AdminForm
// TRANS: Field label for StatusNet site logo. // TRANS: Field label for StatusNet site logo.
_('Site logo'), _('Site logo'),
// TRANS: Title for field label for StatusNet site logo. // TRANS: Title for field label for StatusNet site logo.
'Logo for the site (full URL)'); 'Logo for the site (full URL).');
$this->unli(); $this->unli();
$this->li(); $this->li();
@ -451,7 +451,7 @@ class DesignAdminPanelForm extends AdminForm
// TRANS: Field label for SSL StatusNet site logo. // TRANS: Field label for SSL StatusNet site logo.
_('SSL logo'), _('SSL logo'),
// TRANS: Title for field label for SSL StatusNet site logo. // TRANS: Title for field label for SSL StatusNet site logo.
'Logo to show on SSL pages'); 'Logo to show on SSL pages.');
$this->unli(); $this->unli();
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
@ -717,7 +717,7 @@ class DesignAdminPanelForm extends AdminForm
// TRANS: Button text for resetting theme settings. // TRANS: Button text for resetting theme settings.
$this->out->submit('defaults', _m('BUTTON','Use defaults'), 'submit form_action-default', $this->out->submit('defaults', _m('BUTTON','Use defaults'), 'submit form_action-default',
// TRANS: Title for button for resetting theme settings. // TRANS: Title for button for resetting theme settings.
'defaults', _('Restore default designs')); 'defaults', _('Restore default designs.'));
$this->out->element('input', array('id' => 'settings_design_reset', $this->out->element('input', array('id' => 'settings_design_reset',
'type' => 'reset', 'type' => 'reset',
@ -725,7 +725,7 @@ class DesignAdminPanelForm extends AdminForm
'value' => 'Reset', 'value' => 'Reset',
'class' => 'submit form_action-primary', 'class' => 'submit form_action-primary',
// TRANS: Title for button for resetting theme settings. // TRANS: Title for button for resetting theme settings.
'title' => _('Reset back to default'))); 'title' => _('Reset back to default.')));
$this->out->submit('save', $this->out->submit('save',
// TRANS: Button text for saving theme settings. // TRANS: Button text for saving theme settings.
@ -733,6 +733,6 @@ class DesignAdminPanelForm extends AdminForm
'submit form_action-secondary', 'submit form_action-secondary',
'save', 'save',
// TRANS: Title for button for saving theme settings. // TRANS: Title for button for saving theme settings.
_('Save design')); _('Save design.'));
} }
} }

View File

@ -527,7 +527,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error removing incoming e-mail address. // TRANS: Server error thrown on database error removing incoming e-mail address.
$this->serverError(_("Could not update user record.")); $this->serverError(_('Could not update user record.'));
} }
// TRANS: Message given after successfully removing an incoming e-mail address. // TRANS: Message given after successfully removing an incoming e-mail address.
@ -551,7 +551,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error adding incoming e-mail address. // TRANS: Server error thrown on database error adding incoming e-mail address.
$this->serverError(_("Could not update user record.")); $this->serverError(_('Could not update user record.'));
} }
// TRANS: Message given after successfully adding an incoming e-mail address. // TRANS: Message given after successfully adding an incoming e-mail address.

View File

@ -92,7 +92,7 @@ class FavorAction extends Action
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Page title for page on which favorite notices can be unfavourited. // TRANS: Page title for page on which favorite notices can be unfavourited.
$this->element('title', null, _('Disfavor favorite')); $this->element('title', null, _('Disfavor favorite.'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
$disfavor = new DisFavorForm($this, $notice); $disfavor = new DisFavorForm($this, $notice);

View File

@ -188,14 +188,14 @@ class GroupblockAction extends RedirectingAction
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when blocking a user from a group. // TRANS: Submit button title for 'No' when blocking a user from a group.
_('Do not block this user from this group')); _('Do not block this user from this group.'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the form to block a user from a group. // TRANS: Button label on the form to block a user from a group.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
'yes', 'yes',
// TRANS: Submit button title for 'Yes' when blocking a user from a group. // TRANS: Submit button title for 'Yes' when blocking a user from a group.
_('Block this user from this group')); _('Block this user from this group.'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -204,7 +204,7 @@ class GrouplogoAction extends GroupDesignAction
$this->elementStart('li', array('id' => 'avatar_original', $this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Uploaded original file in group logo form. // TRANS: Uploaded original file in group logo form.
$this->element('h2', null, _("Original")); $this->element('h2', null, _('Original'));
$this->elementStart('div', array('id'=>'avatar_original_view')); $this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $this->group->original_logo, $this->element('img', array('src' => $this->group->original_logo,
'alt' => $this->group->nickname)); 'alt' => $this->group->nickname));
@ -216,7 +216,7 @@ class GrouplogoAction extends GroupDesignAction
$this->elementStart('li', array('id' => 'avatar_preview', $this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for preview of to be displayed group logo. // TRANS: Header for preview of to be displayed group logo.
$this->element('h2', null, _("Preview")); $this->element('h2', null, _('Preview'));
$this->elementStart('div', array('id'=>'avatar_preview_view')); $this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => $this->group->homepage_logo, $this->element('img', array('src' => $this->group->homepage_logo,
'width' => AVATAR_PROFILE_SIZE, 'width' => AVATAR_PROFILE_SIZE,
@ -267,7 +267,7 @@ class GrouplogoAction extends GroupDesignAction
array('id' => 'avatar_original', array('id' => 'avatar_original',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for originally uploaded file before a crop on the group logo page. // TRANS: Header for originally uploaded file before a crop on the group logo page.
$this->element('h2', null, _("Original")); $this->element('h2', null, _('Original'));
$this->elementStart('div', array('id'=>'avatar_original_view')); $this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'], 'width' => $this->filedata['width'],
@ -280,7 +280,7 @@ class GrouplogoAction extends GroupDesignAction
array('id' => 'avatar_preview', array('id' => 'avatar_preview',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for the cropped group logo on the group logo page. // TRANS: Header for the cropped group logo on the group logo page.
$this->element('h2', null, _("Preview")); $this->element('h2', null, _('Preview'));
$this->elementStart('div', array('id'=>'avatar_preview_view')); $this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE, 'width' => AVATAR_PROFILE_SIZE,

View File

@ -126,4 +126,4 @@ class InboxMessageListItem extends MessageListItem
{ {
return $this->message->getFrom(); return $this->message->getFrom();
} }
} }

View File

@ -42,13 +42,11 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @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 LoginAction extends Action class LoginAction extends Action
{ {
/** /**
* Has there been an error? * Has there been an error?
*/ */
var $error = null; var $error = null;
/** /**
@ -56,7 +54,6 @@ class LoginAction extends Action
* *
* @return boolean false * @return boolean false
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return false; return false;
@ -69,7 +66,6 @@ class LoginAction extends Action
* @param $args * @param $args
* @return string title * @return string title
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -93,7 +89,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -117,7 +112,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function checkLogin($user_id=null, $token=null) function checkLogin($user_id=null, $token=null)
{ {
// XXX: login throttle // XXX: login throttle
@ -186,7 +180,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function showForm($error=null) function showForm($error=null)
{ {
$this->error = $error; $this->error = $error;
@ -204,7 +197,6 @@ class LoginAction extends Action
* *
* @return string title of the page * @return string title of the page
*/ */
function title() function title()
{ {
return _('Login'); return _('Login');
@ -218,7 +210,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function showPageNotice() function showPageNotice()
{ {
if ($this->error) { if ($this->error) {
@ -238,7 +229,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',
@ -278,7 +268,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function getInstructions() function getInstructions()
{ {
if (common_logged_in() && !common_is_real_login() && if (common_logged_in() && !common_is_real_login() &&
@ -306,7 +295,6 @@ class LoginAction extends Action
* *
* @return void * @return void
*/ */
function showLocalNav() function showLocalNav()
{ {
$nav = new LoginGroupNav($this); $nav = new LoginGroupNav($this);

View File

@ -66,6 +66,7 @@ class LogoutAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to log out when not logged in.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
} else { } else {
if (Event::handle('StartLogout', array($this))) { if (Event::handle('StartLogout', array($this))) {
@ -83,5 +84,4 @@ class LogoutAction extends Action
common_real_login(false); // not logged in common_real_login(false); // not logged in
common_forgetme(); // don't log back in! common_forgetme(); // don't log back in!
} }
} }

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/searchaction.php';
*/ */
class NoticesearchAction extends SearchAction class NoticesearchAction extends SearchAction
{ {
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -65,6 +64,8 @@ class NoticesearchAction extends SearchAction
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for Notice search page.
// TRANS: %%site.name%% is the name of the StatusNet site.
return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.'); return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.');
} }
@ -75,6 +76,7 @@ class NoticesearchAction extends SearchAction
*/ */
function title() function title()
{ {
// TRANS: Title of the page where users can search for notices.
return _('Text search'); return _('Text search');
} }
@ -88,6 +90,8 @@ class NoticesearchAction extends SearchAction
return array(new Feed(Feed::RSS1, common_local_url('noticesearchrss', return array(new Feed(Feed::RSS1, common_local_url('noticesearchrss',
array('q' => $q)), array('q' => $q)),
// TRANS: Test in RSS notice search.
// TRANS: %1$s is the query, %2$s is the StatusNet site name.
sprintf(_('Search results for "%1$s" on %2$s'), sprintf(_('Search results for "%1$s" on %2$s'),
$q, common_config('site', 'name')))); $q, common_config('site', 'name'))));
} }
@ -114,13 +118,18 @@ class NoticesearchAction extends SearchAction
$cnt = $notice->find(); $cnt = $notice->find();
} }
if ($cnt === 0) { if ($cnt === 0) {
// TRANS: Text for notice search results is the query had no results.
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q); $this->searchSuggestions($q);
if (common_logged_in()) { if (common_logged_in()) {
// TRANS: Text for logged in users making a query for notices without results.
// TRANS: This message contains a Markdown link.
$message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
} }
else { else {
// TRANS: Text for not logged in users making a query for notices without results.
// TRANS: This message contains Markdown links.
$message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
} }
@ -203,4 +212,3 @@ class SearchNoticeListItem extends NoticeListItem {
return $result; return $result;
} }
} }

View File

@ -48,12 +48,11 @@ require_once INSTALLDIR.'/lib/rssaction.php';
*/ */
class NoticesearchrssAction extends Rss10Action class NoticesearchrssAction extends Rss10Action
{ {
function init() function init()
{ {
return true; return true;
} }
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -63,7 +62,6 @@ class NoticesearchrssAction extends Rss10Action
function getNotices($limit=0) function getNotices($limit=0)
{ {
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$notices = array(); $notices = array();
@ -93,9 +91,12 @@ class NoticesearchrssAction extends Rss10Action
{ {
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$c = array('url' => common_local_url('noticesearchrss', array('q' => $q)), $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)),
// TRANS: RSS notice search feed title. %s is the query.
'title' => sprintf(_('Updates with "%s"'), $q), 'title' => sprintf(_('Updates with "%s"'), $q),
'link' => common_local_url('noticesearch', array('q' => $q)), 'link' => common_local_url('noticesearch', array('q' => $q)),
'description' => sprintf(_('Updates matching search term "%1$s" on %2$s!'), // TRANS: RSS notice search feed description.
// TRANS: %1$s is the query, %2$s is the StatusNet site name.
'description' => sprintf(_('Updates matching search term "%1$s" on %2$s.'),
$q, common_config('site', 'name'))); $q, common_config('site', 'name')));
return $c; return $c;
} }

View File

@ -166,6 +166,5 @@ class OauthappssettingsAction extends SettingsAction
'Try again, please.')); 'Try again, please.'));
return; return;
} }
} }
} }

View File

@ -64,7 +64,6 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for OAuth connection settings. // TRANS: Title for OAuth connection settings.
@ -76,7 +75,6 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for OAuth connection settings. // TRANS: Instructions for OAuth connection settings.

View File

@ -61,7 +61,7 @@ class OembedAction extends Action
$proxy_args = $r->map($path); $proxy_args = $r->map($path);
if (!$proxy_args) { if (!$proxy_args) {
$this->serverError(_("$path not found."), 404); $this->serverError(sprintf(_('"%s" not found.'),$path), 404);
} }
$oembed=array(); $oembed=array();
$oembed['version']='1.0'; $oembed['version']='1.0';
@ -73,7 +73,7 @@ class OembedAction extends Action
$id = $proxy_args['notice']; $id = $proxy_args['notice'];
$notice = Notice::staticGet($id); $notice = Notice::staticGet($id);
if(empty($notice)){ if(empty($notice)){
$this->serverError(_("Notice $id not found."), 404); $this->serverError(sprintf(_("Notice %s not found."),$id), 404);
} }
$profile = $notice->getProfile(); $profile = $notice->getProfile();
if (empty($profile)) { if (empty($profile)) {
@ -92,7 +92,7 @@ class OembedAction extends Action
$id = $proxy_args['attachment']; $id = $proxy_args['attachment'];
$attachment = File::staticGet($id); $attachment = File::staticGet($id);
if(empty($attachment)){ if(empty($attachment)){
$this->serverError(_("Attachment $id not found."), 404); $this->serverError(sprintf(_('Attachment %s not found.'),$id), 404);
} }
if(empty($attachment->filename) && $file_oembed = File_oembed::staticGet('file_id', $attachment->id)){ if(empty($attachment->filename) && $file_oembed = File_oembed::staticGet('file_id', $attachment->id)){
// Proxy the existing oembed information // Proxy the existing oembed information
@ -133,7 +133,7 @@ class OembedAction extends Action
if($attachment->title) $oembed['title']=$attachment->title; if($attachment->title) $oembed['title']=$attachment->title;
break; break;
default: default:
$this->serverError(_("$path not supported for oembed requests."), 501); $this->serverError(sprintf(_('"%s" not supported for oembed requests.'),$path), 501);
} }
switch($args['format']){ switch($args['format']){
case 'xml': case 'xml':

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Opensearch action class. * Opensearch action class.
* *
@ -51,7 +50,7 @@ class OpensearchAction extends Action
* Class handler. * Class handler.
* *
* @param array $args query arguments * @param array $args query arguments
* *
* @return boolean false if user doesn't exist * @return boolean false if user doesn't exist
*/ */
function handle($args) function handle($args)
@ -61,8 +60,10 @@ class OpensearchAction extends Action
$short_name = ''; $short_name = '';
if ($type == 'people') { if ($type == 'people') {
$type = 'peoplesearch'; $type = 'peoplesearch';
// TRANS: ShortName in the OpenSearch interface when trying to find users.
$short_name = _('People Search'); $short_name = _('People Search');
} else { } else {
// TRANS: ShortName in the OpenSearch interface when trying to find notices.
$type = 'noticesearch'; $type = 'noticesearch';
$short_name = _('Notice Search'); $short_name = _('Notice Search');
} }
@ -89,4 +90,3 @@ class OpensearchAction extends Action
return true; return true;
} }
} }

View File

@ -189,6 +189,7 @@ class OthersettingsAction extends AccountSettingsAction
$user->query('COMMIT'); $user->query('COMMIT');
// TRANS: Confirmation message after saving preferences.
$this->showForm(_('Preferences saved.'), true); $this->showForm(_('Preferences saved.'), true);
} }
} }

View File

@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class OtpAction extends Action class OtpAction extends Action
{ {
var $user; var $user;
@ -59,6 +58,7 @@ class OtpAction extends Action
parent::prepare($args); parent::prepare($args);
if (common_is_real_login()) { if (common_is_real_login()) {
// TRANS: Client error displayed trying to use "one time password login" when already logged in.
$this->clientError(_('Already logged in.')); $this->clientError(_('Already logged in.'));
return false; return false;
} }
@ -66,6 +66,7 @@ class OtpAction extends Action
$id = $this->trimmed('user_id'); $id = $this->trimmed('user_id');
if (empty($id)) { if (empty($id)) {
// TRANS: Client error displayed trying to use "one time password login" without specifying a user.
$this->clientError(_('No user ID specified.')); $this->clientError(_('No user ID specified.'));
return false; return false;
} }
@ -73,6 +74,7 @@ class OtpAction extends Action
$this->user = User::staticGet('id', $id); $this->user = User::staticGet('id', $id);
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed trying to use "one time password login" without using an existing user.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} }
@ -80,6 +82,7 @@ class OtpAction extends Action
$this->token = $this->trimmed('token'); $this->token = $this->trimmed('token');
if (empty($this->token)) { if (empty($this->token)) {
// TRANS: Client error displayed trying to use "one time password login" without specifying a login token.
$this->clientError(_('No login token specified.')); $this->clientError(_('No login token specified.'));
return false; return false;
} }
@ -87,11 +90,13 @@ class OtpAction extends Action
$this->lt = Login_token::staticGet('user_id', $id); $this->lt = Login_token::staticGet('user_id', $id);
if (empty($this->lt)) { if (empty($this->lt)) {
// TRANS: Client error displayed trying to use "one time password login" without requesting a login token.
$this->clientError(_('No login token requested.')); $this->clientError(_('No login token requested.'));
return false; return false;
} }
if ($this->lt->token != $this->token) { if ($this->lt->token != $this->token) {
// TRANS: Client error displayed trying to use "one time password login" while specifying an invalid login token.
$this->clientError(_('Invalid login token specified.')); $this->clientError(_('Invalid login token specified.'));
return false; return false;
} }
@ -101,6 +106,7 @@ class OtpAction extends Action
//delete the token as it is useless //delete the token as it is useless
$this->lt->delete(); $this->lt->delete();
$this->lt = null; $this->lt = null;
// TRANS: Client error displayed trying to use "one time password login" while specifying an expired login token.
$this->clientError(_('Login token expired.')); $this->clientError(_('Login token expired.'));
return false; return false;
} }
@ -111,12 +117,13 @@ class OtpAction extends Action
return true; return true;
} }
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
// success! // success!
if (!common_set_user($this->user)) { if (!common_set_user($this->user)) {
// TRANS: Server error displayed when a user object could not be created trying to login using "one time password login".
$this->serverError(_('Error setting user. You are probably not authorized.')); $this->serverError(_('Error setting user. You are probably not authorized.'));
return; return;
} }

View File

@ -26,7 +26,6 @@
* @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/
*/ */
if (!defined('STATUSNET') && !defined('LACONICA')) { if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1); exit(1);
} }
@ -43,7 +42,6 @@ require_once INSTALLDIR.'/lib/mailbox.php';
* @link http://status.net/ * @link http://status.net/
* @see MailboxAction * @see MailboxAction
*/ */
class OutboxAction extends MailboxAction class OutboxAction extends MailboxAction
{ {
/** /**
@ -51,13 +49,15 @@ class OutboxAction extends MailboxAction
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
if ($this->page > 1) { if ($this->page > 1) {
// TRANS: Title for outbox for any but the fist page.
// TRANS: %1$s is the user nickname, %2$d is the page number.
return sprintf(_('Outbox for %1$s - page %2$d'), return sprintf(_('Outbox for %1$s - page %2$d'),
$this->user->nickname, $page); $this->user->nickname, $page);
} else { } else {
// TRANS: Title for first page of outbox.
return sprintf(_('Outbox for %s'), $this->user->nickname); return sprintf(_('Outbox for %s'), $this->user->nickname);
} }
} }
@ -71,7 +71,6 @@ class OutboxAction extends MailboxAction
* *
* @see MailboxAction::getMessages() * @see MailboxAction::getMessages()
*/ */
function getMessages() function getMessages()
{ {
$message = new Message(); $message = new Message();
@ -98,9 +97,9 @@ class OutboxAction extends MailboxAction
* *
* @return string localised instructions for using the page * @return string localised instructions for using the page
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for outbox.
return _('This is your outbox, which lists private messages you have sent.'); return _('This is your outbox, which lists private messages you have sent.');
} }
} }
@ -124,4 +123,4 @@ class OutboxMessageListItem extends MessageListItem
{ {
return $this->message->getTo(); return $this->message->getTo();
} }
} }

View File

@ -106,11 +106,11 @@ class PasswordsettingsAction extends AccountSettingsAction
} }
$this->elementStart('li'); $this->elementStart('li');
$this->password('newpassword', _('New password'), $this->password('newpassword', _('New password'),
_('6 or more characters')); _('6 or more characters.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->password('confirm', _('Confirm'), $this->password('confirm', _('Confirm'),
_('Same as password above')); _('Same as password above.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
@ -128,7 +128,6 @@ class PasswordsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
@ -183,7 +182,7 @@ class PasswordsettingsAction extends AccountSettingsAction
} }
if (!$user->update($original)) { if (!$user->update($original)) {
$this->serverError(_('Can\'t save new password.')); $this->serverError(_('Cannot save new password.'));
return; return;
} }
Event::handle('EndChangePassword', array($user)); Event::handle('EndChangePassword', array($user));

View File

@ -49,12 +49,15 @@ class PeoplesearchAction extends SearchAction
{ {
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for the "People search" page.
// TRANS: %%site.name%% is the name of the StatusNet site.
return _('Search for people on %%site.name%% by their name, location, or interests. ' . return _('Search for people on %%site.name%% by their name, location, or interests. ' .
'Separate the terms by spaces; they must be 3 characters or more.'); 'Separate the terms by spaces; they must be 3 characters or more.');
} }
function title() function title()
{ {
// TRANS: Title of a page where users can search for other users.
return _('People search'); return _('People search');
} }
@ -80,6 +83,7 @@ class PeoplesearchAction extends SearchAction
$page, 'peoplesearch', array('q' => $q)); $page, 'peoplesearch', array('q' => $q));
} else { } else {
// TRANS: Message on the "People search" page where a query has no results.
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q); $this->searchSuggestions($q);
$profile->free(); $profile->free();
@ -136,4 +140,3 @@ class PeopleSearchResultItem extends ProfileListItem
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text)); return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
} }
} }

View File

@ -161,14 +161,14 @@ class ProfilesettingsAction extends AccountSettingsAction
$this->input('tags', _('Tags'), $this->input('tags', _('Tags'),
($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()),
// TRANS: Tooltip for field label in form for profile settings. // TRANS: Tooltip for field label in form for profile settings.
_('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$language = common_language(); $language = common_language();
// TRANS: Dropdownlist label in form for profile settings. // TRANS: Dropdownlist label in form for profile settings.
$this->dropdown('language', _('Language'), $this->dropdown('language', _('Language'),
// TRANS: Tooltip for dropdown list label in form for profile settings. // TRANS: Tooltip for dropdown list label in form for profile settings.
get_nice_language_list(), _('Preferred language'), get_nice_language_list(), _('Preferred language.'),
false, $language); false, $language);
$this->elementEnd('li'); $this->elementEnd('li');
$timezone = common_timezone(); $timezone = common_timezone();
@ -187,7 +187,7 @@ class ProfilesettingsAction extends AccountSettingsAction
$this->checkbox('autosubscribe', $this->checkbox('autosubscribe',
// TRANS: Checkbox label in form for profile settings. // TRANS: Checkbox label in form for profile settings.
_('Automatically subscribe to whoever '. _('Automatically subscribe to whoever '.
'subscribes to me (best for non-humans)'), 'subscribes to me (best for non-humans).'),
($this->arg('autosubscribe')) ? ($this->arg('autosubscribe')) ?
$this->boolean('autosubscribe') : $user->autosubscribe); $this->boolean('autosubscribe') : $user->autosubscribe);
$this->elementEnd('li'); $this->elementEnd('li');
@ -288,7 +288,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if (!common_valid_profile_tag($tag)) { if (!common_valid_profile_tag($tag)) {
// TRANS: Validation error in form for profile settings. // TRANS: Validation error in form for profile settings.
// TRANS: %s is an invalid tag. // TRANS: %s is an invalid tag.
$this->showForm(sprintf(_('Invalid tag: "%s"'), $tag)); $this->showForm(sprintf(_('Invalid tag: "%s".'), $tag));
return; return;
} }
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Public RSS action class. * Public RSS action class.
* *
@ -55,7 +54,6 @@ class PublicrssAction extends Rss10Action
* @param array $args Arguments from $_REQUEST * @param array $args Arguments from $_REQUEST
* @return boolean success * @return boolean success
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -98,11 +96,14 @@ class PublicrssAction extends Rss10Action
*/ */
function getChannel() function getChannel()
{ {
$sitename = common_config('site', 'name');
$c = array( $c = array(
'url' => common_local_url('publicrss') 'url' => common_local_url('publicrss'),
, 'title' => sprintf(_('%s public timeline'), common_config('site', 'name')) // TRANS: Public RSS feed title. %s is the StatusNet site name.
, 'link' => common_local_url('public') 'title' => sprintf(_('%s public timeline'), $sitename),
, 'description' => sprintf(_('%s updates from everyone!'), common_config('site', 'name'))); 'link' => common_local_url('public'),
// TRANS: Public RSS feed description. %s is the StatusNet site name.
'description' => sprintf(_('%s updates from everyone.'), $sitename));
return $c; return $c;
} }
@ -110,7 +111,7 @@ class PublicrssAction extends Rss10Action
* Get image. * Get image.
* *
* @return nothing * @return nothing
*/ */
function getImage() function getImage()
{ {
// nop // nop
@ -121,4 +122,3 @@ class PublicrssAction extends Rss10Action
return true; return true;
} }
} }

View File

@ -226,7 +226,7 @@ class RecoverpasswordAction extends Action
// TRANS: Title for password recovery page in email sent mode. // TRANS: Title for password recovery page in email sent mode.
case 'sent': return _('Password recovery requested'); case 'sent': return _('Password recovery requested');
// TRANS: Title for password recovery page in password saved mode. // TRANS: Title for password recovery page in password saved mode.
case 'saved': return _('Password saved.'); case 'saved': return _('Password saved');
default: default:
// TRANS: Title for password recovery page when an unknown action has been specified. // TRANS: Title for password recovery page when an unknown action has been specified.
return _('Unknown action'); return _('Unknown action');

View File

@ -40,25 +40,21 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @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 RegisterAction extends Action class RegisterAction extends Action
{ {
/** /**
* Has there been an error? * Has there been an error?
*/ */
var $error = null; var $error = null;
/** /**
* Have we registered? * Have we registered?
*/ */
var $registered = false; var $registered = false;
/** /**
* Are we processing an invite? * Are we processing an invite?
*/ */
var $invite = null; var $invite = null;
/** /**
@ -68,7 +64,6 @@ class RegisterAction extends Action
* @param $args * @param $args
* @return string title * @return string title
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -112,7 +107,6 @@ class RegisterAction extends Action
* *
* @return string title * @return string title
*/ */
function title() function title()
{ {
if ($this->registered) { if ($this->registered) {
@ -133,7 +127,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -163,7 +156,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function tryRegister() function tryRegister()
{ {
if (Event::handle('StartRegistrationTry', array($this))) { if (Event::handle('StartRegistrationTry', array($this))) {
@ -206,7 +198,7 @@ class RegisterAction extends Action
$email = common_canonical_email($email); $email = common_canonical_email($email);
if (!$this->boolean('license')) { if (!$this->boolean('license')) {
$this->showForm(_('You can\'t register if you don\'t '. $this->showForm(_('You cannot register if you don\'t '.
'agree to the license.')); 'agree to the license.'));
} else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) { } else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) {
$this->showForm(_('Not a valid email address.')); $this->showForm(_('Not a valid email address.'));
@ -284,7 +276,6 @@ class RegisterAction extends Action
* *
* @return boolean true if the nickname already exists * @return boolean true if the nickname already exists
*/ */
function nicknameExists($nickname) function nicknameExists($nickname)
{ {
$user = User::staticGet('nickname', $nickname); $user = User::staticGet('nickname', $nickname);
@ -300,7 +291,6 @@ class RegisterAction extends Action
* *
* @return boolean true if the address already exists * @return boolean true if the address already exists
*/ */
function emailExists($email) function emailExists($email)
{ {
$email = common_canonical_email($email); $email = common_canonical_email($email);
@ -339,7 +329,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showPageNotice() function showPageNotice()
{ {
if ($this->registered) { if ($this->registered) {
@ -351,7 +340,7 @@ class RegisterAction extends Action
common_markup_to_html(_('With this form you can create '. common_markup_to_html(_('With this form you can create '.
'a new account. ' . 'a new account. ' .
'You can then post notices and '. 'You can then post notices and '.
'link up to friends and colleagues. ')); 'link up to friends and colleagues.'));
$this->elementStart('div', 'instructions'); $this->elementStart('div', 'instructions');
$this->raw($instr); $this->raw($instr);
@ -368,7 +357,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showForm($error=null) function showForm($error=null)
{ {
$this->error = $error; $this->error = $error;
@ -383,7 +371,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
if ($this->registered) { if ($this->registered) {
@ -398,7 +385,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showFormContent() function showFormContent()
{ {
$code = $this->trimmed('code'); $code = $this->trimmed('code');
@ -444,23 +430,23 @@ class RegisterAction extends Action
if ($this->invite && $this->invite->address_type == 'email') { if ($this->invite && $this->invite->address_type == 'email') {
$this->input('email', _('Email'), $this->invite->address, $this->input('email', _('Email'), $this->invite->address,
_('Used only for updates, announcements, '. _('Used only for updates, announcements, '.
'and password recovery')); 'and password recovery.'));
} else { } else {
$this->input('email', _('Email'), $this->trimmed('email'), $this->input('email', _('Email'), $this->trimmed('email'),
_('Used only for updates, announcements, '. _('Used only for updates, announcements, '.
'and password recovery')); 'and password recovery.'));
} }
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->input('fullname', _('Full name'), $this->input('fullname', _('Full name'),
$this->trimmed('fullname'), $this->trimmed('fullname'),
_('Longer name, preferably your "real" name')); _('Longer name, preferably your "real" name.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->input('homepage', _('Homepage'), $this->input('homepage', _('Homepage'),
$this->trimmed('homepage'), $this->trimmed('homepage'),
_('URL of your homepage, blog, '. _('URL of your homepage, blog, '.
'or profile on another site')); 'or profile on another site.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$maxBio = Profile::maxBio(); $maxBio = Profile::maxBio();
@ -483,7 +469,7 @@ class RegisterAction extends Action
$this->input('location', _('Location'), $this->input('location', _('Location'),
$this->trimmed('location'), $this->trimmed('location'),
_('Where you are, like "City, '. _('Where you are, like "City, '.
'State (or Region), Country"')); 'State (or Region), Country".'));
$this->elementEnd('li'); $this->elementEnd('li');
Event::handle('EndRegistrationFormData', array($this)); Event::handle('EndRegistrationFormData', array($this));
$this->elementStart('li', array('id' => 'settings_rememberme')); $this->elementStart('li', array('id' => 'settings_rememberme'));
@ -519,6 +505,7 @@ class RegisterAction extends Action
switch (common_config('license', 'type')) { switch (common_config('license', 'type')) {
case 'private': case 'private':
// TRANS: Copyright checkbox label in registration dialog, for private sites. // TRANS: Copyright checkbox label in registration dialog, for private sites.
// TRANS: %1$s is the StatusNet sitename.
$out .= htmlspecialchars(sprintf( $out .= htmlspecialchars(sprintf(
_('I understand that content and data of %1$s are private and confidential.'), _('I understand that content and data of %1$s are private and confidential.'),
common_config('site', 'name'))); common_config('site', 'name')));
@ -562,7 +549,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showSuccess() function showSuccess()
{ {
$this->registered = true; $this->registered = true;
@ -576,7 +562,6 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showSuccessContent() function showSuccessContent()
{ {
$nickname = $this->arg('nickname'); $nickname = $this->arg('nickname');
@ -623,11 +608,9 @@ class RegisterAction extends Action
* *
* @return void * @return void
*/ */
function showLocalNav() function showLocalNav()
{ {
$nav = new LoginGroupNav($this); $nav = new LoginGroupNav($this);
$nav->show(); $nav->show();
} }
} }

View File

@ -126,11 +126,11 @@ class RemotesubscribeAction extends Action
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
$this->input('nickname', _('User nickname'), $this->nickname, $this->input('nickname', _('User nickname'), $this->nickname,
_('Nickname of the user you want to follow')); _('Nickname of the user you want to follow.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->input('profile_url', _('Profile URL'), $this->profile_url, $this->input('profile_url', _('Profile URL'), $this->profile_url,
_('URL of your profile on another compatible microblogging service')); _('URL of your profile on another compatible microblogging service.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->submit('submit', _('Subscribe')); $this->submit('submit', _('Subscribe'));
@ -155,7 +155,7 @@ class RemotesubscribeAction extends Action
} }
if (!common_valid_http_url($this->profile_url)) { if (!common_valid_http_url($this->profile_url)) {
$this->showForm(_('Invalid profile URL (bad format)')); $this->showForm(_('Invalid profile URL (bad format).'));
return; return;
} }

View File

@ -72,7 +72,7 @@ class RepeatAction extends Action
} }
if ($this->user->id == $this->notice->profile_id) { if ($this->user->id == $this->notice->profile_id) {
$this->clientError(_("You cannot repeat your own notice.")); $this->clientError(_('You cannot repeat your own notice.'));
return false; return false;
} }

View File

@ -25,7 +25,6 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class RepliesrssAction extends Rss10Action class RepliesrssAction extends Rss10Action
{ {
var $user = null; var $user = null;
function prepare($args) function prepare($args)
@ -35,6 +34,7 @@ class RepliesrssAction extends Rss10Action
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} else { } else {
@ -45,13 +45,12 @@ class RepliesrssAction extends Rss10Action
function getNotices($limit=0) function getNotices($limit=0)
{ {
$user = $this->user; $user = $this->user;
$notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit); $notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
$notices = array(); $notices = array();
while ($notice->fetch()) { while ($notice->fetch()) {
$notices[] = clone($notice); $notices[] = clone($notice);
} }
@ -65,11 +64,14 @@ class RepliesrssAction extends Rss10Action
$c = array('url' => common_local_url('repliesrss', $c = array('url' => common_local_url('repliesrss',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
// TRANS: RSS reply feed title. %s is a user nickname.
'title' => sprintf(_("Replies to %s"), $user->nickname), 'title' => sprintf(_("Replies to %s"), $user->nickname),
'link' => common_local_url('replies', 'link' => common_local_url('replies',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
'description' => sprintf(_('Replies to %1$s on %2$s!'), // TRANS: RSS reply feed description.
// TRANS: %1$s is a user nickname, %2$s is the StatusNet site name.
'description' => sprintf(_('Replies to %1$s on %2$s.'),
$user->nickname, common_config('site', 'name'))); $user->nickname, common_config('site', 'name')));
return $c; return $c;
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Request token action class. * Request token action class.
* *
@ -77,4 +76,3 @@ class RequesttokenAction extends Action
} }
} }
} }
?>

View File

@ -57,7 +57,7 @@ class RestoreaccountAction extends Action
function title() function title()
{ {
// TRANS: Page title for page where a user account can be restored from backup. // TRANS: Page title for page where a user account can be restored from backup.
return _("Restore account"); return _('Restore account');
} }
/** /**

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RobotstxtAction extends Action class RobotstxtAction extends Action
{ {
/** /**
@ -53,7 +52,6 @@ class RobotstxtAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
if (Event::handle('StartRobotsTxt', array($this))) { if (Event::handle('StartRobotsTxt', array($this))) {
@ -65,9 +63,7 @@ class RobotstxtAction extends Action
if (common_config('site', 'private')) { if (common_config('site', 'private')) {
print "Disallow: /\n"; print "Disallow: /\n";
} else { } else {
$disallow = common_config('robotstxt', 'disallow'); $disallow = common_config('robotstxt', 'disallow');
foreach ($disallow as $dir) { foreach ($disallow as $dir) {
@ -92,7 +88,6 @@ class RobotstxtAction extends Action
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;

View File

@ -68,13 +68,11 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RsdAction extends Action class RsdAction extends Action
{ {
/** /**
* Optional attribute for the personal rsd.xml file. * Optional attribute for the personal rsd.xml file.
*/ */
var $user = null; var $user = null;
/** /**
@ -87,7 +85,6 @@ class RsdAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -132,7 +129,6 @@ class RsdAction extends Action
* *
* @return nothing * @return nothing
*/ */
function handle($args) function handle($args)
{ {
header('Content-Type: application/rsd+xml'); header('Content-Type: application/rsd+xml');
@ -195,7 +191,6 @@ class RsdAction extends Action
* *
* @return string date of last change of this page * @return string date of last change of this page
*/ */
function lastModified() function lastModified()
{ {
if (!empty($this->user)) { if (!empty($this->user)) {
@ -214,7 +209,6 @@ class RsdAction extends Action
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
@ -228,7 +222,6 @@ class RsdAction extends Action
* *
* @return string API root URI for this site * @return string API root URI for this site
*/ */
private function _apiRoot() private function _apiRoot()
{ {
if (common_config('site', 'fancy')) { if (common_config('site', 'fancy')) {

View File

@ -40,19 +40,16 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @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 ShowApplicationAction extends OwnerDesignAction class ShowApplicationAction extends OwnerDesignAction
{ {
/** /**
* Application to show * Application to show
*/ */
var $application = null; var $application = null;
/** /**
* User who owns the app * User who owns the app
*/ */
var $owner = null; var $owner = null;
var $msg = null; var $msg = null;
@ -68,7 +65,6 @@ class ShowApplicationAction extends OwnerDesignAction
* *
* @return success flag * @return success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -105,7 +101,6 @@ class ShowApplicationAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -132,7 +127,6 @@ class ShowApplicationAction extends OwnerDesignAction
* *
* @return string title of the page * @return string title of the page
*/ */
function title() function title()
{ {
if (!empty($this->application->name)) { if (!empty($this->application->name)) {
@ -301,7 +295,6 @@ class ShowApplicationAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function showScripts() function showScripts()
{ {
parent::showScripts(); parent::showScripts();
@ -322,7 +315,6 @@ class ShowApplicationAction extends OwnerDesignAction
* XXX: Should this be moved to its own page with a confirm? * XXX: Should this be moved to its own page with a confirm?
* *
*/ */
function resetKey() function resetKey()
{ {
$this->application->query('BEGIN'); $this->application->query('BEGIN');
@ -382,5 +374,4 @@ class ShowApplicationAction extends OwnerDesignAction
$this->msg = ('Consumer key and secret reset.'); $this->msg = ('Consumer key and secret reset.');
$this->showPage(); $this->showPage();
} }
} }

View File

@ -344,7 +344,7 @@ class SingleNoticeItem extends DoFollowListItem
* show the avatar of the notice's author * show the avatar of the notice's author
* *
* We use the larger size for single notice page. * We use the larger size for single notice page.
* *
* @return void * @return void
*/ */

View File

@ -70,7 +70,7 @@ class ShowstreamAction extends ProfileAction
return sprintf(_('%1$s tagged %2$s'), $base, $this->tag); return sprintf(_('%1$s tagged %2$s'), $base, $this->tag);
} else { } else {
// TRANS: Page title showing tagged notices in one user's stream. // TRANS: Page title showing tagged notices in one user's stream.
// TRANS: %1$s is the username, %2$s is the hash tag, %1$d is the page number. // TRANS: %1$s is the username, %2$s is the hash tag, %3$d is the page number.
return sprintf(_('%1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page); return sprintf(_('%1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page);
} }
} else { } else {

View File

@ -98,7 +98,7 @@ class SitenoticeadminpanelAction extends AdminPanelAction
if (!$result) { if (!$result) {
// TRANS: Server error displayed when saving a site-wide notice was impossible. // TRANS: Server error displayed when saving a site-wide notice was impossible.
$this->ServerError(_("Unable to save site notice.")); $this->ServerError(_('Unable to save site notice.'));
} }
} }
@ -198,7 +198,7 @@ class SiteNoticeAdminPanelForm extends AdminForm
'submit', 'submit',
null, null,
// TRANS: Title for button to save site notice in admin panel. // TRANS: Title for button to save site notice in admin panel.
_('Save site notice') _('Save site notice.')
); );
} }
} }

View File

@ -150,7 +150,7 @@ class SmssettingsAction extends ConnectSettingsAction
($this->arg('sms')) ? $this->arg('sms') : null, ($this->arg('sms')) ? $this->arg('sms') : null,
// TRANS: SMS phone number input field instructions in SMS settings form. // TRANS: SMS phone number input field instructions in SMS settings form.
_('Phone number, no punctuation or spaces, '. _('Phone number, no punctuation or spaces, '.
'with area code')); 'with area code.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->carrierSelect(); $this->carrierSelect();
@ -562,9 +562,11 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
$this->serverError(_("Could not update user record.")); // TRANS: Server error displayed when the user could not be updated in SMS settings.
$this->serverError(_('Could not update user record.'));
} }
// TRANS: Confirmation text after updating SMS settings.
$this->showForm(_('Incoming email address removed.'), true); $this->showForm(_('Incoming email address removed.'), true);
} }
@ -585,9 +587,11 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
$this->serverError(_("Could not update user record.")); // TRANS: Server error displayed when the user could not be updated in SMS settings.
$this->serverError(_('Could not update user record.'));
} }
// TRANS: Confirmation text after updating SMS settings.
$this->showForm(_('New incoming email address added.'), true); $this->showForm(_('New incoming email address added.'), true);
} }
} }

View File

@ -53,7 +53,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class SubscribeAction extends Action class SubscribeAction extends Action
{ {
var $user; var $user;
@ -66,7 +65,6 @@ class SubscribeAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -74,6 +72,8 @@ class SubscribeAction extends Action
// Only allow POST requests // Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') { if ($_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: Client error displayed trying to perform any request method other than POST.
// TRANS: Do not translate POST.
$this->clientError(_('This action only accepts POST requests.')); $this->clientError(_('This action only accepts POST requests.'));
return false; return false;
} }
@ -83,6 +83,7 @@ class SubscribeAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token is not okay.
$this->clientError(_('There was a problem with your session token.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -93,6 +94,7 @@ class SubscribeAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed trying to subscribe when not logged in.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -104,6 +106,7 @@ class SubscribeAction extends Action
$this->other = Profile::staticGet('id', $other_id); $this->other = Profile::staticGet('id', $other_id);
if (empty($this->other)) { if (empty($this->other)) {
// TRANS: Client error displayed trying to subscribe to a non-existing profile.
$this->clientError(_('No such profile.')); $this->clientError(_('No such profile.'));
return false; return false;
} }
@ -114,6 +117,7 @@ class SubscribeAction extends Action
$omb01 = Remote_profile::staticGet('id', $other_id); $omb01 = Remote_profile::staticGet('id', $other_id);
if (!empty($omb01)) { if (!empty($omb01)) {
// TRANS: Client error displayed trying to subscribe to an OMB 0.1 remote profile.
$this->clientError(_('You cannot subscribe to an OMB 0.1'. $this->clientError(_('You cannot subscribe to an OMB 0.1'.
' remote profile with this action.')); ' remote profile with this action.'));
return false; return false;
@ -131,7 +135,6 @@ class SubscribeAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
// Throws exception on error // Throws exception on error
@ -142,6 +145,7 @@ class SubscribeAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Page title when subscription succeeded.
$this->element('title', null, _('Subscribed')); $this->element('title', null, _('Subscribed'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');

View File

@ -19,6 +19,7 @@
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
// @todo FIXME: documentation needed.
class SupAction extends Action class SupAction extends Action
{ {
function handle($args) function handle($args)

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class UnblockAction extends ProfileFormAction class UnblockAction extends ProfileFormAction
{ {
function prepare($args) function prepare($args)
@ -56,6 +55,7 @@ class UnblockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasBlocked($this->profile)) { if (!$cur->hasBlocked($this->profile)) {
// TRANS: Client error displayed when trying to unblock a non-blocked user.
$this->clientError(_("You haven't blocked that user.")); $this->clientError(_("You haven't blocked that user."));
return false; return false;
} }
@ -68,7 +68,6 @@ class UnblockAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
$cur = common_current_user(); $cur = common_current_user();
@ -83,6 +82,7 @@ class UnblockAction extends ProfileFormAction
} }
if (!$result) { if (!$result) {
// TRANS: Server error displayed when removing a user block.
$this->serverError(_('Error removing the block.')); $this->serverError(_('Error removing the block.'));
return; return;
} }

View File

@ -163,7 +163,7 @@ class UseradminpanelAction extends AdminPanelAction
sprintf( sprintf(
// TRANS: Client error displayed when trying to set a non-existing user as default subscription for new // TRANS: Client error displayed when trying to set a non-existing user as default subscription for new
// TRANS: users in user admin panel. %1$s is the invalid nickname. // TRANS: users in user admin panel. %1$s is the invalid nickname.
_('Invalid default subscripton: \'%1$s\' is not a user.'), _('Invalid default subscripton: "%1$s" is not a user.'),
$values['newuser']['default'] $values['newuser']['default']
) )
); );
@ -299,6 +299,6 @@ class UserAdminPanelForm extends AdminForm
'submit', 'submit',
null, null,
// TRANS: Title for button to save user settings in user admin panel. // TRANS: Title for button to save user settings in user admin panel.
_('Save user settings')); _('Save user settings.'));
} }
} }

View File

@ -35,6 +35,7 @@ require_once INSTALLDIR.'/extlib/libomb/service_provider.php';
require_once INSTALLDIR.'/extlib/libomb/profile.php'; require_once INSTALLDIR.'/extlib/libomb/profile.php';
define('TIMESTAMP_THRESHOLD', 300); define('TIMESTAMP_THRESHOLD', 300);
// @todo FIXME: Missing documentation.
class UserauthorizationAction extends Action class UserauthorizationAction extends Action
{ {
var $error; var $error;
@ -69,6 +70,8 @@ class UserauthorizationAction extends Action
$profile = $user->getProfile(); $profile = $user->getProfile();
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
// TRANS: Server error displayed when trying to authorise a remote subscription request
// TRANS: while the user has no profile.
$this->serverError(_('User without matching profile.')); $this->serverError(_('User without matching profile.'));
return; return;
} }
@ -102,16 +105,18 @@ class UserauthorizationAction extends Action
function title() function title()
{ {
// TRANS: Page title.
return _('Authorize subscription'); return _('Authorize subscription');
} }
function showPageNotice() function showPageNotice()
{ {
// TRANS: Page notice on "Auhtorize subscription" page.
$this->element('p', null, _('Please check these details to make sure '. $this->element('p', null, _('Please check these details to make sure '.
'that you want to subscribe to this ' . 'that you want to subscribe to this ' .
'users notices. If you didnt just ask ' . 'users notices. If you didnt just ask ' .
'to subscribe to someones notices, '. 'to subscribe to someones notices, '.
'click “Reject”.')); 'click "Reject".'));
} }
function showContent() function showContent()
@ -129,6 +134,7 @@ class UserauthorizationAction extends Action
$this->elementStart('div', 'entity_profile vcard'); $this->elementStart('div', 'entity_profile vcard');
$this->elementStart('dl', 'entity_depiction'); $this->elementStart('dl', 'entity_depiction');
// TRANS: DT element on Authorise Subscription page.
$this->element('dt', null, _('Photo')); $this->element('dt', null, _('Photo'));
$this->elementStart('dd'); $this->elementStart('dd');
if ($avatar) { if ($avatar) {
@ -142,6 +148,7 @@ class UserauthorizationAction extends Action
$this->elementEnd('dl'); $this->elementEnd('dl');
$this->elementStart('dl', 'entity_nickname'); $this->elementStart('dl', 'entity_nickname');
// TRANS: DT element on Authorise Subscription page.
$this->element('dt', null, _('Nickname')); $this->element('dt', null, _('Nickname'));
$this->elementStart('dd'); $this->elementStart('dd');
$hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname'; $hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname';
@ -163,6 +170,7 @@ class UserauthorizationAction extends Action
} }
if (!is_null($location)) { if (!is_null($location)) {
$this->elementStart('dl', 'entity_location'); $this->elementStart('dl', 'entity_location');
// TRANS: DT element on Authorise Subscription page.
$this->element('dt', null, _('Location')); $this->element('dt', null, _('Location'));
$this->elementStart('dd', 'label'); $this->elementStart('dd', 'label');
$this->raw($location); $this->raw($location);
@ -172,6 +180,7 @@ class UserauthorizationAction extends Action
if (!is_null($homepage)) { if (!is_null($homepage)) {
$this->elementStart('dl', 'entity_url'); $this->elementStart('dl', 'entity_url');
// TRANS: DT element on Authorise Subscription page.
$this->element('dt', null, _('URL')); $this->element('dt', null, _('URL'));
$this->elementStart('dd'); $this->elementStart('dd');
$this->elementStart('a', array('href' => $homepage, $this->elementStart('a', array('href' => $homepage,
@ -184,6 +193,7 @@ class UserauthorizationAction extends Action
if (!is_null($bio)) { if (!is_null($bio)) {
$this->elementStart('dl', 'entity_note'); $this->elementStart('dl', 'entity_note');
// TRANS: DT element on Authorise Subscription page where bio is displayed.
$this->element('dt', null, _('Note')); $this->element('dt', null, _('Note'));
$this->elementStart('dd', 'note'); $this->elementStart('dd', 'note');
$this->raw($bio); $this->raw($bio);
@ -193,6 +203,7 @@ class UserauthorizationAction extends Action
if (!is_null($license)) { if (!is_null($license)) {
$this->elementStart('dl', 'entity_license'); $this->elementStart('dl', 'entity_license');
// TRANS: DT element on Authorise Subscription page where license is displayed.
$this->element('dt', null, _('License')); $this->element('dt', null, _('License'));
$this->elementStart('dd', 'license'); $this->elementStart('dd', 'license');
$this->element('a', array('href' => $license, $this->element('a', array('href' => $license,
@ -214,10 +225,14 @@ class UserauthorizationAction extends Action
'userauthorization'))); 'userauthorization')));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->submit('accept', _('Accept'), 'submit accept', null, // TRANS: Button text on Authorise Subscription page.
_('Subscribe to this user')); $this->submit('accept', _m('BUTTON','Accept'), 'submit accept', null,
$this->submit('reject', _('Reject'), 'submit reject', null, // TRANS: Title for button on Authorise Subscription page.
_('Reject this subscription')); _('Subscribe to this user.'));
// TRANS: Button text on Authorise Subscription page.
$this->submit('reject', _m('BUTTON','Reject'), 'submit reject', null,
// TRANS: Title for button on Authorise Subscription page.
_('Reject this subscription.'));
$this->elementEnd('form'); $this->elementEnd('form');
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
@ -229,6 +244,7 @@ class UserauthorizationAction extends Action
$srv = $this->getStoredParams(); $srv = $this->getStoredParams();
if (is_null($srv)) { if (is_null($srv)) {
// TRANS: Client error displayed for an empty authorisation request.
$this->clientError(_('No authorization request!')); $this->clientError(_('No authorization request!'));
return; return;
} }
@ -251,7 +267,9 @@ class UserauthorizationAction extends Action
function showAcceptMessage($tok) function showAcceptMessage($tok)
{ {
// TRANS: Accept message header from Authorise subscription page.
common_show_header(_('Subscription authorized')); common_show_header(_('Subscription authorized'));
// TRANS: Accept message text from Authorise subscription page.
$this->element('p', null, $this->element('p', null,
_('The subscription has been authorized, but no '. _('The subscription has been authorized, but no '.
'callback URL was passed. Check with the sites ' . 'callback URL was passed. Check with the sites ' .
@ -263,7 +281,9 @@ class UserauthorizationAction extends Action
function showRejectMessage() function showRejectMessage()
{ {
// TRANS: Reject message header from Authorise subscription page.
common_show_header(_('Subscription rejected')); common_show_header(_('Subscription rejected'));
// TRANS: Reject message from Authorise subscription page.
$this->element('p', null, $this->element('p', null,
_('The subscription has been rejected, but no '. _('The subscription has been rejected, but no '.
'callback URL was passed. Check with the sites ' . 'callback URL was passed. Check with the sites ' .
@ -300,18 +320,24 @@ class UserauthorizationAction extends Action
$user = User::staticGet('uri', $listener); $user = User::staticGet('uri', $listener);
if (!$user) { if (!$user) {
throw new Exception(sprintf(_('Listener URI %s not found here.'), // TRANS: Exception thrown when no valid user is found for an authorisation request.
// TRANS: %s is a listener URI.
throw new Exception(sprintf(_('Listener URI "%s" not found here.'),
$listener)); $listener));
} }
if (strlen($listenee) > 255) { if (strlen($listenee) > 255) {
throw new Exception(sprintf(_('Listenee URI %s is too long.'), // TRANS: Exception thrown when listenee URI is too long for an authorisation request.
// TRANS: %s is a listenee URI.
throw new Exception(sprintf(_('Listenee URI "%s" is too long.'),
$listenee)); $listenee));
} }
$other = User::staticGet('uri', $listenee); $other = User::staticGet('uri', $listenee);
if ($other) { if ($other) {
throw new Exception(sprintf(_('Listenee URI %s is a local user.'), // TRANS: Exception thrown when listenee URI is a local user for an authorisation request.
// TRANS: %s is a listenee URI.
throw new Exception(sprintf(_('Listenee URI "%s" is a local user.'),
$listenee)); $listenee));
} }
@ -321,12 +347,15 @@ class UserauthorizationAction extends Action
$sub->subscriber = $user->id; $sub->subscriber = $user->id;
$sub->subscribed = $remote->id; $sub->subscribed = $remote->id;
if ($sub->find(true)) { if ($sub->find(true)) {
// TRANS: Exception thrown when already subscribed.
throw new Exception('You are already subscribed to this user.'); throw new Exception('You are already subscribed to this user.');
} }
} }
if ($profile == common_profile_url($nickname)) { if ($profile == common_profile_url($nickname)) {
throw new Exception(sprintf(_('Profile URL %s is for a local user.'), // TRANS: Exception thrown when profile URL is a local user for an authorisation request.
// TRANS: %s is a profile URL.
throw new Exception(sprintf(_('Profile URL "%s" is for a local user.'),
$profile)); $profile));
} }
@ -334,26 +363,34 @@ class UserauthorizationAction extends Action
$license = $_GET['omb_listenee_license']; $license = $_GET['omb_listenee_license'];
$site_license = common_config('license', 'url'); $site_license = common_config('license', 'url');
if (!common_compatible_license($license, $site_license)) { if (!common_compatible_license($license, $site_license)) {
throw new Exception(sprintf(_('Listenee stream license %1$s is not ' . // TRANS: Exception thrown when licenses are not compatible for an authorisation request.
'compatible with site license %2$s.'), // TRANS: %1$s is the license for the listenee, %2$s is the license for "this" StatusNet site.
throw new Exception(sprintf(_('Listenee stream license "%1$s" is not ' .
'compatible with site license "%2$s".'),
$license, $site_license)); $license, $site_license));
} }
$avatar = $_GET['omb_listenee_avatar']; $avatar = $_GET['omb_listenee_avatar'];
if ($avatar) { if ($avatar) {
if (!common_valid_http_url($avatar) || strlen($avatar) > 255) { if (!common_valid_http_url($avatar) || strlen($avatar) > 255) {
throw new Exception(sprintf(_('Avatar URL %s is not valid.'), // TRANS: Exception thrown when avatar URL is invalid for an authorisation request.
// TRANS: %s is an avatar URL.
throw new Exception(sprintf(_('Avatar URL "%s" is not valid.'),
$avatar)); $avatar));
} }
$size = @getimagesize($avatar); $size = @getimagesize($avatar);
if (!$size) { if (!$size) {
throw new Exception(sprintf(_('Cant read avatar URL %s.'), // TRANS: Exception thrown when avatar URL could not be read for an authorisation request.
// TRANS: %s is an avatar URL.
throw new Exception(sprintf(_('Cannot read avatar URL "%s".'),
$avatar)); $avatar));
} }
if (!in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, if (!in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG,
IMAGETYPE_PNG))) { IMAGETYPE_PNG))) {
// TRANS: Exception thrown when avatar URL return an invalid image type for an authorisation request.
// TRANS: %s is an avatar URL.
throw new Exception(sprintf(_('Wrong image type for avatar URL '. throw new Exception(sprintf(_('Wrong image type for avatar URL '.
'%s.'), $avatar)); '"%s".'), $avatar));
} }
} }
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* User by ID action class. * User by ID action class.
* *
@ -67,10 +66,12 @@ class UserbyidAction extends Action
parent::handle($args); parent::handle($args);
$id = $this->trimmed('id'); $id = $this->trimmed('id');
if (!$id) { if (!$id) {
// TRANS: Client error displayed trying to find a user by ID without providing an ID.
$this->clientError(_('No ID.')); $this->clientError(_('No ID.'));
} }
$user = User::staticGet($id); $user = User::staticGet($id);
if (!$user) { if (!$user) {
// TRANS: Client error displayed trying to find a user by ID for a non-existing ID.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
} }

View File

@ -56,7 +56,7 @@ class UserxrdAction extends XrdAction
} }
if (!$this->user) { if (!$this->user) {
$this->clientError(_m('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* XRDS for OpenMicroBlogging * XRDS for OpenMicroBlogging
* *
@ -61,13 +60,14 @@ class XrdsAction extends Action
{ {
return true; return true;
} }
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed providing a non-existing nickname.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return; return;
} }
@ -110,7 +110,7 @@ class XrdsAction extends Action
null, null,
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1)); array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
$xrdsOutputter->elementEnd('XRD'); $xrdsOutputter->elementEnd('XRD');
//omb //omb
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', $xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
'xml:id' => 'omb', 'xml:id' => 'omb',
@ -122,7 +122,7 @@ class XrdsAction extends Action
$xrdsOutputter->showXrdsService(OMB_ENDPOINT_UPDATEPROFILE, $xrdsOutputter->showXrdsService(OMB_ENDPOINT_UPDATEPROFILE,
common_local_url('updateprofile')); common_local_url('updateprofile'));
$xrdsOutputter->elementEnd('XRD'); $xrdsOutputter->elementEnd('XRD');
Event::handle('EndUserXRDS', array($this,&$xrdsOutputter)); Event::handle('EndUserXRDS', array($this,&$xrdsOutputter));
//misc //misc
@ -135,7 +135,5 @@ class XrdsAction extends Action
$xrdsOutputter->elementEnd('XRD'); $xrdsOutputter->elementEnd('XRD');
$xrdsOutputter->endXRDS(); $xrdsOutputter->endXRDS();
} }
} }
?>

View File

@ -162,6 +162,14 @@ class Plugin
$path = common_config('site', 'path') . '/plugins/'; $path = common_config('site', 'path') . '/plugins/';
} }
if ($path[strlen($path)-1] != '/') {
$path .= '/';
}
if ($path[0] != '/') {
$path = '/'.$path;
}
$protocol = ($isHTTPS) ? 'https' : 'http'; $protocol = ($isHTTPS) ? 'https' : 'http';
return $protocol.'://'.$server.$path.$plugin.'/'.$relative; return $protocol.'://'.$server.$path.$plugin.'/'.$relative;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
# Translation of StatusNet - BitlyUrl to Catalan (Català)
# Exported from translatewiki.net
#
# Author: Toniher
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - BitlyUrl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-17 10:25+0000\n"
"PO-Revision-Date: 2011-02-17 10:27:59+0000\n"
"Language-Team: Catalan <http://translatewiki.net/wiki/Portal:ca>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-01-29 22:19:24+0000\n"
"X-Generator: MediaWiki 1.18alpha (r82325); Translate extension (2011-02-01)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: ca\n"
"X-Message-Group: #out-statusnet-plugin-bitlyurl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: BitlyUrlPlugin.php:48
msgid "You must specify a serviceUrl for bit.ly shortening."
msgstr "Heu d'especificar un URL de servei per a l'escurçament de bit.ly"
#: BitlyUrlPlugin.php:175
#, php-format
msgid "Uses <a href=\"http://%1$s/\">%1$s</a> URL-shortener service."
msgstr ""
"Fa servir el servei d'escurçament d'URL <a href=\"http://%1$s/\">%1$s</a>."
#: BitlyUrlPlugin.php:216
msgid "bit.ly"
msgstr "bit.ly"
#: BitlyUrlPlugin.php:217 bitlyadminpanelaction.php:54
msgid "bit.ly URL shortening"
msgstr "Escurçament d'URL bit.ly"
#: bitlyadminpanelaction.php:65
msgid ""
"URL shortening with bit.ly requires [a bit.ly account and API key](http://"
"bit.ly/a/your_api_key). This verifies that this is an authorized account, "
"and allow you to use bit.ly's tracking features and custom domains."
msgstr ""
"L'escurçament d'URL amb bit.ly necessita [un compte i clau API de bit.ly]"
"(http://bit.ly/a/your_api_key). Això verifica que és un compte autoritzat, i "
"permet fer servir les característiques de seguiment de bit.ly i els dominis "
"personalitzats."
#: bitlyadminpanelaction.php:132
msgid "Invalid login. Max length is 255 characters."
msgstr "Inici de sessió no vàlid. La longitud màxima és de 255 caràcters."
#: bitlyadminpanelaction.php:138
msgid "Invalid API key. Max length is 255 characters."
msgstr "Clau API no vàlida. La longitud màxima és de 255 caràcters."
#: bitlyadminpanelaction.php:191
msgid "Credentials"
msgstr "Credencials"
#: bitlyadminpanelaction.php:199
msgid "Leave these empty to use global default credentials."
msgstr "Deixa-ho en blanc i fes servir les credencials per defecte globals."
#: bitlyadminpanelaction.php:202
msgid "If you leave these empty, bit.ly will be unavailable to users."
msgstr "Si ho deixeu en blanc, el bit.ly no serà disponible per als usuaris."
#: bitlyadminpanelaction.php:209
msgid "Login name"
msgstr "Nom de sessió"
#: bitlyadminpanelaction.php:218
msgid "API key"
msgstr "Clau API"
#: bitlyadminpanelaction.php:236
msgid "Save bit.ly settings"
msgstr "Desa els paràmetres de bit.ly"

View File

@ -0,0 +1,30 @@
# Translation of StatusNet - EmailAuthentication to Catalan (Català)
# Exported from translatewiki.net
#
# Author: Toniher
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - EmailAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-17 10:25+0000\n"
"PO-Revision-Date: 2011-02-17 10:28:10+0000\n"
"Language-Team: Catalan <http://translatewiki.net/wiki/Portal:ca>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-01-29 22:24:10+0000\n"
"X-Generator: MediaWiki 1.18alpha (r82325); Translate extension (2011-02-01)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: ca\n"
"X-Message-Group: #out-statusnet-plugin-emailauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: EmailAuthenticationPlugin.php:60
msgid ""
"The Email Authentication plugin allows users to login using their email "
"address."
msgstr ""
"El connector d'autenticació per correu electrònic permet als usuaris a "
"iniciar una sessió fent servir l'adreça electrònica."

View File

@ -62,15 +62,15 @@ class EmailSummaryPlugin extends Plugin
array(new ColumnDef('user_id', 'integer', null, array(new ColumnDef('user_id', 'integer', null,
false, 'PRI'), false, 'PRI'),
new ColumnDef('send_summary', 'tinyint', null, new ColumnDef('send_summary', 'tinyint', null,
false, null, 1), false, null, 1),
new ColumnDef('last_summary_id', 'integer', null, new ColumnDef('last_summary_id', 'integer', null,
true), true),
new ColumnDef('created', 'datetime', null, new ColumnDef('created', 'datetime', null,
false), false),
new ColumnDef('modified', 'datetime', null, new ColumnDef('modified', 'datetime', null,
false), false),
) )
); );
return true; return true;
} }
@ -88,17 +88,17 @@ class EmailSummaryPlugin extends Plugin
$dir = dirname(__FILE__); $dir = dirname(__FILE__);
switch ($cls) switch ($cls)
{ {
case 'SiteEmailSummaryHandler': case 'SiteEmailSummaryHandler':
case 'UserEmailSummaryHandler': case 'UserEmailSummaryHandler':
include_once $dir . '/'.strtolower($cls).'.php'; include_once $dir . '/'.strtolower($cls).'.php';
return false;
case 'Email_summary_status':
include_once $dir . '/'.$cls.'.php';
return false; return false;
default: case 'Email_summary_status':
return true; include_once $dir . '/'.$cls.'.php';
} return false;
default:
return true;
}
} }
/** /**
@ -131,9 +131,9 @@ class EmailSummaryPlugin extends Plugin
function onEndInitializeQueueManager($qm) function onEndInitializeQueueManager($qm)
{ {
$qm->connect('sitesum', 'SiteEmailSummaryHandler'); $qm->connect('sitesum', 'SiteEmailSummaryHandler');
$qm->connect('usersum', 'UserEmailSummaryHandler'); $qm->connect('usersum', 'UserEmailSummaryHandler');
return true; return true;
} }
/** /**
@ -146,15 +146,15 @@ class EmailSummaryPlugin extends Plugin
function onEndEmailFormData($action) function onEndEmailFormData($action)
{ {
$user = common_current_user(); $user = common_current_user();
$action->elementStart('li'); $action->elementStart('li');
$action->checkbox('emailsummary', $action->checkbox('emailsummary',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Send me a periodic summary of updates from my network.'), _('Send me a periodic summary of updates from my network.'),
Email_summary_status::getSendSummary($user->id)); Email_summary_status::getSendSummary($user->id));
$action->elementEnd('li'); $action->elementEnd('li');
return true; return true;
} }
/** /**
@ -167,36 +167,36 @@ class EmailSummaryPlugin extends Plugin
function onEndEmailSaveForm($action) function onEndEmailSaveForm($action)
{ {
$sendSummary = $action->boolean('emailsummary'); $sendSummary = $action->boolean('emailsummary');
$user = common_current_user(); $user = common_current_user();
if (!empty($user)) { if (!empty($user)) {
$ess = Email_summary_status::staticGet('user_id', $user->id); $ess = Email_summary_status::staticGet('user_id', $user->id);
if (empty($ess)) { if (empty($ess)) {
$ess = new Email_summary_status(); $ess = new Email_summary_status();
$ess->user_id = $user->id; $ess->user_id = $user->id;
$ess->send_summary = $sendSummary; $ess->send_summary = $sendSummary;
$ess->created = common_sql_now(); $ess->created = common_sql_now();
$ess->modified = common_sql_now(); $ess->modified = common_sql_now();
$ess->insert(); $ess->insert();
} else { } else {
$orig = clone($ess); $orig = clone($ess);
$ess->send_summary = $sendSummary; $ess->send_summary = $sendSummary;
$ess->modified = common_sql_now(); $ess->modified = common_sql_now();
$ess->update($orig); $ess->update($orig);
} }
} }
return true; return true;
} }
} }

View File

@ -82,10 +82,10 @@ class Email_summary_status extends Memcached_DataObject
function table() function table()
{ {
return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
'send_summary' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, 'send_summary' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
'last_summary_id' => DB_DATAOBJECT_INT, 'last_summary_id' => DB_DATAOBJECT_INT,
'created' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL, 'created' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,
'modified' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); 'modified' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);
} }
/** /**
@ -139,11 +139,11 @@ class Email_summary_status extends Memcached_DataObject
{ {
$ess = Email_summary_status::staticGet('user_id', $user_id); $ess = Email_summary_status::staticGet('user_id', $user_id);
if (!empty($ess)) { if (!empty($ess)) {
return $ess->send_summary; return $ess->send_summary;
} else { } else {
return 1; return 1;
} }
} }
/** /**
@ -158,10 +158,10 @@ class Email_summary_status extends Memcached_DataObject
{ {
$ess = Email_summary_status::staticGet('user_id', $user_id); $ess = Email_summary_status::staticGet('user_id', $user_id);
if (!empty($ess)) { if (!empty($ess)) {
return $ess->last_summary_id; return $ess->last_summary_id;
} else { } else {
return null; return null;
} }
} }
} }

View File

@ -0,0 +1,26 @@
# Translation of StatusNet - EmailSummary to Catalan (Català)
# Exported from translatewiki.net
#
# Author: Toniher
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - EmailSummary\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-17 10:25+0000\n"
"PO-Revision-Date: 2011-02-17 10:28:10+0000\n"
"Language-Team: Catalan <http://translatewiki.net/wiki/Portal:ca>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-02-14 17:19:17+0000\n"
"X-Generator: MediaWiki 1.18alpha (r82325); Translate extension (2011-02-01)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: ca\n"
"X-Message-Group: #out-statusnet-plugin-emailsummary\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: EmailSummaryPlugin.php:120
msgid "Send an email summary of the inbox to users."
msgstr "Envia un resum de correu a la safata d'entrada dels usuaris."

View File

@ -1,47 +1,59 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
/* /*
* StatusNet - a distributed open-source microblogging tool * StatusNet - a distributed open-source microblogging tool
* Copyright (C) 2010, StatusNet, Inc. * Copyright (C) 2010, StatusNet, Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));
$shortoptions = 'i:n:a'; $shortoptions = 'i:n:au';
$longoptions = array('id=', 'nickname=', 'all'); $longoptions = array('id=', 'nickname=', 'all', 'universe');
$helptext = <<<END_OF_SENDEMAILSUMMARY_HELP $helptext = <<<END_OF_SENDEMAILSUMMARY_HELP
sendemailsummary.php [options] sendemailsummary.php [options]
Send an email summary of the inbox to users Send an email summary of the inbox to users
-i --id ID of user to send summary to -i --id ID of user to send summary to
-n --nickname nickname of the user to send summary to -n --nickname nickname of the user to send summary to
-a --all send summary to all users -a --all send summary to all users
-u --universe send summary to all users on all sites
END_OF_SENDEMAILSUMMARY_HELP; END_OF_SENDEMAILSUMMARY_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc'; require_once INSTALLDIR.'/scripts/commandline.inc';
$qm = QueueManager::get(); if (have_option('u', 'universe')) {
$sn = new Status_network();
// enqueue summary for user or all users if ($sn->find()) {
while ($sn->fetch()) {
try { $server = $sn->getServerName();
$user = getUser(); StatusNet::init($server);
$qm->enqueue($user->id, 'usersum'); // Different queue manager, maybe!
} catch (NoUserArgumentException $nuae) { $qm = QueueManager::get();
$qm->enqueue(null, 'sitesum'); $qm->enqueue(null, 'sitesum');
}
}
} else {
$qm = QueueManager::get();
// enqueue summary for user or all users
try {
$user = getUser();
$qm->enqueue($user->id, 'usersum');
} catch (NoUserArgumentException $nuae) {
$qm->enqueue(null, 'sitesum');
}
} }

View File

@ -70,27 +70,27 @@ class SiteEmailSummaryHandler extends QueueHandler
function handle($object) function handle($object)
{ {
$qm = QueueManager::get(); $qm = QueueManager::get();
try { try {
// Enqueue a summary for all users // Enqueue a summary for all users
$user = new User(); $user = new User();
$user->find(); $user->find();
while ($user->fetch()) { while ($user->fetch()) {
try { try {
$qm->enqueue($user->id, 'usersum'); $qm->enqueue($user->id, 'usersum');
} catch (Exception $e) { } catch (Exception $e) {
common_log(LOG_WARNING, $e->getMessage()); common_log(LOG_WARNING, $e->getMessage());
continue; continue;
} }
} }
} catch (Exception $e) { } catch (Exception $e) {
common_log(LOG_WARNING, $e->getMessage()); common_log(LOG_WARNING, $e->getMessage());
} }
return true; return true;
} }
} }

View File

@ -72,155 +72,155 @@ class UserEmailSummaryHandler extends QueueHandler
function handle($user_id) function handle($user_id)
{ {
// Skip if they've asked not to get summaries // Skip if they've asked not to get summaries
$ess = Email_summary_status::staticGet('user_id', $user_id); $ess = Email_summary_status::staticGet('user_id', $user_id);
if (!empty($ess) && !$ess->send_summary) { if (!empty($ess) && !$ess->send_summary) {
common_log(LOG_INFO, sprintf('Not sending email summary for user %s by request.', $user_id)); common_log(LOG_INFO, sprintf('Not sending email summary for user %s by request.', $user_id));
return true; return true;
} }
$since_id = null; $since_id = null;
if (!empty($ess)) { if (!empty($ess)) {
$since_id = $ess->last_summary_id; $since_id = $ess->last_summary_id;
} }
$user = User::staticGet('id', $user_id); $user = User::staticGet('id', $user_id);
if (empty($user)) { if (empty($user)) {
common_log(LOG_INFO, sprintf('Not sending email summary for user %s; no such user.', $user_id)); common_log(LOG_INFO, sprintf('Not sending email summary for user %s; no such user.', $user_id));
return true; return true;
} }
if (empty($user->email)) { if (empty($user->email)) {
common_log(LOG_INFO, sprintf('Not sending email summary for user %s; no email address.', $user_id)); common_log(LOG_INFO, sprintf('Not sending email summary for user %s; no email address.', $user_id));
return true; return true;
} }
$profile = $user->getProfile(); $profile = $user->getProfile();
if (empty($profile)) { if (empty($profile)) {
common_log(LOG_WARNING, sprintf('Not sending email summary for user %s; no profile.', $user_id)); common_log(LOG_WARNING, sprintf('Not sending email summary for user %s; no profile.', $user_id));
return true; return true;
} }
$notice = $user->ownFriendsTimeline(0, self::MAX_NOTICES, $since_id); $notice = $user->ownFriendsTimeline(0, self::MAX_NOTICES, $since_id);
if (empty($notice) || $notice->N == 0) { if (empty($notice) || $notice->N == 0) {
common_log(LOG_WARNING, sprintf('Not sending email summary for user %s; no notices.', $user_id)); common_log(LOG_WARNING, sprintf('Not sending email summary for user %s; no notices.', $user_id));
return true; return true;
} }
// XXX: This is risky fingerpoken in der objektvars, but I didn't feel like // XXX: This is risky fingerpoken in der objektvars, but I didn't feel like
// figuring out a better way. -ESP // figuring out a better way. -ESP
$new_top = null; $new_top = null;
if ($notice instanceof ArrayWrapper) { if ($notice instanceof ArrayWrapper) {
$new_top = $notice->_items[0]->id; $new_top = $notice->_items[0]->id;
} }
$out = new XMLStringer(); $out = new XMLStringer();
$out->raw(sprintf(_('<p>Recent updates from %1s for %2s:</p>'), $out->raw(sprintf(_('<p>Recent updates from %1s for %2s:</p>'),
common_config('site', 'name'), common_config('site', 'name'),
$profile->getBestName())); $profile->getBestName()));
$out->elementStart('table', array('width' => '541px', 'style' => 'border: none')); $out->elementStart('table', array('width' => '541px', 'style' => 'border: none'));
while ($notice->fetch()) { while ($notice->fetch()) {
$profile = Profile::staticGet('id', $notice->profile_id); $profile = Profile::staticGet('id', $notice->profile_id);
if (empty($profile)) { if (empty($profile)) {
continue; continue;
} }
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
$out->elementStart('tr'); $out->elementStart('tr');
$out->elementStart('td', array('width' => AVATAR_STREAM_SIZE, $out->elementStart('td', array('width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE,
'align' => 'left', 'align' => 'left',
'valign' => 'top')); 'valign' => 'top'));
$out->element('img', array('src' => ($avatar) ? $out->element('img', array('src' => ($avatar) ?
$avatar->displayUrl() : $avatar->displayUrl() :
Avatar::defaultImage(AVATAR_STREAM_SIZE), Avatar::defaultImage(AVATAR_STREAM_SIZE),
'class' => 'avatar photo', 'class' => 'avatar photo',
'width' => AVATAR_STREAM_SIZE, 'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE,
'alt' => $profile->getBestName())); 'alt' => $profile->getBestName()));
$out->elementEnd('td'); $out->elementEnd('td');
$out->elementStart('td', array('align' => 'left', $out->elementStart('td', array('align' => 'left',
'valign' => 'top')); 'valign' => 'top'));
$out->element('a', array('href' => $profile->profileurl), $out->element('a', array('href' => $profile->profileurl),
$profile->nickname); $profile->nickname);
$out->text(' '); $out->text(' ');
$out->raw($notice->rendered); $out->raw($notice->rendered);
$out->element('br'); // yeah, you know it. I just wrote a <br> in the middle of my table layout. $out->element('br'); // yeah, you know it. I just wrote a <br> in the middle of my table layout.
$noticeurl = $notice->bestUrl(); $noticeurl = $notice->bestUrl();
// above should always return an URL // above should always return an URL
assert(!empty($noticeurl)); assert(!empty($noticeurl));
$out->elementStart('a', array('rel' => 'bookmark', $out->elementStart('a', array('rel' => 'bookmark',
'class' => 'timestamp', 'class' => 'timestamp',
'href' => $noticeurl)); 'href' => $noticeurl));
$dt = common_date_iso8601($notice->created); $dt = common_date_iso8601($notice->created);
$out->element('abbr', array('class' => 'published', $out->element('abbr', array('class' => 'published',
'title' => $dt), 'title' => $dt),
common_date_string($notice->created)); common_date_string($notice->created));
$out->elementEnd('a'); $out->elementEnd('a');
if ($notice->hasConversation()) { if ($notice->hasConversation()) {
$conv = Conversation::staticGet('id', $notice->conversation); $conv = Conversation::staticGet('id', $notice->conversation);
$convurl = $conv->uri; $convurl = $conv->uri;
if (!empty($convurl)) { if (!empty($convurl)) {
$out->text(' '); $out->text(' ');
$out->element('a', $out->element('a',
array('href' => $convurl.'#notice-'.$notice->id, array('href' => $convurl.'#notice-'.$notice->id,
'class' => 'response'), 'class' => 'response'),
_('in context')); _('in context'));
} }
} }
$out->elementEnd('td'); $out->elementEnd('td');
$out->elementEnd('tr'); $out->elementEnd('tr');
} }
$out->elementEnd('table'); $out->elementEnd('table');
$out->raw(sprintf(_('<p><a href="%1s">change your email settings for %2s</a></p>'), $out->raw(sprintf(_('<p><a href="%1s">change your email settings for %2s</a></p>'),
common_local_url('emailsettings'), common_local_url('emailsettings'),
common_config('site', 'name'))); common_config('site', 'name')));
$body = $out->getString(); $body = $out->getString();
// FIXME: do something for people who don't like HTML email // FIXME: do something for people who don't like HTML email
mail_to_user($user, _('Updates from your network'), $body, mail_to_user($user, _('Updates from your network'), $body,
array('Content-Type' => 'text/html; charset=UTF-8')); array('Content-Type' => 'text/html; charset=UTF-8'));
if (empty($ess)) { if (empty($ess)) {
$ess = new Email_summary_status(); $ess = new Email_summary_status();
$ess->user_id = $user_id; $ess->user_id = $user_id;
$ess->created = common_sql_now(); $ess->created = common_sql_now();
$ess->last_summary_id = $new_top; $ess->last_summary_id = $new_top;
$ess->modified = common_sql_now(); $ess->modified = common_sql_now();
$ess->insert(); $ess->insert();
} else { } else {
$orig = clone($ess); $orig = clone($ess);
$ess->last_summary_id = $new_top; $ess->last_summary_id = $new_top;
$ess->modified = common_sql_now(); $ess->modified = common_sql_now();
$ess->update($orig); $ess->update($orig);
} }
return true; return true;
} }
} }

Some files were not shown because too many files have changed in this diff Show More