summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/designsettings.php25
1 files changed, 8 insertions, 17 deletions
diff --git a/actions/designsettings.php b/actions/designsettings.php
index 8d8e5bad8..da8894042 100644
--- a/actions/designsettings.php
+++ b/actions/designsettings.php
@@ -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');
}