summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-21 16:53:10 +0200
committerBrion Vibber <brion@pobox.com>2010-06-07 18:14:15 -0700
commit8e33cdd36a27178ea98e95fdb9d17391eaec5838 (patch)
treeb262134eb15847ef565b80512073e64d01cc06b7 /actions
parent02c68ff5230e505dcfbb1dbd764415db8b8379ee (diff)
break up the giant form function in design admin panel into individual sections to make it a little more manageable
Diffstat (limited to 'actions')
-rw-r--r--actions/designadminpanel.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php
index 41d917e3c..092588019 100644
--- a/actions/designadminpanel.php
+++ b/actions/designadminpanel.php
@@ -370,7 +370,14 @@ class DesignAdminPanelForm extends AdminForm
function formData()
{
+ $this->showLogo();
+ $this->showTheme();
+ $this->showBackground();
+ $this->showColors();
+ }
+ function showLogo()
+ {
$this->out->elementStart('fieldset', array('id' => 'settings_design_logo'));
$this->out->element('legend', null, _('Change logo'));
@@ -383,6 +390,11 @@ class DesignAdminPanelForm extends AdminForm
$this->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
+
+ }
+
+ function showTheme()
+ {
$this->out->elementStart('fieldset', array('id' => 'settings_design_theme'));
$this->out->element('legend', null, _('Change theme'));
@@ -409,7 +421,10 @@ class DesignAdminPanelForm extends AdminForm
$this->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
+ }
+ function showBackground()
+ {
$design = $this->out->design;
$this->out->elementStart('fieldset', array('id' =>
@@ -483,13 +498,17 @@ class DesignAdminPanelForm extends AdminForm
$this->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
+ }
+ function showColors()
+ {
$this->out->elementStart('fieldset', array('id' => 'settings_design_color'));
$this->out->element('legend', null, _('Change colours'));
$this->out->elementStart('ul', 'form_data');
try {
+ // @fixme avoid loop unrolling in non-performance-critical contexts like this
$bgcolor = new WebColor($design->backgroundcolor);
@@ -557,6 +576,7 @@ class DesignAdminPanelForm extends AdminForm
$this->unli();
} catch (WebColorException $e) {
+ // @fixme normalize them individually!
common_log(LOG_ERR, 'Bad color values in site design: ' .
$e->getMessage());
}