From 98f518b9af43dd07b97373e6e71be08d553bb21b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 24 Jun 2009 00:00:36 -0700 Subject: fix bug in which design background could accidentally get removed --- actions/groupdesignsettings.php | 2 -- actions/userdesignsettings.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/actions/groupdesignsettings.php b/actions/groupdesignsettings.php index 7270bc8f7..79c192ac4 100644 --- a/actions/groupdesignsettings.php +++ b/actions/groupdesignsettings.php @@ -238,7 +238,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction $design->sidebarcolor = $sbcolor->intValue(); $design->textcolor = $tcolor->intValue(); $design->linkcolor = $lcolor->intValue(); - $design->backgroundimage = $filepath; $design->setDisposition($on, $off, $tile); @@ -263,7 +262,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction $design->sidebarcolor = $sbcolor->intValue(); $design->textcolor = $tcolor->intValue(); $design->linkcolor = $lcolor->intValue(); - $design->backgroundimage = $filepath; $design->setDisposition($on, $off, $tile); diff --git a/actions/userdesignsettings.php b/actions/userdesignsettings.php index d6088aa9d..6e745e96f 100644 --- a/actions/userdesignsettings.php +++ b/actions/userdesignsettings.php @@ -149,7 +149,6 @@ class UserDesignSettingsAction extends DesignSettingsAction $design->sidebarcolor = $sbcolor->intValue(); $design->textcolor = $tcolor->intValue(); $design->linkcolor = $lcolor->intValue(); - $design->backgroundimage = $filepath; $design->setDisposition($on, $off, $tile); @@ -174,7 +173,6 @@ class UserDesignSettingsAction extends DesignSettingsAction $design->sidebarcolor = $sbcolor->intValue(); $design->textcolor = $tcolor->intValue(); $design->linkcolor = $lcolor->intValue(); - $design->backgroundimage = $filepath; $design->setDisposition($on, $off, $tile); -- cgit v1.2.3-54-g00ecf From b702461f6942017d1ae4a08c6701998db14ce536 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 24 Jun 2009 00:27:37 -0700 Subject: fix bad function call (needed to be static) --- lib/imagefile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/imagefile.php b/lib/imagefile.php index 0c93b257e..52e4c4b22 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -72,7 +72,8 @@ class ImageFile break; case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE: - throw new Exception(sprintf(_('That file is too big. The maximum file size is %d.'), $this->maxFileSize())); + throw new Exception(sprintf(_('That file is too big. The maximum file size is %d.'), + ImageFile::maxFileSize())); return; case UPLOAD_ERR_PARTIAL: @unlink($_FILES[$param]['tmp_name']); -- cgit v1.2.3-54-g00ecf From d72a90161b1cb748b58454e4c885b1d789ef3eca Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 24 Jun 2009 00:43:48 -0700 Subject: Only show "tile background" setting once an img has been uploaded --- lib/designsettings.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/designsettings.php b/lib/designsettings.php index 6aa6bb2f1..9650679ac 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -132,13 +132,13 @@ class DesignSettingsAction extends AccountSettingsAction _('Off')); $this->element('p', 'form_guide', _('Turn background image on or off.')); $this->elementEnd('li'); - } - $this->elementStart('li'); - $this->checkbox('design_background-image_repeat', - _('Tile background image'), - ($design->disposition & BACKGROUND_TILE) ? true : false ); - $this->elementEnd('li'); + $this->elementStart('li'); + $this->checkbox('design_background-image_repeat', + _('Tile background image'), + ($design->disposition & BACKGROUND_TILE) ? true : false ); + $this->elementEnd('li'); + } $this->elementEnd('ul'); $this->elementEnd('fieldset'); @@ -388,7 +388,11 @@ class DesignSettingsAction extends AccountSettingsAction $original = clone($design); $design->backgroundimage = $filename; + + // default to on, no tile + $design->setDisposition(true, false, false); + $result = $design->update($original); if ($result === false) { -- cgit v1.2.3-54-g00ecf