summaryrefslogtreecommitdiff
path: root/actions/designsettings.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/designsettings.php')
-rw-r--r--actions/designsettings.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/actions/designsettings.php b/actions/designsettings.php
index e97d01ceb..866d8aaeb 100644
--- a/actions/designsettings.php
+++ b/actions/designsettings.php
@@ -71,6 +71,12 @@ class DesignsettingsAction extends AccountSettingsAction
function showContent()
{
$user = common_current_user();
+ $design = $user->getDesign();
+
+ if (empty($design)) {
+ $design = $this->defaultDesign();
+ }
+
$this->elementStart('form', array('method' => 'post',
'enctype' => 'multipart/form-data',
'id' => 'form_settings_design',
@@ -122,7 +128,7 @@ class DesignsettingsAction extends AccountSettingsAction
$this->elementStart('li');
$this->checkbox('design_background-image_repeat',
_('Tile background image'),
- false, null, true, false);
+ $design->tile);
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -132,12 +138,6 @@ class DesignsettingsAction extends AccountSettingsAction
$this->element('legend', null, _('Change colours'));
$this->elementStart('ul', 'form_data');
- $design = $user->getDesign();
-
- if (empty($design)) {
- $design = $this->defaultDesign();
- }
-
try {
$bgcolor = new WebColor($design->backgroundcolor);
@@ -340,6 +340,8 @@ class DesignsettingsAction extends AccountSettingsAction
$design->backgroundimage = $defaults['backgroundimage'];
+ $deisng->tile = $defaults['tile'];
+
} catch (WebColorException $e) {
common_log(LOG_ERR, _('Bad default color settings: ' .
$e->getMessage()));
@@ -369,6 +371,8 @@ class DesignsettingsAction extends AccountSettingsAction
return;
}
+ $tile = $this->boolean('design_background-image_repeat');
+
$user = common_current_user();
$design = $user->getDesign();
@@ -382,6 +386,7 @@ class DesignsettingsAction extends AccountSettingsAction
$design->textcolor = $tcolor->intValue();
$design->linkcolor = $lcolor->intValue();
$design->backgroundimage = $filepath;
+ $design->tile = $tile;
$result = $design->update($original);
@@ -405,6 +410,7 @@ class DesignsettingsAction extends AccountSettingsAction
$design->textcolor = $tcolor->intValue();
$design->linkcolor = $lcolor->intValue();
$design->backgroundimage = $filepath;
+ $design->tile = $tile;
$id = $design->insert();