summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-10 14:26:49 -0500
committerEvan Prodromou <evan@status.net>2009-11-10 14:26:49 -0500
commit7ae10c27b0725a7108b63a788affd4d07e37afdc (patch)
tree92f952319071ba770136d3e69a82e51040ecb6b5 /lib
parent8d5c2b3129a1d7cefd78e311d5cbbe9ab426bb72 (diff)
parent737fe763471bcb6ebd95c318363308a33e28e889 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts: lib/util.php
Diffstat (limited to 'lib')
-rw-r--r--lib/accountsettingsaction.php35
-rw-r--r--lib/api.php14
-rw-r--r--lib/apiauth.php2
-rw-r--r--lib/dberroraction.php6
-rw-r--r--lib/error.php4
-rw-r--r--lib/groupnav.php79
-rw-r--r--lib/htmloutputter.php2
-rw-r--r--lib/imagefile.php2
-rw-r--r--lib/jabber.php2
-rw-r--r--lib/mail.php6
-rw-r--r--lib/noticelist.php4
-rw-r--r--lib/queuehandler.php12
-rw-r--r--lib/rssaction.php2
-rw-r--r--lib/search_engines.php2
-rw-r--r--lib/util.php11
-rw-r--r--lib/xmloutputter.php2
-rw-r--r--lib/xmppqueuehandler.php2
17 files changed, 97 insertions, 90 deletions
diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php
index a004a3ed9..9865e1748 100644
--- a/lib/accountsettingsaction.php
+++ b/lib/accountsettingsaction.php
@@ -102,26 +102,31 @@ class AccountSettingsNav extends Widget
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
+ $user = common_current_user();
- $menu =
- array('profilesettings' =>
+ $menu = array();
+ $menu['profilesettings'] =
array(_('Profile'),
- _('Change your profile settings')),
- 'avatarsettings' =>
- array(_('Avatar'),
- _('Upload an avatar')),
- 'passwordsettings' =>
- array(_('Password'),
- _('Change your password')),
- 'emailsettings' =>
+ _('Change your profile settings'));
+ if(Event::handle('CanUserChangeField', array($user->nickname, 'avatar'))){
+ $menu['avatarsettings'] =
+ array(_('Avatar'),
+ _('Upload an avatar'));
+ }
+ if(Event::handle('CanUserChangeField', array($user->nickname, 'password'))){
+ $menu['passwordsettings'] =
+ array(_('Password'),
+ _('Change your password'));
+ }
+ $menu['emailsettings'] =
array(_('Email'),
- _('Change email handling')),
- 'userdesignsettings' =>
+ _('Change email handling'));
+ $menu['userdesignsettings'] =
array(_('Design'),
- _('Design your profile')),
- 'othersettings' =>
+ _('Design your profile'));
+ $menu['othersettings'] =
array(_('Other'),
- _('Other options')));
+ _('Other options'));
foreach ($menu as $menuaction => $menudesc) {
$this->action->menuItem(common_local_url($menuaction),
diff --git a/lib/api.php b/lib/api.php
index fb4c4289b..a1236ab7e 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -66,7 +66,7 @@ class ApiAction extends Action
*
* @param array $args Web and URL arguments
*
- * @return boolean false if user does not exist
+ * @return boolean false if user doesn't exist
*/
function prepare($args)
@@ -138,7 +138,7 @@ class ApiAction extends Action
$design = null;
$user = $profile->getUser();
- // Note: some profiles do not have an associated user
+ // Note: some profiles don't have an associated user
if (!empty($user)) {
$design = $user->getDesign();
@@ -203,7 +203,7 @@ class ApiAction extends Action
if ($get_notice) {
$notice = $profile->getCurrentNotice();
if ($notice) {
- # do not get user!
+ # don't get user!
$twitter_user['status'] = $this->twitterStatusArray($notice, false);
}
}
@@ -263,7 +263,7 @@ class ApiAction extends Action
}
if ($include_user) {
- # Do not get notice (recursive!)
+ # Don't get notice (recursive!)
$twitter_user = $this->twitterUserArray($profile, false);
$twitter_status['user'] = $twitter_user;
}
@@ -1074,7 +1074,7 @@ class ApiAction extends Action
function initTwitterAtom()
{
$this->startXML();
- // FIXME: do not hardcode the language here!
+ // FIXME: don't hardcode the language here!
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
'xml:lang' => 'en-US',
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
@@ -1116,7 +1116,7 @@ class ApiAction extends Action
return User::staticGet('nickname', $nickname);
} else if ($this->arg('user_id')) {
// This is to ensure that a non-numeric user_id still
- // overrides screen_name even if it does not get used
+ // overrides screen_name even if it doesn't get used
if (is_numeric($this->arg('user_id'))) {
return User::staticGet('id', $this->arg('user_id'));
}
@@ -1146,7 +1146,7 @@ class ApiAction extends Action
return User_group::staticGet('nickname', $nickname);
} else if ($this->arg('group_id')) {
// This is to ensure that a non-numeric user_id still
- // overrides screen_name even if it does not get used
+ // overrides screen_name even if it doesn't get used
if (is_numeric($this->arg('group_id'))) {
return User_group::staticGet('id', $this->arg('group_id'));
}
diff --git a/lib/apiauth.php b/lib/apiauth.php
index b8189f15d..2f2e44a26 100644
--- a/lib/apiauth.php
+++ b/lib/apiauth.php
@@ -87,7 +87,7 @@ class ApiAuthAction extends ApiAction
}
/**
- * Check for a user specified via HTTP basic auth. If there is not
+ * Check for a user specified via HTTP basic auth. If there isn't
* one, try to get one by outputting the basic auth header.
*
* @return boolean true or false
diff --git a/lib/dberroraction.php b/lib/dberroraction.php
index 893797b70..2cb66a022 100644
--- a/lib/dberroraction.php
+++ b/lib/dberroraction.php
@@ -39,7 +39,7 @@ require_once INSTALLDIR.'/lib/servererroraction.php';
*
* This only occurs if there's been a DB_DataObject_Error that's
* reported through PEAR, so we try to avoid doing anything that connects
- * to the DB, so we do not trigger it again.
+ * to the DB, so we don't trigger it again.
*
* @category Action
* @package StatusNet
@@ -62,12 +62,12 @@ class DBErrorAction extends ServerErrorAction
function getLanguage()
{
- // Do not try to figure out user's language; just show the page
+ // Don't try to figure out user's language; just show the page
return common_config('site', 'language');
}
function showPrimaryNav()
{
- // do not show primary nav
+ // don't show primary nav
}
}
diff --git a/lib/error.php b/lib/error.php
index 5ed5dec1b..3162cfe65 100644
--- a/lib/error.php
+++ b/lib/error.php
@@ -104,11 +104,11 @@ class ErrorAction extends Action
{
parent::showPage();
- // We do not want to have any more output after this
+ // We don't want to have any more output after this
exit();
}
- // Overload a bunch of stuff so the page is not too bloated
+ // Overload a bunch of stuff so the page isn't too bloated
function showBody()
{
diff --git a/lib/groupnav.php b/lib/groupnav.php
index 31cf378c8..131b38fa2 100644
--- a/lib/groupnav.php
+++ b/lib/groupnav.php
@@ -79,46 +79,49 @@ class GroupNav extends Widget
$nickname = $this->group->nickname;
$this->out->elementStart('ul', array('class' => 'nav'));
- $this->out->menuItem(common_local_url('showgroup', array('nickname' =>
- $nickname)),
- _('Group'),
- sprintf(_('%s group'), $nickname),
- $action_name == 'showgroup',
- 'nav_group_group');
- $this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
- $nickname)),
- _('Members'),
- sprintf(_('%s group members'), $nickname),
- $action_name == 'groupmembers',
- 'nav_group_members');
+ if (Event::handle('StartGroupGroupNav', array($this))) {
+ $this->out->menuItem(common_local_url('showgroup', array('nickname' =>
+ $nickname)),
+ _('Group'),
+ sprintf(_('%s group'), $nickname),
+ $action_name == 'showgroup',
+ 'nav_group_group');
+ $this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
+ $nickname)),
+ _('Members'),
+ sprintf(_('%s group members'), $nickname),
+ $action_name == 'groupmembers',
+ 'nav_group_members');
- $cur = common_current_user();
+ $cur = common_current_user();
- if ($cur && $cur->isAdmin($this->group)) {
- $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
- $nickname)),
- _('Blocked'),
- sprintf(_('%s blocked users'), $nickname),
- $action_name == 'blockedfromgroup',
- 'nav_group_blocked');
- $this->out->menuItem(common_local_url('editgroup', array('nickname' =>
- $nickname)),
- _('Admin'),
- sprintf(_('Edit %s group properties'), $nickname),
- $action_name == 'editgroup',
- 'nav_group_admin');
- $this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
- $nickname)),
- _('Logo'),
- sprintf(_('Add or edit %s logo'), $nickname),
- $action_name == 'grouplogo',
- 'nav_group_logo');
- $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
- $nickname)),
- _('Design'),
- sprintf(_('Add or edit %s design'), $nickname),
- $action_name == 'groupdesignsettings',
- 'nav_group_design');
+ if ($cur && $cur->isAdmin($this->group)) {
+ $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
+ $nickname)),
+ _('Blocked'),
+ sprintf(_('%s blocked users'), $nickname),
+ $action_name == 'blockedfromgroup',
+ 'nav_group_blocked');
+ $this->out->menuItem(common_local_url('editgroup', array('nickname' =>
+ $nickname)),
+ _('Admin'),
+ sprintf(_('Edit %s group properties'), $nickname),
+ $action_name == 'editgroup',
+ 'nav_group_admin');
+ $this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
+ $nickname)),
+ _('Logo'),
+ sprintf(_('Add or edit %s logo'), $nickname),
+ $action_name == 'grouplogo',
+ 'nav_group_logo');
+ $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
+ $nickname)),
+ _('Design'),
+ sprintf(_('Add or edit %s design'), $nickname),
+ $action_name == 'groupdesignsettings',
+ 'nav_group_design');
+ }
+ Event::handle('EndGroupGroupNav', array($this));
}
$this->out->elementEnd('ul');
}
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 73bd9ce81..c2ec83c28 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -76,7 +76,7 @@ class HTMLOutputter extends XMLOutputter
/**
* Start an HTML document
*
- * If $type is not specified, will attempt to do content negotiation.
+ * If $type isn't specified, will attempt to do content negotiation.
*
* Attempts to do content negotiation for language, also.
*
diff --git a/lib/imagefile.php b/lib/imagefile.php
index edc7218d0..cf1668f20 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -119,7 +119,7 @@ class ImageFile
return;
}
- // Do not crop/scale if it is not necessary
+ // Don't crop/scale if it isn't necessary
if ($size === $this->width
&& $size === $this->height
&& $x === 0
diff --git a/lib/jabber.php b/lib/jabber.php
index d666fcbb3..73f2ec660 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -437,7 +437,7 @@ function jabber_public_notice($notice)
$public = common_config('xmpp', 'public');
- // FIXME PRIV do not send out private messages here
+ // FIXME PRIV don't send out private messages here
// XXX: should we send out non-local messages if public,localonly
// = false? I think not
diff --git a/lib/mail.php b/lib/mail.php
index 79630b721..5218059e9 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -467,7 +467,7 @@ function mail_notify_nudge($from, $to)
"these days and is inviting you to post some news.\n\n".
"So let's hear from you :)\n\n".
"%3\$s\n\n".
- "Do not reply to this email. It will not get to them.\n\n".
+ "Don't reply to this email; it won't get to them.\n\n".
"With kind regards,\n".
"%4\$s\n"),
$from_profile->getBestName(),
@@ -516,7 +516,7 @@ function mail_notify_message($message, $from=null, $to=null)
"------------------------------------------------------\n\n".
"You can reply to their message here:\n\n".
"%4\$s\n\n".
- "Do not reply to this email. It will not get to them.\n\n".
+ "Don't reply to this email; it won't get to them.\n\n".
"With kind regards,\n".
"%5\$s\n"),
$from_profile->getBestName(),
@@ -532,7 +532,7 @@ function mail_notify_message($message, $from=null, $to=null)
/**
* notify a user that one of their notices has been chosen as a 'fave'
*
- * Does not check that the user has an email address nor if they
+ * Doesn't check that the user has an email address nor if they
* want to receive notification of faves. Maybe this happens higher
* up the stack...?
*
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 4e5623ded..bf12bb73c 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -347,7 +347,7 @@ class NoticeListItem extends Widget
* show the link to the main page for the notice
*
* Displays a link to the page for a notice, with "relative" time. Tries to
- * get remote notice URLs correct, but does not always succeed.
+ * get remote notice URLs correct, but doesn't always succeed.
*
* @return void
*/
@@ -483,7 +483,7 @@ class NoticeListItem extends Widget
* show a link to reply to the current notice
*
* Should either do the reply in the current notice form (if available), or
- * link out to the notice-posting form. A little flakey, does not always work.
+ * link out to the notice-posting form. A little flakey, doesn't always work.
*
* @return void
*/
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index 7c07ca4f9..cd43b1e09 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -96,8 +96,8 @@ class QueueHandler extends Daemon
* Initialization, run when the queue handler starts.
* If this function indicates failure, the handler run will be aborted.
*
- * @fixme run() will abort if this does not return true,
- * but some subclasses do not bother.
+ * @fixme run() will abort if this doesn't return true,
+ * but some subclasses don't bother.
* @return boolean true on success, false on failure
*/
function start()
@@ -108,8 +108,8 @@ class QueueHandler extends Daemon
* Cleanup, run when the queue handler ends.
* If this function indicates failure, a warning will be logged.
*
- * @fixme run() will throw warnings if this does not return true,
- * but many subclasses do not bother.
+ * @fixme run() will throw warnings if this doesn't return true,
+ * but many subclasses don't bother.
* @return boolean true on success, false on failure
*/
function finish()
@@ -137,7 +137,7 @@ class QueueHandler extends Daemon
* method, which passes control back to our handle_notice() method for
* each notice that comes in on the queue.
*
- * Most of the time this will not need to be overridden in a subclass.
+ * Most of the time this won't need to be overridden in a subclass.
*
* @return boolean true on success, false on failure
*/
@@ -173,7 +173,7 @@ class QueueHandler extends Daemon
* Called by QueueHandler after each handled item or empty polling cycle.
* This is a good time to e.g. service your XMPP connection.
*
- * Does not need to be overridden if there's no maintenance to do.
+ * Doesn't need to be overridden if there's no maintenance to do.
*
* @param int $timeout seconds to sleep if there's nothing to do
*/
diff --git a/lib/rssaction.php b/lib/rssaction.php
index 0e84a65e9..faf6bec7d 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -386,7 +386,7 @@ class Rss10Action extends Action
return null;
}
- // FIXME: does not handle modified profiles, avatars, deleted notices
+ // FIXME: doesn't handle modified profiles, avatars, deleted notices
return strtotime($this->notices[0]->created);
}
diff --git a/lib/search_engines.php b/lib/search_engines.php
index 82713235c..69f6ff468 100644
--- a/lib/search_engines.php
+++ b/lib/search_engines.php
@@ -119,7 +119,7 @@ class MySQLSearch extends SearchEngine
return true;
} else if ('identica_notices' === $this->table) {
- // Do not show imported notices
+ // Don't show imported notices
$this->target->whereAdd('notice.is_local != ' . Notice::GATEWAY);
if (strtolower($q) != $q) {
diff --git a/lib/util.php b/lib/util.php
index 0ed0688eb..65bc6544d 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -61,7 +61,6 @@ function common_init_language()
$language = common_language();
$locale_set = common_init_locale($language);
setlocale(LC_CTYPE, 'C');
-
// So we do not have to make people install the gettext locales
$path = common_config('site','locale_path');
bindtextdomain("statusnet", $path);
@@ -139,7 +138,7 @@ function common_check_user($nickname, $password)
}
}
}else{
- //no handler indicated the credentials were valid, and we know their not valid because the user is not in the database
+ //no handler indicated the credentials were valid, and we know their not valid because the user isn't in the database
return false;
}
} else {
@@ -396,7 +395,7 @@ function common_current_user()
}
// Logins that are 'remembered' aren't 'real' -- they're subject to
-// cookie-stealing. So, we do not let them do certain things. New reg,
+// cookie-stealing. So, we don't let them do certain things. New reg,
// OpenID, and password logins _are_ real.
function common_real_login($real=true)
@@ -1151,7 +1150,7 @@ function common_accept_to_prefs($accept, $def = '*/*')
$parts = explode(',', $accept);
foreach($parts as $part) {
- // FIXME: does not deal with params like 'text/html; level=1'
+ // FIXME: doesn't deal with params like 'text/html; level=1'
@list($value, $qpart) = explode(';', trim($part));
$match = array();
if(!isset($qpart)) {
@@ -1350,7 +1349,7 @@ function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
}
// FIXME: show error page if we're on the Web
- /* Do not execute PHP internal error handler */
+ /* Don't execute PHP internal error handler */
return true;
}
@@ -1452,7 +1451,7 @@ function common_shorten_url($long_url)
}
global $_shorteners;
if (!isset($_shorteners[$svc])) {
- //the user selected service does not exist, so default to ur1.ca
+ //the user selected service doesn't exist, so default to ur1.ca
$svc = 'ur1.ca';
}
if (!isset($_shorteners[$svc])) {
diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php
index 9d862b2d0..5f06e491d 100644
--- a/lib/xmloutputter.php
+++ b/lib/xmloutputter.php
@@ -112,7 +112,7 @@ class XMLOutputter
*
* Utility for outputting an XML element. A convenient wrapper
* for a bunch of longer XMLWriter calls. This is best for
- * when an element does not have any sub-elements; if that's the
+ * when an element doesn't have any sub-elements; if that's the
* case, use elementStart() and elementEnd() instead.
*
* The $content element will be escaped for XML. If you need
diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php
index 7caa078ae..f28fc9088 100644
--- a/lib/xmppqueuehandler.php
+++ b/lib/xmppqueuehandler.php
@@ -37,7 +37,7 @@ class XmppQueueHandler extends QueueHandler
function start()
{
- # Low priority; we do not want to receive messages
+ # Low priority; we don't want to receive messages
$this->log(LOG_INFO, "INITIALIZE");
$this->conn = jabber_connect($this->_id.$this->transport());