* remove superfluous whitespace.
* L10n updates.
* small refactoring in publicrss.php.
* remove PHP4-isms
{
parent::handle($args);
if (!common_logged_in()) {
+ // TRANS: Client error displayed trying to log out when not logged in.
$this->clientError(_('Not logged in.'));
} else {
if (Event::handle('StartLogout', array($this))) {
common_real_login(false); // not logged in
common_forgetme(); // don't log back in!
}
-
}
*/
class NoticesearchAction extends SearchAction
{
-
function prepare($args)
{
parent::prepare($args);
*/
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.');
}
*/
function title()
{
+ // TRANS: Title of the page where users can search for notices.
return _('Text search');
}
return array(new Feed(Feed::RSS1, common_local_url('noticesearchrss',
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'),
$q, common_config('site', 'name'))));
}
$cnt = $notice->find();
}
if ($cnt === 0) {
+ // TRANS: Text for notice search results is the query had no results.
$this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q);
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));
}
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));
}
return $result;
}
}
-
*/
class NoticesearchrssAction extends Rss10Action
{
-
function init()
{
return true;
}
-
+
function prepare($args)
{
parent::prepare($args);
function getNotices($limit=0)
{
-
$q = $this->trimmed('q');
$notices = array();
{
$q = $this->trimmed('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),
'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')));
return $c;
}
<?php
-
/**
* Opensearch action class.
*
* Class handler.
*
* @param array $args query arguments
- *
+ *
* @return boolean false if user doesn't exist
*/
function handle($args)
$short_name = '';
if ($type == 'people') {
$type = 'peoplesearch';
+ // TRANS: ShortName in the OpenSearch interface when trying to find users.
$short_name = _('People Search');
} else {
+ // TRANS: ShortName in the OpenSearch interface when trying to find notices.
$type = 'noticesearch';
$short_name = _('Notice Search');
}
return true;
}
}
-
{
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. ' .
'Separate the terms by spaces; they must be 3 characters or more.');
}
function title()
{
+ // TRANS: Title of a page where users can search for other users.
return _('People search');
}
$page, 'peoplesearch', array('q' => $q));
} else {
+ // TRANS: Message on the "People search" page where a query has no results.
$this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q);
$profile->free();
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
}
-
<?php
-
/**
* Public RSS action class.
*
* @param array $args Arguments from $_REQUEST
* @return boolean success
*/
-
function prepare($args)
{
parent::prepare($args);
*/
function getChannel()
{
+ $sitename = common_config('site', 'name');
$c = array(
- 'url' => common_local_url('publicrss')
- , 'title' => sprintf(_('%s public timeline'), common_config('site', 'name'))
- , 'link' => common_local_url('public')
- , 'description' => sprintf(_('%s updates from everyone!'), common_config('site', 'name')));
+ 'url' => common_local_url('publicrss'),
+ // TRANS: Public RSS feed title. %s is the StatusNet site name.
+ 'title' => sprintf(_('%s public timeline'), $sitename),
+ '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;
}
* Get image.
*
* @return nothing
- */
+ */
function getImage()
{
// nop
return true;
}
}
-
class RepliesrssAction extends Rss10Action
{
-
var $user = null;
function prepare($args)
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
$this->clientError(_('No such user.'));
return false;
} else {
function getNotices($limit=0)
{
-
$user = $this->user;
$notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
$notices = array();
-
+
while ($notice->fetch()) {
$notices[] = clone($notice);
}
$c = array('url' => common_local_url('repliesrss',
array('nickname' =>
$user->nickname)),
+ // TRANS: RSS reply feed title. %s is a user nickname.
'title' => sprintf(_("Replies to %s"), $user->nickname),
'link' => common_local_url('replies',
array('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')));
return $c;
}
<?php
-
/**
* Request token action class.
*
}
}
}
-?>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class UnblockAction extends ProfileFormAction
{
function prepare($args)
assert(!empty($cur)); // checked by parent
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."));
return false;
}
*
* @return void
*/
-
function handlePost()
{
$cur = common_current_user();
}
if (!$result) {
+ // TRANS: Server error displayed when removing a user block.
$this->serverError(_('Error removing the block.'));
return;
}
<?php
-
/**
* User by ID action class.
*
parent::handle($args);
$id = $this->trimmed('id');
if (!$id) {
+ // TRANS: Client error displayed trying to find a user by ID without providing an ID.
$this->clientError(_('No ID.'));
}
$user = User::staticGet($id);
if (!$user) {
+ // TRANS: Client error displayed trying to find a user by ID for a non-existing ID.
$this->clientError(_('No such user.'));
}
<?php
-
/**
* XRDS for OpenMicroBlogging
*
{
return true;
}
-
+
function prepare($args)
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error displayed providing a non-existing nickname.
$this->clientError(_('No such user.'));
return;
}
null,
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
$xrdsOutputter->elementEnd('XRD');
-
+
//omb
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
'xml:id' => 'omb',
$xrdsOutputter->showXrdsService(OMB_ENDPOINT_UPDATEPROFILE,
common_local_url('updateprofile'));
$xrdsOutputter->elementEnd('XRD');
-
+
Event::handle('EndUserXRDS', array($this,&$xrdsOutputter));
//misc
$xrdsOutputter->elementEnd('XRD');
$xrdsOutputter->endXRDS();
-
}
}
-?>