forked from GNUsocial/gnu-social
* update translator documentation.
* remove superfluous whitespace. * L10n updates. * small refactoring in publicrss.php. * remove PHP4-isms
This commit is contained in:
parent
3e7e6138a8
commit
65045a26f3
@ -66,6 +66,7 @@ class LogoutAction extends Action
|
||||
{
|
||||
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))) {
|
||||
@ -83,5 +84,4 @@ class LogoutAction extends Action
|
||||
common_real_login(false); // not logged in
|
||||
common_forgetme(); // don't log back in!
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/searchaction.php';
|
||||
*/
|
||||
class NoticesearchAction extends SearchAction
|
||||
{
|
||||
|
||||
function prepare($args)
|
||||
{
|
||||
parent::prepare($args);
|
||||
@ -65,6 +64,8 @@ class NoticesearchAction extends SearchAction
|
||||
*/
|
||||
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.');
|
||||
}
|
||||
|
||||
@ -75,6 +76,7 @@ class NoticesearchAction extends SearchAction
|
||||
*/
|
||||
function title()
|
||||
{
|
||||
// TRANS: Title of the page where users can search for notices.
|
||||
return _('Text search');
|
||||
}
|
||||
|
||||
@ -88,6 +90,8 @@ class NoticesearchAction extends SearchAction
|
||||
|
||||
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'))));
|
||||
}
|
||||
@ -114,13 +118,18 @@ class NoticesearchAction extends SearchAction
|
||||
$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));
|
||||
}
|
||||
|
||||
@ -203,4 +212,3 @@ class SearchNoticeListItem extends NoticeListItem {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,12 +48,11 @@ require_once INSTALLDIR.'/lib/rssaction.php';
|
||||
*/
|
||||
class NoticesearchrssAction extends Rss10Action
|
||||
{
|
||||
|
||||
function init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function prepare($args)
|
||||
{
|
||||
parent::prepare($args);
|
||||
@ -63,7 +62,6 @@ class NoticesearchrssAction extends Rss10Action
|
||||
|
||||
function getNotices($limit=0)
|
||||
{
|
||||
|
||||
$q = $this->trimmed('q');
|
||||
$notices = array();
|
||||
|
||||
@ -93,9 +91,12 @@ class NoticesearchrssAction extends Rss10Action
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Opensearch action class.
|
||||
*
|
||||
@ -51,7 +50,7 @@ class OpensearchAction extends Action
|
||||
* Class handler.
|
||||
*
|
||||
* @param array $args query arguments
|
||||
*
|
||||
*
|
||||
* @return boolean false if user doesn't exist
|
||||
*/
|
||||
function handle($args)
|
||||
@ -61,8 +60,10 @@ class OpensearchAction extends Action
|
||||
$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');
|
||||
}
|
||||
@ -89,4 +90,3 @@ class OpensearchAction extends Action
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,12 +49,15 @@ class PeoplesearchAction extends SearchAction
|
||||
{
|
||||
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');
|
||||
}
|
||||
|
||||
@ -80,6 +83,7 @@ class PeoplesearchAction extends SearchAction
|
||||
$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();
|
||||
@ -136,4 +140,3 @@ class PeopleSearchResultItem extends ProfileListItem
|
||||
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Public RSS action class.
|
||||
*
|
||||
@ -55,7 +54,6 @@ class PublicrssAction extends Rss10Action
|
||||
* @param array $args Arguments from $_REQUEST
|
||||
* @return boolean success
|
||||
*/
|
||||
|
||||
function prepare($args)
|
||||
{
|
||||
parent::prepare($args);
|
||||
@ -98,11 +96,14 @@ class PublicrssAction extends Rss10Action
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
@ -110,7 +111,7 @@ class PublicrssAction extends Rss10Action
|
||||
* Get image.
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
*/
|
||||
function getImage()
|
||||
{
|
||||
// nop
|
||||
@ -121,4 +122,3 @@ class PublicrssAction extends Rss10Action
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
||||
|
||||
class RepliesrssAction extends Rss10Action
|
||||
{
|
||||
|
||||
var $user = null;
|
||||
|
||||
function prepare($args)
|
||||
@ -35,6 +34,7 @@ class RepliesrssAction extends Rss10Action
|
||||
$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 {
|
||||
@ -45,13 +45,12 @@ class RepliesrssAction extends Rss10Action
|
||||
|
||||
function getNotices($limit=0)
|
||||
{
|
||||
|
||||
$user = $this->user;
|
||||
|
||||
$notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
|
||||
|
||||
$notices = array();
|
||||
|
||||
|
||||
while ($notice->fetch()) {
|
||||
$notices[] = clone($notice);
|
||||
}
|
||||
@ -65,11 +64,14 @@ class RepliesrssAction extends Rss10Action
|
||||
$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;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Request token action class.
|
||||
*
|
||||
@ -77,4 +76,3 @@ class RequesttokenAction extends Action
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
class UnblockAction extends ProfileFormAction
|
||||
{
|
||||
function prepare($args)
|
||||
@ -56,6 +55,7 @@ class UnblockAction extends ProfileFormAction
|
||||
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;
|
||||
}
|
||||
@ -68,7 +68,6 @@ class UnblockAction extends ProfileFormAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function handlePost()
|
||||
{
|
||||
$cur = common_current_user();
|
||||
@ -83,6 +82,7 @@ class UnblockAction extends ProfileFormAction
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
// TRANS: Server error displayed when removing a user block.
|
||||
$this->serverError(_('Error removing the block.'));
|
||||
return;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User by ID action class.
|
||||
*
|
||||
@ -67,10 +66,12 @@ class UserbyidAction extends Action
|
||||
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.'));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* XRDS for OpenMicroBlogging
|
||||
*
|
||||
@ -61,13 +60,14 @@ class XrdsAction extends Action
|
||||
{
|
||||
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;
|
||||
}
|
||||
@ -110,7 +110,7 @@ class XrdsAction extends Action
|
||||
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',
|
||||
@ -122,7 +122,7 @@ class XrdsAction extends Action
|
||||
$xrdsOutputter->showXrdsService(OMB_ENDPOINT_UPDATEPROFILE,
|
||||
common_local_url('updateprofile'));
|
||||
$xrdsOutputter->elementEnd('XRD');
|
||||
|
||||
|
||||
Event::handle('EndUserXRDS', array($this,&$xrdsOutputter));
|
||||
|
||||
//misc
|
||||
@ -135,7 +135,5 @@ class XrdsAction extends Action
|
||||
$xrdsOutputter->elementEnd('XRD');
|
||||
|
||||
$xrdsOutputter->endXRDS();
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user