summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-30 11:31:29 -0700
committerBrion Vibber <brion@pobox.com>2010-09-30 11:31:29 -0700
commit20f2167425fcbdca3281960297a0a006f4efbddf (patch)
tree22eae18225dbcef59592b411ffb8bbd5b3e253ed /lib
parent1acc7d66c63e0b9f794791e3a2e2b0f60bc2ebb1 (diff)
parent49611af76de5fca165edd79acefa09851706f8cd (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline into feedfix
Diffstat (limited to 'lib')
-rw-r--r--lib/accountsettingsaction.php5
-rw-r--r--lib/action.php15
-rw-r--r--lib/activity.php4
-rw-r--r--lib/activityobject.php5
-rw-r--r--lib/activityutils.php3
-rw-r--r--lib/adminform.php1
-rw-r--r--lib/apiaction.php7
-rw-r--r--lib/apibareauth.php1
-rw-r--r--lib/apioauthstore.php3
-rw-r--r--lib/applicationeditform.php3
-rw-r--r--lib/applicationlist.php3
-rw-r--r--lib/atom10feed.php3
-rw-r--r--lib/atomusernoticefeed.php1
-rw-r--r--lib/attachmentlist.php12
-rw-r--r--lib/attachmentnoticesection.php4
-rw-r--r--lib/attachmenttagcloudsection.php2
-rw-r--r--lib/authenticationplugin.php13
-rw-r--r--lib/authorizationplugin.php2
-rw-r--r--lib/blockform.php3
-rw-r--r--lib/cache.php8
-rw-r--r--lib/channel.php14
-rw-r--r--lib/clienterroraction.php1
-rw-r--r--lib/clientexception.php1
-rw-r--r--lib/columndef.php6
-rw-r--r--lib/command.php11
-rw-r--r--lib/commandinterpreter.php3
-rw-r--r--lib/common.php12
-rw-r--r--lib/connectsettingsaction.php21
-rw-r--r--lib/currentuserdesignaction.php2
-rw-r--r--lib/feedlist.php66
30 files changed, 87 insertions, 148 deletions
diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php
index 57740f8b8..7991c9002 100644
--- a/lib/accountsettingsaction.php
+++ b/lib/accountsettingsaction.php
@@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/settingsaction.php';
*
* @see Widget
*/
-
class AccountSettingsAction extends SettingsAction
{
/**
@@ -54,7 +53,6 @@ class AccountSettingsAction extends SettingsAction
*
* @return void
*/
-
function showLocalNav()
{
$menu = new AccountSettingsNav($this);
@@ -73,7 +71,6 @@ class AccountSettingsAction extends SettingsAction
*
* @see HTMLOutputter
*/
-
class AccountSettingsNav extends Widget
{
var $action = null;
@@ -83,7 +80,6 @@ class AccountSettingsNav extends Widget
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null)
{
parent::__construct($action);
@@ -95,7 +91,6 @@ class AccountSettingsNav extends Widget
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
diff --git a/lib/action.php b/lib/action.php
index 5482ac377..ddc058d41 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -314,7 +314,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return nothing
*/
-
function showFeeds()
{
$feeds = $this->getFeeds();
@@ -710,7 +709,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return nothing
*/
-
function showAside()
{
$this->elementStart('div', array('id' => 'aside_primary',
@@ -731,7 +729,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return void
*/
-
function showExportData()
{
$feeds = $this->getFeeds();
@@ -807,6 +804,7 @@ class Action extends HTMLOutputter // lawsuit
// TRANS: Secondary navigation menu option leading to contact information on the StatusNet site.
_('Contact'));
$this->menuItem(common_local_url('doc', array('title' => 'badge')),
+ // TRANS: Secondary navigation menu option.
_('Badge'));
Event::handle('EndSecondaryNav', array($this));
}
@@ -954,7 +952,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return false;
@@ -1053,7 +1050,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return boolean is read only action?
*/
-
function isCacheable()
{
return true;
@@ -1067,7 +1063,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return boolean
*/
-
function _hasEtag($etag, $if_none_match)
{
$etags = explode(',', $if_none_match);
@@ -1107,7 +1102,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return integer integer value
*/
-
function int($key, $defValue=null, $maxValue=null, $minValue=null)
{
$arg = strtolower($this->trimmed($key));
@@ -1135,7 +1129,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return nothing
*/
-
function serverError($msg, $code=500)
{
$action = $this->trimmed('action');
@@ -1151,7 +1144,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return nothing
*/
-
function clientError($msg, $code=400)
{
$action = $this->trimmed('action');
@@ -1164,7 +1156,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return string current URL
*/
-
function selfUrl()
{
list($action, $args) = $this->returnToArgs();
@@ -1176,7 +1167,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return array two elements: action, other args
*/
-
function returnToArgs()
{
$action = $this->trimmed('action');
@@ -1283,7 +1273,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return array Feed object to show in head and links
*/
-
function getFeeds()
{
return null;
@@ -1294,7 +1283,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return Design a design object to use
*/
-
function getDesign()
{
return Design::siteDesign();
@@ -1308,7 +1296,6 @@ class Action extends HTMLOutputter // lawsuit
*
* @return void
*/
-
// XXX: Finding this type of check with the same message about 50 times.
// Possible to refactor?
function checkSessionToken()
diff --git a/lib/activity.php b/lib/activity.php
index f19f10e34..e974ca991 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -48,7 +48,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class Activity
{
const SPEC = 'http://activitystrea.ms/spec/1.0/';
@@ -108,7 +107,6 @@ class Activity
* @param DOMElement $entry Atom entry to poke at
* @param DOMElement $feed Atom feed, for context
*/
-
function __construct($entry = null, $feed = null)
{
if (is_null($entry)) {
@@ -133,6 +131,7 @@ class Activity
$entry->localName == 'item') {
$this->_fromRssItem($entry, $feed);
} else {
+ // Low level exception. No need for i18n.
throw new Exception("Unknown DOM element: {$entry->namespaceURI} {$entry->localName}");
}
}
@@ -313,7 +312,6 @@ class Activity
*
* @return DOMElement Atom entry
*/
-
function toAtomEntry()
{
return null;
diff --git a/lib/activityobject.php b/lib/activityobject.php
index c957933d0..e89c8db4e 100644
--- a/lib/activityobject.php
+++ b/lib/activityobject.php
@@ -49,7 +49,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class ActivityObject
{
const ARTICLE = 'http://activitystrea.ms/schema/1.0/article';
@@ -116,7 +115,6 @@ class ActivityObject
*
* @param DOMElement $element DOM thing to turn into an Activity thing
*/
-
function __construct($element = null)
{
if (empty($element)) {
@@ -216,8 +214,7 @@ class ActivityObject
}
}
- // @fixme rationalize with Activity::_fromRssItem()
-
+ // @todo FIXME: rationalize with Activity::_fromRssItem()
private function _fromRssItem($item)
{
$this->title = ActivityUtils::childContent($item, ActivityObject::TITLE, Activity::RSS);
diff --git a/lib/activityutils.php b/lib/activityutils.php
index b975a6382..c462514c4 100644
--- a/lib/activityutils.php
+++ b/lib/activityutils.php
@@ -82,13 +82,11 @@ class ActivityUtils
$els = $element->childNodes;
foreach ($els as $link) {
-
if (!($link instanceof DOMElement)) {
continue;
}
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
-
$linkRel = $link->getAttribute(self::REL);
$linkType = $link->getAttribute(self::TYPE);
@@ -109,7 +107,6 @@ class ActivityUtils
foreach ($els as $link) {
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
-
$linkRel = $link->getAttribute(self::REL);
$linkType = $link->getAttribute(self::TYPE);
diff --git a/lib/adminform.php b/lib/adminform.php
index 9b0e45f8a..1ecb02435 100644
--- a/lib/adminform.php
+++ b/lib/adminform.php
@@ -79,5 +79,4 @@ class AdminForm extends Form
}
return $value;
}
-
}
diff --git a/lib/apiaction.php b/lib/apiaction.php
index 0074b7dc5..0ebf88282 100644
--- a/lib/apiaction.php
+++ b/lib/apiaction.php
@@ -462,7 +462,6 @@ class ApiAction extends Action
$entry = array();
if (Event::handle('StartRssEntryArray', array($notice, &$entry))) {
-
$profile = $notice->getProfile();
// We trim() to avoid extraneous whitespace in the output
@@ -552,7 +551,6 @@ class ApiAction extends Action
$notifications = false;
if ($source->isSubscribed($target)) {
-
$sub = Subscription::pkeyGet(array('subscriber' =>
$source->id, 'subscribed' => $target->id));
@@ -738,7 +736,6 @@ class ApiAction extends Action
function showXmlTimeline($notice)
{
-
$this->initDocument('xml');
$this->elementStart('statuses', array('type' => 'array',
'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
@@ -763,7 +760,6 @@ class ApiAction extends Action
function showRssTimeline($notice, $title, $link, $subtitle, $suplink = null, $logo = null, $self = null)
{
-
$this->initDocument('rss');
$this->element('title', null, $title);
@@ -819,7 +815,6 @@ class ApiAction extends Action
function showAtomTimeline($notice, $title, $id, $link, $subtitle=null, $suplink=null, $selfuri=null, $logo=null)
{
-
$this->initDocument('atom');
$this->element('title', null, $title);
@@ -863,7 +858,6 @@ class ApiAction extends Action
function showRssGroups($group, $title, $link, $subtitle)
{
-
$this->initDocument('rss');
$this->element('title', null, $title);
@@ -1362,7 +1356,6 @@ class ApiAction extends Action
function getTargetUser($id)
{
if (empty($id)) {
-
// Twitter supports these other ways of passing the user ID
if (is_numeric($this->arg('id'))) {
return User::staticGet($this->arg('id'));
diff --git a/lib/apibareauth.php b/lib/apibareauth.php
index 00e0f205b..043181b07 100644
--- a/lib/apibareauth.php
+++ b/lib/apibareauth.php
@@ -62,7 +62,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
*/
class ApiBareAuthAction extends ApiAuthAction
{
-
/**
* Take arguments for running
*
diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php
index 01116ad3e..eca93866f 100644
--- a/lib/apioauthstore.php
+++ b/lib/apioauthstore.php
@@ -149,7 +149,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
// Okay, good
return new OAuthToken($at->tok, $at->secret);
}
-
} else {
return null;
}
@@ -173,10 +172,12 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$rt->tok = $token_key;
$rt->type = $type;
$rt->state = 0;
+
if (!$rt->find(true)) {
// TRANS: Exception thrown when an attempt is made to revoke an unknown token.
throw new Exception(_('Tried to revoke unknown token.'));
}
+
if (!$rt->delete()) {
// TRANS: Exception thrown when an attempt is made to remove a revoked token.
throw new Exception(_('Failed to delete revoked token.'));
diff --git a/lib/applicationeditform.php b/lib/applicationeditform.php
index 224b6eaa1..f53c31feb 100644
--- a/lib/applicationeditform.php
+++ b/lib/applicationeditform.php
@@ -197,7 +197,8 @@ class ApplicationEditForm extends Form
$maxDesc = Oauth_application::maxDesc();
if ($maxDesc > 0) {
// TRANS: Form input field instructions.
- $descInstr = sprintf(_('Describe your application in %d characters'),
+ // TRANS: %d is the number of available characters for the description.
+ $descInstr = sprintf(ngettext('Describe your application in %d character','Describe your application in %d characters',$maxDesc),
$maxDesc);
} else {
// TRANS: Form input field instructions.
diff --git a/lib/applicationlist.php b/lib/applicationlist.php
index 1974d2103..8b6e3a8ad 100644
--- a/lib/applicationlist.php
+++ b/lib/applicationlist.php
@@ -1,5 +1,4 @@
<?php
-
/**
* StatusNet, the distributed open-source microblogging tool
*
@@ -139,7 +138,7 @@ class ApplicationList extends Widget
$access = ($this->application->access_type & Oauth_application::$writeAccess)
? $readWriteText : $readOnlyText;
$modifiedDate = common_date_string($appUser->modified);
- // TRANS: Used in application list. %1$s is a modified date, %2$s is access type (read-write or read-only)
+ // TRANS: Used in application list. %1$s is a modified date, %2$s is access type ("read-write" or "read-only")
$txt = sprintf(_('Approved %1$s - "%2$s" access.'),$modifiedDate,$access);
$this->out->raw($txt);
diff --git a/lib/atom10feed.php b/lib/atom10feed.php
index a46d49f35..3ae9dc81b 100644
--- a/lib/atom10feed.php
+++ b/lib/atom10feed.php
@@ -109,7 +109,7 @@ class Atom10Feed extends XMLStringer
$xs->element('name', null, $name);
} else {
throw new Atom10FeedException(
- 'author element must contain a name element.'
+ _('author element must contain a name element.')
);
}
@@ -323,5 +323,4 @@ class Atom10Feed extends XMLStringer
array_push($this->links, $attrs);
}
-
}
diff --git a/lib/atomusernoticefeed.php b/lib/atomusernoticefeed.php
index 34a187017..ec368f5ca 100644
--- a/lib/atomusernoticefeed.php
+++ b/lib/atomusernoticefeed.php
@@ -55,7 +55,6 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
*
* @return void
*/
-
function __construct($user, $cur = null, $indent = true) {
parent::__construct($cur, $indent);
$this->user = $user;
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index 59cab9532..f6b09fb49 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -49,7 +49,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @see NoticeListItem
* @see ProfileNoticeList
*/
-
class AttachmentList extends Widget
{
/** the current stream of notices being displayed. */
@@ -61,7 +60,6 @@ class AttachmentList extends Widget
*
* @param Notice $notice stream of notices from DB_DataObject
*/
-
function __construct($notice, $out=null)
{
parent::__construct($out);
@@ -76,7 +74,6 @@ class AttachmentList extends Widget
*
* @return int count of notices listed.
*/
-
function show()
{
$atts = new File;
@@ -111,7 +108,6 @@ class AttachmentList extends Widget
*
* @return NoticeListItem a list item for displaying the notice
*/
-
function newListItem($attachment)
{
return new AttachmentListItem($attachment, $this->out);
@@ -135,7 +131,6 @@ class AttachmentList extends Widget
* @see NoticeList
* @see ProfileNoticeListItem
*/
-
class AttachmentListItem extends Widget
{
/** The attachment this item will show. */
@@ -151,7 +146,6 @@ class AttachmentListItem extends Widget
*
* @param Notice $notice The notice we'll display
*/
-
function __construct($attachment, $out=null)
{
parent::__construct($out);
@@ -185,7 +179,6 @@ class AttachmentListItem extends Widget
*
* @return void
*/
-
function show()
{
$this->showStart();
@@ -221,7 +214,6 @@ class AttachmentListItem extends Widget
*
* @return void
*/
-
function showStart()
{
// XXX: RDFa
@@ -236,7 +228,6 @@ class AttachmentListItem extends Widget
*
* @return void
*/
-
function showEnd()
{
$this->out->elementEnd('li');
@@ -257,7 +248,7 @@ class Attachment extends AttachmentListItem
$this->out->elementEnd('div');
if (!empty($this->oembed->author_name) || !empty($this->oembed->provider)) {
- $this->out->elementStart('div', array('id' => 'oembed_info',
+ $this->out->elementStart('div', array('id' => 'oembed_info',
'class' => 'entry-content'));
if (!empty($this->oembed->author_name)) {
$this->out->elementStart('dl', 'vcard author');
@@ -438,4 +429,3 @@ class Attachment extends AttachmentListItem
$this->out->raw('<script>window.location = ' . json_encode($this->attachment->url) . ';</script>');
}
}
-
diff --git a/lib/attachmentnoticesection.php b/lib/attachmentnoticesection.php
index 53a3b63c1..25e64adf9 100644
--- a/lib/attachmentnoticesection.php
+++ b/lib/attachmentnoticesection.php
@@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class AttachmentNoticeSection extends NoticeSection
{
function showContent() {
@@ -59,7 +58,7 @@ class AttachmentNoticeSection extends NoticeSection
$notice->orderBy('created desc');
$notice->selectAdd('post_id as id');
$notice->find();
- return $notice;
+ return $notice;
}
function title()
@@ -73,4 +72,3 @@ class AttachmentNoticeSection extends NoticeSection
return 'popular_notices';
}
}
-
diff --git a/lib/attachmenttagcloudsection.php b/lib/attachmenttagcloudsection.php
index 15aa6dedc..2c8fc5ee1 100644
--- a/lib/attachmenttagcloudsection.php
+++ b/lib/attachmenttagcloudsection.php
@@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class AttachmentTagCloudSection extends TagCloudSection
{
function title()
@@ -81,4 +80,3 @@ class AttachmentTagCloudSection extends TagCloudSection
return $notice_tag;
}
}
-
diff --git a/lib/authenticationplugin.php b/lib/authenticationplugin.php
index dbdf20629..5e878c155 100644
--- a/lib/authenticationplugin.php
+++ b/lib/authenticationplugin.php
@@ -40,12 +40,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
* @link http://status.net/
*/
-
abstract class AuthenticationPlugin extends Plugin
{
//is this plugin authoritative for authentication?
public $authoritative = false;
-
+
//should accounts be automatically created after a successful login attempt?
public $autoregistration = false;
@@ -218,12 +217,14 @@ abstract class AuthenticationPlugin extends Plugin
//stop handling of other handlers, because what was requested was done
return false;
}else{
- throw new Exception(_('Password changing failed'));
+ // TRANS: Exception thrown when a password change fails.
+ throw new Exception(_('Password changing failed.'));
}
}else{
if($this->authoritative){
//since we're authoritative, no other plugin could do this
- throw new Exception(_('Password changing failed'));
+ // TRANS: Exception thrown when a password change fails.
+ throw new Exception(_('Password changing failed.'));
}else{
//let another handler try
return null;
@@ -233,7 +234,8 @@ abstract class AuthenticationPlugin extends Plugin
}else{
if($this->authoritative){
//since we're authoritative, no other plugin could do this
- throw new Exception(_('Password changing is not allowed'));
+ // TRANS: Exception thrown when a password change attempt fails because it is not allowed.
+ throw new Exception(_('Password changing is not allowed.'));
}
}
}
@@ -267,4 +269,3 @@ abstract class AuthenticationPlugin extends Plugin
return true;
}
}
-
diff --git a/lib/authorizationplugin.php b/lib/authorizationplugin.php
index d71f77243..dda604add 100644
--- a/lib/authorizationplugin.php
+++ b/lib/authorizationplugin.php
@@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
abstract class AuthorizationPlugin extends Plugin
{
//is this plugin authoritative for authorization?
@@ -103,4 +102,3 @@ abstract class AuthorizationPlugin extends Plugin
}
}
}
-
diff --git a/lib/blockform.php b/lib/blockform.php
index 54552b3e5..1af5e8cfd 100644
--- a/lib/blockform.php
+++ b/lib/blockform.php
@@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
*
* @see UnblockForm
*/
-
class BlockForm extends ProfileActionForm
{
/**
@@ -63,7 +62,6 @@ class BlockForm extends ProfileActionForm
*
* @return string Title of the form, internationalized
*/
-
function title()
{
// TRANS: Title for the form to block a user.
@@ -75,7 +73,6 @@ class BlockForm extends ProfileActionForm
*
* @return string description of the form, internationalized
*/
-
function description()
{
// TRANS: Description of the form to block a user.
diff --git a/lib/cache.php b/lib/cache.php
index c09a1dd9f..ea0ff769d 100644
--- a/lib/cache.php
+++ b/lib/cache.php
@@ -41,7 +41,6 @@
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class Cache
{
var $_items = array();
@@ -56,7 +55,6 @@ class Cache
*
* @return Cache cache object
*/
-
static function instance()
{
if (is_null(self::$_inst)) {
@@ -77,7 +75,6 @@ class Cache
*
* @return string full key
*/
-
static function key($extra)
{
$base_key = common_config('cache', 'base');
@@ -98,7 +95,6 @@ class Cache
*
* @return string keyized string
*/
-
static function keyize($str)
{
$str = strtolower($str);
@@ -115,7 +111,6 @@ class Cache
*
* @return string retrieved value or null if unfound
*/
-
function get($key)
{
$value = false;
@@ -140,7 +135,6 @@ class Cache
*
* @return boolean success flag
*/
-
function set($key, $value, $flag=null, $expiry=null)
{
$success = false;
@@ -192,7 +186,6 @@ class Cache
*
* @return boolean success flag
*/
-
function delete($key)
{
$success = false;
@@ -214,7 +207,6 @@ class Cache
*
* @return boolean success flag
*/
-
function reconnect()
{
$success = false;
diff --git a/lib/channel.php b/lib/channel.php
index 689bca0be..fbc2e8697 100644
--- a/lib/channel.php
+++ b/lib/channel.php
@@ -19,6 +19,9 @@
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+/**
+ * @todo Needs documentation.
+ */
class Channel
{
function on($user)
@@ -68,7 +71,6 @@ class CLIChannel extends Channel
class XMPPChannel extends Channel
{
-
var $conn = null;
function source()
@@ -154,6 +156,7 @@ class WebChannel extends Channel
# depending on what command was run
$this->out->startHTML();
$this->out->elementStart('head');
+ // TRANS: Title for command results.
$this->out->element('title', null, _('Command results'));
$this->out->elementEnd('head');
$this->out->elementStart('body');
@@ -174,6 +177,7 @@ class AjaxWebChannel extends WebChannel
{
$this->out->startHTML('text/xml;charset=utf-8');
$this->out->elementStart('head');
+ // TRANS: Title for command results.
$this->out->element('title', null, _('Command results'));
$this->out->elementEnd('head');
$this->out->elementStart('body');
@@ -186,7 +190,8 @@ class AjaxWebChannel extends WebChannel
{
$this->out->startHTML('text/xml;charset=utf-8');
$this->out->elementStart('head');
- $this->out->element('title', null, _('Ajax Error'));
+ // TRANS: Title for command results.
+ $this->out->element('title', null, _('AJAX error'));
$this->out->elementEnd('head');
$this->out->elementStart('body');
$this->out->element('p', array('id' => 'error'), $text);
@@ -197,7 +202,6 @@ class AjaxWebChannel extends WebChannel
class MailChannel extends Channel
{
-
var $addr = null;
function source()
@@ -222,10 +226,10 @@ class MailChannel extends Channel
function output($user, $text)
{
-
$headers['From'] = $user->incomingemail;
$headers['To'] = $this->addr;
+ // TRANS: E-mail subject when a command has completed.
$headers['Subject'] = _('Command complete');
return mail_send(array($this->addr), $headers, $text);
@@ -233,10 +237,10 @@ class MailChannel extends Channel
function error($user, $text)
{
-
$headers['From'] = $user->incomingemail;
$headers['To'] = $this->addr;
+ // TRANS: E-mail subject when a command has failed.
$headers['Subject'] = _('Command failed');
return mail_send(array($this->addr), $headers, $text);
diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php
index 1b98a1064..08bced5bd 100644
--- a/lib/clienterroraction.php
+++ b/lib/clienterroraction.php
@@ -1,5 +1,4 @@
<?php
-
/**
* Client error action.
*
diff --git a/lib/clientexception.php b/lib/clientexception.php
index 01c013a01..a74cab4a5 100644
--- a/lib/clientexception.php
+++ b/lib/clientexception.php
@@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ClientException extends Exception
{
public function __construct($message = null, $code = 400) {
diff --git a/lib/columndef.php b/lib/columndef.php
index ac2fcd23e..b21b30e0d 100644
--- a/lib/columndef.php
+++ b/lib/columndef.php
@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ColumnDef
{
/** name of the column. */
@@ -76,7 +75,6 @@ class ColumnDef
* @param value $extra unused
* @param boolean $auto_increment
*/
-
function __construct($name=null, $type=null, $size=null,
$nullable=true, $key=null, $default=null,
$extra=null, $auto_increment=false)
@@ -99,7 +97,6 @@ class ColumnDef
*
* @return boolean true if equivalent, otherwise false.
*/
-
function equals($other)
{
return ($this->name == $other->name &&
@@ -122,7 +119,6 @@ class ColumnDef
*
* @return boolean true if they're about equivalent
*/
-
private function _typeMatch($other)
{
switch ($this->type) {
@@ -145,7 +141,6 @@ class ColumnDef
*
* @return boolean true if defaults are effectively the same.
*/
-
private function _defaultMatch($other)
{
return ((is_null($this->default) && is_null($other->default)) ||
@@ -160,7 +155,6 @@ class ColumnDef
*
* @return boolean true if these columns 'null' the same.
*/
-
private function _nullMatch($other)
{
return ((!is_null($this->default) && !is_null($other->default) &&
diff --git a/lib/command.php b/lib/command.php
index b1f95fcb6..658262a09 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -23,7 +23,6 @@ require_once(INSTALLDIR.'/lib/channel.php');
class Command
{
-
var $user = null;
function __construct($user=null)
@@ -49,7 +48,6 @@ class Command
}
}
-
/**
* Override this with the meat!
*
@@ -313,7 +311,6 @@ class FavCommand extends Command
// TRANS: Text shown when a notice has been marked as favourite successfully.
$channel->output($this->user, _('Notice marked as fave.'));
}
-
}
class JoinCommand extends Command
@@ -361,8 +358,8 @@ class JoinCommand extends Command
$cur->nickname,
$group->nickname));
}
-
}
+
class DropCommand extends Command
{
var $other = null;
@@ -409,7 +406,6 @@ class DropCommand extends Command
$cur->nickname,
$group->nickname));
}
-
}
class WhoisCommand extends Command
@@ -471,6 +467,7 @@ class MessageCommand extends Command
throw $e;
}
// TRANS: Command exception text shown when trying to send a direct message to a remote user (a user not registered at the current server).
+ // TRANS: %s is a remote profile.
throw new CommandException(sprintf(_('%s is a remote profile; you can only send direct messages to users on the same server.'), $this->other));
}
@@ -611,7 +608,6 @@ class ReplyCommand extends Command
class GetCommand extends Command
{
-
var $other = null;
function __construct($user, $other)
@@ -638,7 +634,6 @@ class GetCommand extends Command
class SubCommand extends Command
{
-
var $other = null;
function __construct($user, $other)
@@ -678,7 +673,6 @@ class SubCommand extends Command
class UnsubCommand extends Command
{
-
var $other = null;
function __construct($user, $other)
@@ -712,6 +706,7 @@ class UnsubCommand extends Command
class OffCommand extends Command
{
var $other = null;
+
function __construct($user, $other=null)
{
parent::__construct($user);
diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php
index fbc6174bb..c288c2e5f 100644
--- a/lib/commandinterpreter.php
+++ b/lib/commandinterpreter.php
@@ -272,7 +272,7 @@ class CommandInterpreter
return false;
}
}
-
+
/**
* Split arguments without triggering a PHP notice warning
*/
@@ -285,4 +285,3 @@ class CommandInterpreter
return $pieces;
}
}
-
diff --git a/lib/common.php b/lib/common.php
index e08d530f0..236f2d68a 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -132,11 +132,17 @@ try {
} catch (NoConfigException $e) {
// XXX: Throw a conniption if database not installed
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
+ // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
echo '<p>'. _('No configuration file found. ') .'</p>';
- echo '<p>'. _('I looked for configuration files in the following places: ') .'<br/> ';
- echo implode($e->configFiles, '<br/>');
+ // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
+ // TRANS: Is followed by a list of directories (separated by HTML breaks).
+ echo '<p>'. _('I looked for configuration files in the following places: ') .'<br /> ';
+ echo implode($e->configFiles, '<br />');
+ // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
echo '<p>'. _('You may wish to run the installer to fix this.') .'</p>';
+ // @todo FIXME Link should be in a para?
+ // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
+ // TRANS: The text is link text that leads to the installer page.
echo '<a href="install.php">'. _('Go to the installer.') .'</a>';
exit;
}
-
diff --git a/lib/connectsettingsaction.php b/lib/connectsettingsaction.php
index b9c14799e..bb2e86176 100644
--- a/lib/connectsettingsaction.php
+++ b/lib/connectsettingsaction.php
@@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/settingsaction.php';
*
* @see Widget
*/
-
class ConnectSettingsAction extends SettingsAction
{
/**
@@ -54,7 +53,6 @@ class ConnectSettingsAction extends SettingsAction
*
* @return void
*/
-
function showLocalNav()
{
$menu = new ConnectSettingsNav($this);
@@ -73,7 +71,6 @@ class ConnectSettingsAction extends SettingsAction
*
* @see HTMLOutputter
*/
-
class ConnectSettingsNav extends Widget
{
var $action = null;
@@ -83,7 +80,6 @@ class ConnectSettingsNav extends Widget
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null)
{
parent::__construct($action);
@@ -95,7 +91,6 @@ class ConnectSettingsNav extends Widget
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
@@ -107,17 +102,23 @@ class ConnectSettingsNav extends Widget
$menu = array();
if (common_config('xmpp', 'enabled')) {
$menu['imsettings'] =
- array(_('IM'),
+ // TRANS: Menu item for Instant Messaging settings.
+ array(_m('MENU','IM'),
+ // TRANS: Tooltip for Instant Messaging menu item.
_('Updates by instant messenger (IM)'));
}
if (common_config('sms', 'enabled')) {
$menu['smssettings'] =
- array(_('SMS'),
+ // TRANS: Menu item for Short Message Service settings.
+ array(_m('MENU','SMS'),
+ // TRANS: Tooltip for Short Message Service menu item.
_('Updates by SMS'));
}
-
+
$menu['oauthconnectionssettings'] = array(
- _('Connections'),
+ // TRANS: Menu item for OAth connection settings.
+ _m('MENU','Connections'),
+ // TRANS: Tooltip for connected applications (Connections through OAth) menu item.
_('Authorized connected applications')
);
@@ -133,6 +134,4 @@ class ConnectSettingsNav extends Widget
$this->action->elementEnd('ul');
}
-
}
-
diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php
index c2f38cd00..490f87d13 100644
--- a/lib/currentuserdesignaction.php
+++ b/lib/currentuserdesignaction.php
@@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/
*
*/
-
class CurrentUserDesignAction extends Action
{
/**
@@ -54,7 +53,6 @@ class CurrentUserDesignAction extends Action
*
* @return Design a design object to use
*/
-
function getDesign()
{
$cur = common_current_user();
diff --git a/lib/feedlist.php b/lib/feedlist.php
index 7493e3575..4aacf0b3d 100644
--- a/lib/feedlist.php
+++ b/lib/feedlist.php
@@ -59,42 +59,50 @@ class FeedList extends Widget
function show($feeds)
{
- $this->out->elementStart('div', array('id' => 'export_data',
- 'class' => 'section'));
- $this->out->element('h2', null, _('Feeds'));
- $this->out->elementStart('ul', array('class' => 'xoxo'));
+ if (Event::handle('StartShowFeedLinkList', array($this->action, &$feeds))) {
+ if (!empty($feeds)) {
+ $this->out->elementStart('div', array('id' => 'export_data',
+ 'class' => 'section'));
+ $this->out->element('h2', null, _('Feeds'));
+ $this->out->elementStart('ul', array('class' => 'xoxo'));
- foreach ($feeds as $feed) {
- $this->feedItem($feed);
- }
+ foreach ($feeds as $feed) {
+ $this->feedItem($feed);
+ }
- $this->out->elementEnd('ul');
- $this->out->elementEnd('div');
+ $this->out->elementEnd('ul');
+ $this->out->elementEnd('div');
+ }
+ Event::handle('EndShowFeedLinkList', array($this->action, &$feeds));
+ }
}
function feedItem($feed)
{
- $classname = null;
+ if (Event::handle('StartShowFeedLink', array($this->action, &$feed))) {
+ $classname = null;
- switch ($feed->type) {
- case Feed::RSS1:
- case Feed::RSS2:
- $classname = 'rss';
- break;
- case Feed::ATOM:
- $classname = 'atom';
- break;
- case Feed::FOAF:
- $classname = 'foaf';
- break;
- }
+ switch ($feed->type) {
+ case Feed::RSS1:
+ case Feed::RSS2:
+ $classname = 'rss';
+ break;
+ case Feed::ATOM:
+ $classname = 'atom';
+ break;
+ case Feed::FOAF:
+ $classname = 'foaf';
+ break;
+ }
- $this->out->elementStart('li');
- $this->out->element('a', array('href' => $feed->url,
- 'class' => $classname,
- 'type' => $feed->mimeType(),
- 'title' => $feed->title),
- $feed->typeName());
- $this->out->elementEnd('li');
+ $this->out->elementStart('li');
+ $this->out->element('a', array('href' => $feed->url,
+ 'class' => $classname,
+ 'type' => $feed->mimeType(),
+ 'title' => $feed->title),
+ $feed->typeName());
+ $this->out->elementEnd('li');
+ Event::handle('EndShowFeedLink', array($this->action, $feed));
+ }
}
}