start using design object

This commit is contained in:
Evan Prodromou 2009-05-27 14:49:20 -04:00
parent 648d967226
commit b3628b7844
1 changed files with 6 additions and 15 deletions

View File

@ -98,28 +98,18 @@ class DesignsettingsAction extends AccountSettingsAction
$this->element('legend', null, _('Change colours')); $this->element('legend', null, _('Change colours'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
//This is a JSON object in the DB field. Here for testing. Remove later. $design = $user->getDesign();
$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? if (empty($design)) {
$defaultSwatch = array('body' => array('background-color' => '#F0F2F5'), $design = $this->defaultDesign();
'#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;
$labelSwatch = array('Background', $labelSwatch = array('Background',
'Content', 'Content',
'Sidebar', 'Sidebar',
'Text', 'Text',
'Links'); 'Links');
foreach($userSwatch as $propertyvalue => $value) { foreach($userSwatch as $propertyvalue => $value) {
$foo = array_values($value); $foo = array_values($value);
$this->elementStart('li'); $this->elementStart('li');
@ -150,6 +140,7 @@ class DesignsettingsAction extends AccountSettingsAction
if submitted Swatch == DefaultSwatch, don't store in DB. if submitted Swatch == DefaultSwatch, don't store in DB.
else store in BD else store in BD
*/ */
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }