Add FIXME for missing class documentation.
i18n/L10n tweaks.
Superfluous whitespace removed.
function show()
{
// Similar to that for inline replies, but not quite!
+ // TRANS: Field label for notice text.
$placeholder = _('Update your status...');
$this->out->elementStart('div', 'form_notice_placeholder');
$this->out->element('input', array('class' => 'placeholder',
*
* @see DisfavorForm
*/
-
class NudgeForm extends Form
{
/**
* Profile of user to nudge
*/
-
var $profile = null;
/**
* @param HTMLOutputter $out output channel
* @param Profile $profile profile of user to nudge
*/
-
function __construct($out=null, $profile=null)
{
parent::__construct($out);
*
* @return int ID of the form
*/
-
function id()
{
return 'form_user_nudge';
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_user_nudge ajax';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('nudge',
*/
function formLegend()
{
+ // TRANS: Form legend of form to nudge/ping another user.
$this->out->element('legend', null, _('Nudge this user'));
}
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Nudge'), 'submit', null, _('Send a nudge to this user'));
+ $this->out->submit('submit',
+ // TRANS: Button text to nudge/ping another user.
+ _m('BUTTON','Nudge'),
+ 'submit',
+ null,
+ // TRANS: Button title to nudge/ping another user.
+ _('Send a nudge to this user.'));
}
}
require_once 'libomb/datastore.php';
+// @todo FIXME: Class documentation missing.
class StatusNetOAuthDataStore extends OAuthDataStore
{
-
// We keep a record of who's contacted us
function lookup_consumer($consumer_key)
{
// http://oauth.net/core/1.0/#nonce
// "The Consumer SHALL then generate a Nonce value that is unique for
// all requests with that timestamp."
-
// XXX: It's not clear why the token is here
-
function lookup_nonce($consumer, $token, $nonce, $timestamp)
{
$n = new Nonce();
}
// defined in OAuthDataStore, but not implemented anywhere
-
function fetch_request_token($consumer)
{
return $this->new_request_token($consumer);
}
// defined in OAuthDataStore, but not implemented anywhere
-
function fetch_access_token($consumer)
{
return $this->new_access_token($consumer);
**/
public function getProfile($identifier_uri) {
/* getProfile is only used for remote profiles by libomb.
- TODO: Make it work with local ones anyway. */
+ @TODO: Make it work with local ones anyway. */
$remote = Remote_profile::staticGet('uri', $identifier_uri);
if (!$remote) throw new Exception('No such remote profile');
$profile = Profile::staticGet('id', $remote->id);
$profile->created = DB_DataObject_Cast::dateTime(); # current time
$id = $profile->insert();
if (!$id) {
+ // TRANS: Exception thrown when creating a new profile fails in OAuth store.
throw new Exception(_('Error inserting new profile.'));
}
$remote->id = $id;
$avatar_url = $omb_profile->getAvatarURL();
if ($avatar_url) {
if (!$this->add_avatar($profile, $avatar_url)) {
+ // TRANS: Exception thrown when creating a new avatar fails in OAuth store.
throw new Exception(_('Error inserting avatar.'));
}
} else {
if ($exists) {
if (!$remote->update($orig_remote)) {
+ // TRANS: Exception thrown when updating a remote profile fails in OAuth store.
throw new Exception(_('Error updating remote profile.'));
}
} else {
$remote->created = DB_DataObject_Cast::dateTime(); # current time
if (!$remote->insert()) {
+ // TRANS: Exception thrown when creating a remote profile fails in OAuth store.
throw new Exception(_('Error inserting remote profile.'));
}
}
if (!$subscriber->hasRight(Right::SUBSCRIBE)) {
common_log(LOG_INFO, __METHOD__ . ": remote subscriber banned ($subscriber_uri subbing to $subscribed_user_uri)");
+ // TRANS: Error message displayed to a banned user when they try to subscribe.
return _('You have been banned from subscribing.');
}
if (!$result) {
common_log_db_error($sub, ($sub_exists) ? 'UPDATE' : 'INSERT', __FILE__);
- throw new Exception(_('Couldn\'t insert new subscription.'));
+ // TRANS: Exception thrown when creating a new subscription fails in OAuth store.
+ throw new Exception(_('Could not insert new subscription.'));
return;
}
}
}
}
-?>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PluginList extends Widget
{
var $plugins = array();
$this->out->elementEnd('a');
}
$this->out->elementEnd('div');
-
+
$form = $this->getControlForm();
$form->show();
return $found;
} else {
return array('name' => $this->plugin,
+ // TRANS: Plugin description for a disabled plugin.
'rawdescription' => _m('plugin-description',
'(Plugin descriptions unavailable when disabled.)'));
}
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
-
class RedirectingAction extends Action
{
-
/**
* Redirect browser to the page our hidden parameters requested,
* or if none given, to the url given by $this->defaultReturnTo().
- *
+ *
* To be called only after successful processing.
- *
+ *
* Note: this was named returnToArgs() up through 0.9.2, which
* caused problems because there's an Action::returnToArgs()
* already which does something different.
- *
+ *
* @return void
*/
function returnToPrevious()
* If we reached this form without returnto arguments, where should
* we go? May be overridden by subclasses to a reasonable destination
* for that action; default implementation throws an exception.
- *
+ *
* @return string URL
*/
function defaultReturnTo()
{
- $this->clientError(_("No return-to arguments."));
+ // TRANS: Client error displayed when return-to was defined without a target.
+ $this->clientError(_('No return-to arguments.'));
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class RepeatForm extends Form
{
/**
* Notice to repeat
*/
-
var $notice = null;
/**
* @param HTMLOutputter $out output channel
* @param Notice $notice notice to repeat
*/
-
function __construct($out=null, $notice=null)
{
parent::__construct($out);
*
* @return int ID of the form
*/
-
function id()
{
return 'repeat-' . $this->notice->id;
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('repeat');
*
* @return void
*/
-
function sessionToken()
{
$this->out->hidden('token-' . $this->notice->id,
*/
function formLegend()
{
+ // TRANS: For legend for notice repeat form.
$this->out->element('legend', null, _('Repeat this notice?'));
}
*
* @return void
*/
-
function formData()
{
$this->out->hidden('notice-n'.$this->notice->id,
*
* @return void
*/
-
function formActions()
{
$this->out->submit('repeat-submit-' . $this->notice->id,
- _('Yes'), 'submit', null, _('Repeat this notice'));
+ // TRANS: Button text to repeat a notice on notice repeat form.
+ _m('BUTTON','Yes'), 'submit', null,
+ // TRANS: Button title to repeat a notice on notice repeat form.
+ _('Repeat this notice.'));
}
/**
*
* @return string the form's class
*/
-
function formClass()
{
return 'form_repeat';
*
* @see UnSandboxForm
*/
-
class RevokeRoleForm extends ProfileActionForm
{
function __construct($role, $label, $writer, $profile, $r2args)
*
* @return string Name of the action, lowercased.
*/
-
function target()
{
return 'revokerole';
*
* @return string Title of the form, internationalized
*/
-
function title()
{
return $this->label;
*
* @return string description of the form, internationalized
*/
-
function description()
{
+ // TRANS: Description of role revoke form. %s is the role to be revoked.
return sprintf(_('Revoke the "%s" role from this user'), $this->label);
}
}
*
* @see UnSandboxForm
*/
-
class SandboxForm extends ProfileActionForm
{
/**
*
* @return string Name of the action, lowercased.
*/
-
function target()
{
return 'sandbox';
*
* @return string Title of the form, internationalized
*/
-
function title()
{
- return _('Sandbox');
+ // TRANS: Title of form to sandbox a user.
+ return _m('TITLE','Sandbox');
}
/**
*
* @return string description of the form, internationalized
*/
-
function description()
{
+ // TRANS: Description of form to sandbox a user.
return _('Sandbox this user');
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class Section extends Widget
{
/**
* @return void
* @see Widget::show()
*/
-
function show()
{
$this->out->elementStart('div',
function title()
{
+ // TRANS: Default title for section/sidebar widget.
return _('Untitled section');
}
function showContent()
{
$this->out->element('p', null,
+ // TRANS: Default content for section/sidebar widget.
_('(None)'));
return false;
}
function moreTitle()
{
+ // TRANS: Default "More..." title for section/sidebar widget.
return _('More...');
}
}
*
* @see UnSilenceForm
*/
-
class SilenceForm extends ProfileActionForm
{
/**
*
* @return string Name of the action, lowercased.
*/
-
function target()
{
return 'silence';
*
* @return string Title of the form, internationalized
*/
-
function title()
{
- return _('Silence');
+ // TRANS: Title of form to silence a user.
+ return _m('TITLE','Silence');
}
/**
*
* @return string description of the form, internationalized
*/
-
function description()
{
+ // TRANS: Description of form to silence a user.
return _('Silence this user');
}
}
*
* @see UnsubscribeForm
*/
-
class SubscribeForm extends Form
{
/**
* Profile of user to subscribe to
*/
-
var $profile = null;
/**
* @param HTMLOutputter $out output channel
* @param Profile $profile profile of user to subscribe to
*/
-
function __construct($out=null, $profile=null)
{
parent::__construct($out);
*
* @return int ID of the form
*/
-
function id()
{
return 'subscribe-' . $this->profile->id;
}
-
/**
* class of the form
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_user_subscribe ajax';
}
-
/**
* Action of the form
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('subscribe');
}
-
/**
* Legend of the Form
*
*/
function formLegend()
{
+ // TRANS: Form of form to subscribe to a user.
$this->out->element('legend', null, _('Subscribe to this user'));
}
*
* @return void
*/
-
function formData()
{
$this->out->hidden('subscribeto-' . $this->profile->id,
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Subscribe'), 'submit', null, _('Subscribe to this user'));
+ // TRANS: Button text to subscribe to a user.
+ $this->out->submit('submit', _m('BUTTON','Subscribe'), 'submit', null,
+ // TRANS: Button title to subscribe to a user.
+ _('Subscribe to this user.'));
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection
{
function title()
{
+ // TRANS: Title of personal tag cloud section.
return _('People Tagcloud as self-tagged');
}
function query() {
// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc';
-
-
return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
-
// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
-
-
}
}
-
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection
{
function title()
{
+ // TRANS: Title of personal tag cloud section.
return _('People Tagcloud as tagged');
}
return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed and tag is not null group by tag order by weight desc';
}
}
-
<?php
-
/**
* StatusNet, the distributed open-source microblogging tool
*
if ($this->isOwn()) {
$this->out->element('a', array('href' => common_local_url('tagother',
array('id' => $this->profile->id))),
+ // TRANS: Description for link to "tag other users" in widget to show a list of profiles.
_('Tags'));
} else {
+ // TRANS: Text widget to show a list of profiles with their tags.
$this->out->text(_('Tags'));
}
if ($tags) {
}
$this->out->elementEnd('ul');
} else {
+ // TRANS: Text if there are no tags in widget to show a list of profiles by tag.
$this->out->text(_('(None)'));
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection
{
function title()
{
+ // TRANS: Title of personal tag cloud section.
return _('People Tagcloud as self-tagged');
}
function query() {
// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc';
-
-
-
return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
-
// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
}
}
-
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection
{
function title()
{
+ // TRANS: Title of personal tag cloud section.
return _('People Tagcloud as tagged');
}
return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed and tag is not null group by tag order by weight desc';
}
}
-