]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'mapsimprovement' into 0.9.x
authorCraig Andrews <candrews@integralblue.com>
Fri, 4 Dec 2009 00:45:29 +0000 (19:45 -0500)
committerCraig Andrews <candrews@integralblue.com>
Fri, 4 Dec 2009 00:45:29 +0000 (19:45 -0500)
actions/all.php
actions/designadminpanel.php
actions/subscribers.php
actions/subscriptions.php
actions/userbyid.php
lib/schema.php
lib/util.php
plugins/OpenID/finishaddopenid.php
scripts/fixup_utf8.php

index 61cedce7490cd08ed76d2568d85426179044242e..5a9d97dd76ed0521d53b629bc5adaeb0627cc89e 100644 (file)
@@ -160,7 +160,7 @@ class AllAction extends ProfileAction
 
     function showPageTitle()
     {
-        $user =& common_current_user();
+        $user = common_current_user();
         if ($user && ($user->id == $this->user->id)) {
             $this->element('h1', null, _("You and friends"));
         } else {
index 8bc8c445005ccfd0cb44b23dfe9b7e2288c88236..f862aff0ebed5a11b8cf2962c2176fd51734a861 100644 (file)
@@ -129,8 +129,6 @@ class DesignadminpanelAction extends AdminPanelAction
 
         $bgimage = $this->saveBackgroundImage();
 
-        common_debug("background image: $bgimage");
-
         static $settings = array('theme', 'logo');
 
         $values = array();
@@ -141,13 +139,28 @@ class DesignadminpanelAction extends AdminPanelAction
 
         $this->validate($values);
 
-        // assert(all values are valid);
+        $oldtheme = common_config('site', 'theme');
+
+        $config = new Config();
+
+        $config->query('BEGIN');
+
+        // Only update colors if the theme has not changed.
+
+        if ($oldtheme == $values['theme']) {
 
-        $bgcolor = new WebColor($this->trimmed('design_background'));
-        $ccolor  = new WebColor($this->trimmed('design_content'));
-        $sbcolor = new WebColor($this->trimmed('design_sidebar'));
-        $tcolor  = new WebColor($this->trimmed('design_text'));
-        $lcolor  = new WebColor($this->trimmed('design_links'));
+            $bgcolor = new WebColor($this->trimmed('design_background'));
+            $ccolor  = new WebColor($this->trimmed('design_content'));
+            $sbcolor = new WebColor($this->trimmed('design_sidebar'));
+            $tcolor  = new WebColor($this->trimmed('design_text'));
+            $lcolor  = new WebColor($this->trimmed('design_links'));
+
+            Config::save('design', 'backgroundcolor', $bgcolor->intValue());
+            Config::save('design', 'contentcolor', $ccolor->intValue());
+            Config::save('design', 'sidebarcolor', $sbcolor->intValue());
+            Config::save('design', 'textcolor', $tcolor->intValue());
+            Config::save('design', 'linkcolor', $lcolor->intValue());
+        }
 
         $onoff = $this->arg('design_background-image_onoff');
 
@@ -162,9 +175,11 @@ class DesignadminpanelAction extends AdminPanelAction
 
         $tile = $this->boolean('design_background-image_repeat');
 
-        $config = new Config();
+        // Hack to use Design's bit setter
+        $scratch = new Design();
+        $scratch->setDisposition($on, $off, $tile);
 
-        $config->query('BEGIN');
+        Config::save('design', 'disposition', $scratch->disposition);
 
         foreach ($settings as $setting) {
             Config::save('site', $setting, $values[$setting]);
@@ -174,21 +189,7 @@ class DesignadminpanelAction extends AdminPanelAction
             Config::save('design', 'backgroundimage', $bgimage);
         }
 
-        Config::save('design', 'backgroundcolor', $bgcolor->intValue());
-        Config::save('design', 'contentcolor', $ccolor->intValue());
-        Config::save('design', 'sidebarcolor', $sbcolor->intValue());
-        Config::save('design', 'textcolor', $tcolor->intValue());
-        Config::save('design', 'linkcolor', $lcolor->intValue());
-
-        // Hack to use Design's bit setter
-        $scratch = new Design();
-        $scratch->setDisposition($on, $off, $tile);
-
-        Config::save('design', 'disposition', $scratch->disposition);
-
         $config->query('COMMIT');
-
-        return;
     }
 
     /**
@@ -212,6 +213,10 @@ class DesignadminpanelAction extends AdminPanelAction
         }
 
         // XXX: Should we restore the default dir settings, etc.? --Z
+
+        // XXX: I can't get it to show the new settings without forcing
+        // this terrible reload -- FIX ME!
+        common_redirect(common_local_url('designadminpanel'), 303);
     }
 
     /**
index df9ec996159abf64dfb4c04b26bdfb9b7c13e359..cc9452820b2a55c491f9ee935f654c451a1aa0d4 100644 (file)
@@ -57,7 +57,7 @@ class SubscribersAction extends GalleryAction
 
     function showPageNotice()
     {
-        $user =& common_current_user();
+        $user = common_current_user();
         if ($user && ($user->id == $this->profile->id)) {
             $this->element('p', null,
                            _('These are the people who listen to '.
index cc7b38ee461f21d21f44408d6b645a70d086db00..0dc5ee76249a7904c58a0f468152547117e1af08 100644 (file)
@@ -59,7 +59,7 @@ class SubscriptionsAction extends GalleryAction
 
     function showPageNotice()
     {
-        $user =& common_current_user();
+        $user = common_current_user();
         if ($user && ($user->id == $this->profile->id)) {
             $this->element('p', null,
                            _('These are the people whose notices '.
index 86a61f20b301015b20fdd451bf4fc9296d97d503..ebff7e4a7245cf27fa45cdc7ac532b540b7894c3 100644 (file)
@@ -69,7 +69,7 @@ class UserbyidAction extends Action
         if (!$id) {
             $this->clientError(_('No id.'));
         }
-        $user =& User::staticGet($id);
+        $user = User::staticGet($id);
         if (!$user) {
             $this->clientError(_('No such user.'));
         }
index df7cb65f56db10c52f0a66f78ae79f48df0c4776..a8ba91b87fcde9ab1132db0ac81ad0c30c7e53d4 100644 (file)
@@ -94,7 +94,7 @@ class Schema
 
     public function getTableDef($name)
     {
-        $res =& $this->conn->query('DESCRIBE ' . $name);
+        $res = $this->conn->query('DESCRIBE ' . $name);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -213,7 +213,7 @@ class Schema
 
         $sql .= "); ";
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -234,7 +234,7 @@ class Schema
 
     public function dropTable($name)
     {
-        $res =& $this->conn->query("DROP TABLE $name");
+        $res = $this->conn->query("DROP TABLE $name");
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -269,7 +269,7 @@ class Schema
             $name = "$table_".implode("_", $columnNames)."_idx";
         }
 
-        $res =& $this->conn->query("ALTER TABLE $table ".
+        $res = $this->conn->query("ALTER TABLE $table ".
                                    "ADD INDEX $name (".
                                    implode(",", $columnNames).")");
 
@@ -291,7 +291,7 @@ class Schema
 
     public function dropIndex($table, $name)
     {
-        $res =& $this->conn->query("ALTER TABLE $table DROP INDEX $name");
+        $res = $this->conn->query("ALTER TABLE $table DROP INDEX $name");
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -314,7 +314,7 @@ class Schema
     {
         $sql = "ALTER TABLE $table ADD COLUMN " . $this->_columnSql($columndef);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -339,7 +339,7 @@ class Schema
         $sql = "ALTER TABLE $table MODIFY COLUMN " .
           $this->_columnSql($columndef);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -363,7 +363,7 @@ class Schema
     {
         $sql = "ALTER TABLE $table DROP COLUMN $columnName";
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
@@ -446,7 +446,7 @@ class Schema
 
         $sql = 'ALTER TABLE ' . $tableName . ' ' . implode(', ', $phrase);
 
-        $res =& $this->conn->query($sql);
+        $res = $this->conn->query($sql);
 
         if (PEAR::isError($res)) {
             throw new Exception($res->getMessage());
index 99a0a1db30fee5c9fd73f38ced66699445e7e57b..ab046e871d2bf873349e88dc3837947b58579481 100644 (file)
@@ -127,7 +127,7 @@ function common_check_user($nickname, $password)
                 if (0 == strcmp(common_munge_password($password, $user->id),
                                 $user->password)) {
                     //internal checking passed
-                    $authenticatedUser =& $user;
+                    $authenticatedUser = $user;
                 }
             }
         }
index 6e889205d7cc6130adc3aa072a93dcffb696a0d9..7cd9165231eb42df513ca82651f9dd7aad9ce50b 100644 (file)
@@ -80,7 +80,7 @@ class FinishaddopenidAction extends Action
 
     function tryLogin()
     {
-        $consumer =& oid_consumer();
+        $consumer = oid_consumer();
 
         $response = $consumer->complete(common_local_url('finishaddopenid'));
 
@@ -103,7 +103,7 @@ class FinishaddopenidAction extends Action
                 $sreg = $sreg_resp->contents();
             }
 
-            $cur =& common_current_user();
+            $cur = common_current_user();
 
             $other = oid_get_user($canonical);
 
index 5a9fba7c3f62ef84b11ea080f0459669f0c0d9d4..30befadfd4aced4786a0d9f50501e78a84a4892a 100755 (executable)
@@ -145,7 +145,7 @@ class UTF8FixerUpper
 
             echo "$id...";
 
-            $result =& $this->dbu->execute($sth, array($content, $rendered, $id));
+            $result = $this->dbu->execute($sth, array($content, $rendered, $id));
 
             if (PEAR::isError($result)) {
                 echo "ERROR: " . $result->getMessage() . "\n";
@@ -209,7 +209,7 @@ class UTF8FixerUpper
 
             echo "$id...";
 
-            $result =& $this->dbu->execute($sth, array($fullname, $location, $bio, $id));
+            $result = $this->dbu->execute($sth, array($fullname, $location, $bio, $id));
 
             if (PEAR::isError($result)) {
                 echo "ERROR: " . $result->getMessage() . "\n";
@@ -273,7 +273,7 @@ class UTF8FixerUpper
 
             echo "$id...";
 
-            $result =& $this->dbu->execute($sth, array($fullname, $location, $description, $id));
+            $result = $this->dbu->execute($sth, array($fullname, $location, $description, $id));
 
             if (PEAR::isError($result)) {
                 echo "ERROR: " . $result->getMessage() . "\n";
@@ -330,7 +330,7 @@ class UTF8FixerUpper
 
             echo "$id...";
 
-            $result =& $this->dbu->execute($sth, array($content, $rendered, $id));
+            $result = $this->dbu->execute($sth, array($content, $rendered, $id));
 
             if (PEAR::isError($result)) {
                 echo "ERROR: " . $result->getMessage() . "\n";