]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
start using design object
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 27 May 2009 18:49:20 +0000 (14:49 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 27 May 2009 18:49:20 +0000 (14:49 -0400)
actions/designsettings.php

index 8d8e5bad88f164ee7781d04060e9da04157e0333..da88940427f8a4e698bbd1160bfb375bc48548bb 100644 (file)
@@ -98,28 +98,18 @@ class DesignsettingsAction extends AccountSettingsAction
         $this->element('legend', null, _('Change colours'));
         $this->elementStart('ul', 'form_data');
 
-        //This is a JSON object in the DB field. Here for testing. Remove later.
-        $userSwatch = '{"body":{"background-color":"#F0F2F5"},'.
-          '"#content":{"background-color":"#FFFFFF"},'.
-          '"#aside_primary":{"background-color":"#CEE1E9"},'.
-          '"html body":{"color":"#000000"},'.
-          '"a":{"color":"#002E6E"}}';
-
-        //Default theme swatch -- Where should this be stored?
-        $defaultSwatch = array('body' => array('background-color' => '#F0F2F5'),
-                               '#content' => array('background-color' => '#FFFFFF'),
-                               '#aside_primary' => array('background-color' => '#CEE1E9'),
-                               'html body' => array('color' => '#000000'),
-                               'a' => array('color' => '#002E6E'));
-
-        $userSwatch = ($userSwatch) ? json_decode($userSwatch, true) : $defaultSwatch;
-
-        $s = 0;
+        $design = $user->getDesign();
+
+        if (empty($design)) {
+            $design = $this->defaultDesign();
+        }
+
         $labelSwatch = array('Background',
                              'Content',
                              'Sidebar',
                              'Text',
                              'Links');
+
         foreach($userSwatch as $propertyvalue => $value) {
             $foo = array_values($value);
             $this->elementStart('li');
@@ -150,6 +140,7 @@ class DesignsettingsAction extends AccountSettingsAction
          if submitted Swatch == DefaultSwatch, don't store in DB.
          else store in BD
          */
+
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
     }