diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-05-27 14:49:20 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-05-27 14:49:20 -0400 |
commit | b3628b78448266fda2368f1317e70d1cca45ac17 (patch) | |
tree | 1f0d8886f85ac3f20093dc7ced04284f1bba6ac1 /actions | |
parent | 648d967226f3b47aa6237d2be9d1a82df4f78402 (diff) |
start using design object
Diffstat (limited to 'actions')
-rw-r--r-- | actions/designsettings.php | 25 |
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'); } |