summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-10 00:43:58 -0800
committerZach Copley <zach@status.net>2009-11-10 00:43:58 -0800
commitcae06a49ea60cacb926f27b18b88a8a7f801f011 (patch)
tree4a1a8b448666f1dd7ff1a8395d7ce75ef4933956 /classes
parentdbb86f948684cd5a5a49f6881f50082698fd39d1 (diff)
parent223fee2ad1430e827830265c9fe97f4d025bb060 (diff)
Merge branch '0.9.x' into finish-account-api
* 0.9.x: (26 commits) just sent a http 200 for the check-fancy from install.php Add a new event: CanUserChangeField shorten flag notification and include a class Added flag icon for UserFlag plugin Fixed notice option alignment in IE add a method to Theme class to list available themes Updated Realtime plugin to use the util's NoticeReply object Localisation updates from translatewiki.net (2009-11-08) Update pot again Rebuild pot file *without* --join-existing to get rid of the cruft. Not sure why "--join-existing" must be in. Only thing I can think of is manual additions, which I could not find. Revert "More precise field label" Remove more contractions Revert "* [Cc]an't -> [Cc]annot" Revert "More specifics on 'address'" * [Cc]an't -> [Cc]annot Revert "* check usage of 'people' in UI and change it to 'users' or something else in most places" add utilities for calculating local and installation theme root dirs Harmonise UI message "No such user." Restructure theme.php to define a class Theme entity_action responses look more inactive now ...
Diffstat (limited to 'classes')
-rw-r--r--classes/Avatar.php2
-rw-r--r--classes/File_redirection.php8
-rw-r--r--classes/Notice.php6
-rw-r--r--classes/Profile.php4
-rw-r--r--classes/User.php14
-rw-r--r--classes/User_group.php2
-rw-r--r--classes/User_role.php3
7 files changed, 22 insertions, 17 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 64f105179..cc7a6b647 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -102,6 +102,6 @@ class Avatar extends Memcached_DataObject
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
- return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ return Theme::path('default-avatar-'.$sizenames[$size].'.png');
}
}
diff --git a/classes/File_redirection.php b/classes/File_redirection.php
index 08a6e8d8b..c951c1ee7 100644
--- a/classes/File_redirection.php
+++ b/classes/File_redirection.php
@@ -53,7 +53,7 @@ class File_redirection extends Memcached_DataObject
'connect_timeout' => 10, // # seconds to wait
'max_redirs' => $redirs, // # max number of http redirections to follow
'follow_redirects' => true, // Follow redirects
- 'store_body' => false, // We won't need body content here.
+ 'store_body' => false, // We will not need body content here.
));
return $request;
}
@@ -81,12 +81,12 @@ class File_redirection extends Memcached_DataObject
}
try {
$request = self::_commonHttp($short_url, $redirs);
- // Don't include body in output
+ // Do not include body in output
$request->setMethod(HTTP_Request2::METHOD_HEAD);
$response = $request->send();
if (405 == $response->getStatus()) {
- // Server doesn't support HEAD method? Can this really happen?
+ // Server does not support HEAD method? Can this really happen?
// We'll try again as a GET and ignore the response data.
$request = self::_commonHttp($short_url, $redirs);
$response = $request->send();
@@ -178,7 +178,7 @@ class File_redirection extends Memcached_DataObject
case 'aim':
case 'jabber':
case 'xmpp':
- // don't touch anything
+ // do not touch anything
break;
default:
diff --git a/classes/Notice.php b/classes/Notice.php
index 9886875cb..32a8b693c 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -146,7 +146,7 @@ class Notice extends Memcached_DataObject
/* Add them to the database */
foreach(array_unique($hashtags) as $hashtag) {
- /* elide characters we don't want in the tag */
+ /* elide characters we do not want in the tag */
$this->saveTag($hashtag);
}
return true;
@@ -1105,7 +1105,7 @@ class Notice extends Memcached_DataObject
if (empty($recipient)) {
continue;
}
- // Don't save replies from blocked profile to local user
+ // Do not save replies from blocked profile to local user
$recipient_user = User::staticGet('id', $recipient->id);
if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) {
continue;
@@ -1131,7 +1131,7 @@ class Notice extends Memcached_DataObject
$tagged = Profile_tag::getTagged($sender->id, $tag);
foreach ($tagged as $t) {
if (!$replied[$t->id]) {
- // Don't save replies from blocked profile to local user
+ // Do not save replies from blocked profile to local user
$t_user = User::staticGet('id', $t->id);
if ($t_user && $t_user->hasBlocked($sender)) {
continue;
diff --git a/classes/Profile.php b/classes/Profile.php
index 7c1e9db33..a50f4951d 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -101,7 +101,7 @@ class Profile extends Memcached_DataObject
}
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
- # We don't do a scaled one if original is our scaled size
+ # We do not do a scaled one if original is our scaled size
if (!($avatar->width == $size && $avatar->height == $size)) {
$scaled_filename = $imagefile->resize($size);
@@ -174,7 +174,7 @@ class Profile extends Memcached_DataObject
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0, $since=null)
{
- // XXX: I'm not sure this is going to be any faster. It probably isn't.
+ // XXX: I'm not sure this is going to be any faster. It probably is not.
$ids = Notice::stream(array($this, '_streamDirect'),
array(),
'profile:notice_ids:' . $this->id,
diff --git a/classes/User.php b/classes/User.php
index b0d372be8..c529b82e0 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -87,7 +87,7 @@ class User extends Memcached_DataObject
return (is_null($sub)) ? false : true;
}
- // 'update' won't write key columns, so we have to do it ourselves.
+ // 'update' will not write key columns, so we have to do it ourselves.
function updateKeys(&$orig)
{
@@ -384,7 +384,7 @@ class User extends Memcached_DataObject
return false;
}
- // Otherwise, cache doesn't have all faves;
+ // Otherwise, cache does not have all faves;
// fall through to the default
}
@@ -463,7 +463,7 @@ class User extends Memcached_DataObject
{
$cache = common_memcache();
if ($cache) {
- // Faves don't happen chronologically, so we need to blow
+ // Faves do not happen chronologically, so we need to blow
// ;last cache, too
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
@@ -705,10 +705,12 @@ class User extends Memcached_DataObject
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
switch ($right)
{
- case Right::deleteOthersNotice:
- $result = $this->hasRole('moderator');
+ case Right::DELETEOTHERSNOTICE:
+ $result = $this->hasRole(User_role::MODERATOR);
break;
- default:
+ case Right::CONFIGURESITE:
+ $result = $this->hasRole(User_role::ADMINISTRATOR);
+ default:
$result = false;
break;
}
diff --git a/classes/User_group.php b/classes/User_group.php
index 310ecff1e..b92638f7a 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -34,7 +34,7 @@ class User_group extends Memcached_DataObject
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
- return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ return Theme::path('default-avatar-'.$sizenames[$size].'.png');
}
function homeUrl()
diff --git a/classes/User_role.php b/classes/User_role.php
index 85ecfb422..fc3806897 100644
--- a/classes/User_role.php
+++ b/classes/User_role.php
@@ -45,4 +45,7 @@ class User_role extends Memcached_DataObject
{
return Memcached_DataObject::pkeyGet('User_role', $kv);
}
+
+ const MODERATOR = 'moderator';
+ const ADMINISTRATOR = 'administrator';
}