diff options
author | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-09-28 23:42:18 +0200 |
---|---|---|
committer | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-09-28 23:42:18 +0200 |
commit | 9587f9f55b55d2819f9ba57f7befd165ab842fa6 (patch) | |
tree | 1a8986578755dfb51ff6b04bdc7c007917e29fe5 /classes | |
parent | b03ece26eb1589c5200094f4d87455ca46db780b (diff) |
* i18n/L10n and translator documentation updates.
* whitespace and indentation updates
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Profile.php | 4 | ||||
-rw-r--r-- | classes/Profile_tag.php | 2 | ||||
-rw-r--r-- | classes/Remember_me.php | 10 | ||||
-rw-r--r-- | classes/Remote_profile.php | 8 | ||||
-rw-r--r-- | classes/Safe_DataObject.php | 1 | ||||
-rw-r--r-- | classes/Sms_carrier.php | 4 | ||||
-rw-r--r-- | classes/Status_network.php | 12 | ||||
-rw-r--r-- | classes/Status_network_tag.php | 4 | ||||
-rw-r--r-- | classes/Subscription.php | 5 | ||||
-rw-r--r-- | classes/User_group.php | 1 | ||||
-rw-r--r-- | classes/User_username.php | 6 |
11 files changed, 31 insertions, 26 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 8f8679550..3a381fcc8 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -103,7 +103,6 @@ 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 if (!($avatar->width == $size && $avatar->height == $size)) { - $scaled_filename = $imagefile->resize($size); //$scaled = DB_DataObject::factory('avatar'); @@ -790,13 +789,14 @@ class Profile extends Memcached_DataObject * @param $right string Name of the right, usually a constant in class Right * @return boolean whether the user has the right in question */ - function hasRight($right) { $result = false; + if ($this->hasRole(Profile_role::DELETED)) { return false; } + if (Event::handle('UserRightsCheck', array($this, $right, &$result))) { switch ($right) { diff --git a/classes/Profile_tag.php b/classes/Profile_tag.php index 0a1ad9cd6..ab6bab096 100644 --- a/classes/Profile_tag.php +++ b/classes/Profile_tag.php @@ -23,7 +23,6 @@ class Profile_tag extends Memcached_DataObject ###END_AUTOCODE static function getTags($tagger, $tagged) { - $tags = array(); # XXX: store this in memcached @@ -44,7 +43,6 @@ class Profile_tag extends Memcached_DataObject } static function setTags($tagger, $tagged, $newtags) { - $newtags = array_unique($newtags); $oldtags = Profile_tag::getTags($tagger, $tagged); diff --git a/classes/Remember_me.php b/classes/Remember_me.php index 8dc29bfa3..3df7a9983 100644 --- a/classes/Remember_me.php +++ b/classes/Remember_me.php @@ -4,7 +4,7 @@ */ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Remember_me extends Memcached_DataObject +class Remember_me extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -16,11 +16,15 @@ class Remember_me extends Memcached_DataObject /* Static get */ function staticGet($k,$v=null) - { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } + { + return Memcached_DataObject::staticGet('Remember_me',$k,$v); + } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE function sequenceKey() - { return array(false, false); } + { + return array(false, false); + } } diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php index 77bfbcd99..1672e9f95 100644 --- a/classes/Remote_profile.php +++ b/classes/Remote_profile.php @@ -24,7 +24,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } */ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Remote_profile extends Memcached_DataObject +class Remote_profile extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -32,8 +32,8 @@ class Remote_profile extends Memcached_DataObject public $__table = 'remote_profile'; // table name public $id; // int(4) primary_key not_null public $uri; // varchar(255) unique_key - public $postnoticeurl; // varchar(255) - public $updateprofileurl; // varchar(255) + public $postnoticeurl; // varchar(255) + public $updateprofileurl; // varchar(255) public $created; // datetime() not_null public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP @@ -43,7 +43,7 @@ class Remote_profile extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - + function hasRight($right) { $profile = Profile::staticGet($this->id); diff --git a/classes/Safe_DataObject.php b/classes/Safe_DataObject.php index f0ea6b136..891e33a66 100644 --- a/classes/Safe_DataObject.php +++ b/classes/Safe_DataObject.php @@ -287,4 +287,3 @@ class Safe_DataObject extends DB_DataObject return Safe_DataObject::$iniCache[$key]; } } - diff --git a/classes/Sms_carrier.php b/classes/Sms_carrier.php index ffa12de29..500cb4f04 100644 --- a/classes/Sms_carrier.php +++ b/classes/Sms_carrier.php @@ -4,7 +4,7 @@ */ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Sms_carrier extends Memcached_DataObject +class Sms_carrier extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -22,7 +22,7 @@ class Sms_carrier extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - + function toEmailAddress($sms) { return sprintf($this->email_pattern, $sms); diff --git a/classes/Status_network.php b/classes/Status_network.php index 70c7a58eb..5d01e72cc 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -168,16 +168,16 @@ class Status_network extends Safe_DataObject $orig->decache(); $result = $this->query($qry); $this->decache(); - + return $result; } - + function delete() { $this->decache(); # while we still have the values! return parent::delete(); } - + /** * @param string $servername hostname * @param string $wildcard hostname suffix to match wildcard config @@ -313,7 +313,7 @@ class Status_network extends Safe_DataObject if (empty($result)) { return explode('|', $this->tags); } - + return $result; } @@ -331,7 +331,7 @@ class Status_network extends Safe_DataObject $snt->site_id = $this->site_id; $snt->tag = $tag; $snt->created = common_sql_now(); - + $id = $snt->insert(); if (!$id) { // TRANS: Exception thrown when a tag cannot be saved. @@ -356,7 +356,7 @@ class Status_network extends Safe_DataObject $tag->free(); } - + /** * Check if this site record has a particular meta-info tag attached. * @param string $tag diff --git a/classes/Status_network_tag.php b/classes/Status_network_tag.php index 7dab23289..a5893c114 100644 --- a/classes/Status_network_tag.php +++ b/classes/Status_network_tag.php @@ -26,7 +26,7 @@ class Status_network_tag extends Safe_DataObject public $__table = 'status_network_tag'; // table name public $site_id; // int(4) primary_key not_null - public $tag; // varchar(64) primary_key not_null + public $tag; // varchar(64) primary_key not_null public $created; // datetime() not_null @@ -34,7 +34,7 @@ class Status_network_tag extends Safe_DataObject { global $config; global $_DB_DATAOBJECT; - + $sn = new Status_network(); $sn->_connect(); diff --git a/classes/Subscription.php b/classes/Subscription.php index 1287499fa..b4dbd84c9 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -251,8 +251,11 @@ class Subscription extends Memcached_DataObject common_date_iso8601($this->created)); $act->time = strtotime($this->created); + // TRANS: Activity tile when subscribing to another person. $act->title = _("Follow"); - $act->content = sprintf(_("%s is now following %s."), + // TRANS: Notification given when one person starts following another. + // TRANS: %1$s is the subscriber, %2$s is the subscribed. + $act->content = sprintf(_("%1$s is now following %2$s."), $subscriber->getBestName(), $subscribed->getBestName()); diff --git a/classes/User_group.php b/classes/User_group.php index 0b83cfd47..cfdcef290 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -465,7 +465,6 @@ class User_group extends Memcached_DataObject } static function register($fields) { - // MAGICALLY put fields into current scope extract($fields); diff --git a/classes/User_username.php b/classes/User_username.php index 8d99cddd3..ae7785cc9 100644 --- a/classes/User_username.php +++ b/classes/User_username.php @@ -18,7 +18,9 @@ class User_username extends Memcached_DataObject /* Static get */ function staticGet($k,$v=null) - { return Memcached_DataObject::staticGet('User_username',$k,$v); } + { + return Memcached_DataObject::staticGet('User_username',$k,$v); + } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -37,6 +39,7 @@ class User_username extends Memcached_DataObject $user_username->provider_name = $provider_name; $user_username->username = $username; $user_username->created = DB_DataObject_Cast::dateTime(); + if($user_username->insert()){ return $user_username; }else{ @@ -57,5 +60,4 @@ class User_username extends Memcached_DataObject function keys() { return array('provider_name' => 'K', 'username' => 'K'); } - } |