From ce23271d3f5764400ac2ad323bb43d3d8f3f5160 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 25 Oct 2012 18:01:51 +0200 Subject: [PATCH] Added some more variables to style editor --- acptemplates/styleAdd.tpl | 43 ++++++++++++++++++++++- files/lib/acp/form/StyleAddForm.class.php | 30 +++++++++++----- language/de.xml | 10 +++++- 3 files changed, 73 insertions(+), 10 deletions(-) diff --git a/acptemplates/styleAdd.tpl b/acptemplates/styleAdd.tpl index d99b2f0d71..5e198c08c6 100644 --- a/acptemplates/styleAdd.tpl +++ b/acptemplates/styleAdd.tpl @@ -69,6 +69,7 @@
  • {lang}wcf.acp.style.general{/lang}
  • {lang}wcf.acp.style.globals{/lang}
  • {lang}wcf.acp.style.colors{/lang}
  • +
  • {lang}wcf.acp.style.advanced{/lang}
  • @@ -287,7 +288,7 @@
    @@ -317,6 +318,13 @@ +
    +
    +
    + + {lang}wcf.acp.style.globals.pageLogo.description{/lang} +
    +
    {* font *} @@ -349,6 +357,18 @@ {* colors *}
    +
    + {lang}wcf.acp.style.colors.page{/lang} + + {* page *} +
      +
    • {include file='styleVariableColor' variableName='wcfPageBackgroundColor' languageVariable='backgroundColor'}
    • +
    • {include file='styleVariableColor' variableName='wcfPageColor' languageVariable='color'}
    • +
    • {include file='styleVariableColor' variableName='wcfPageLinkColor' languageVariable='linkColor'}
    • +
    • {include file='styleVariableColor' variableName='wcfPageLinkHoverColor' languageVariable='linkHoverColor'}
    • +
    +
    +
    {lang}wcf.acp.style.colors.content{/lang} @@ -435,6 +455,27 @@
    + + {* advanced *} +
    +

    {lang}wcf.acp.style.advanced.syntax{/lang}

    + +
    + {lang}wcf.acp.style.advanced.individualLess{/lang} + + + {lang}wcf.acp.style.advanced.individualLess.description{/lang} +
    + +
    + {lang}wcf.acp.style.advanced.overrideLess{/lang} + +

    {lang}wcf.acp.style.advanced.overrideLess.warning{/lang}

    + + + {lang}wcf.acp.style.advanced.overrideLess.description{/lang} +
    +
    diff --git a/files/lib/acp/form/StyleAddForm.class.php b/files/lib/acp/form/StyleAddForm.class.php index 2de0593999..d7edea55ae 100644 --- a/files/lib/acp/form/StyleAddForm.class.php +++ b/files/lib/acp/form/StyleAddForm.class.php @@ -157,16 +157,16 @@ class StyleAddForm extends ACPForm { public $tmpHash = ''; /** - * fluid or fixed layout - * @var boolean + * list of variables and their value + * @var array */ - public $useFluidLayout = true; + public $variables = array(); /** - * list of variables and their value + * list of specialized variables * @var array */ - public $variables = array(); + public $specialVariables = array(); /** * @see wcf\page\IPage::readParameters() @@ -214,7 +214,11 @@ class StyleAddForm extends ACPForm { } } - $this->useFluidLayout = (isset($_POST['useFluidLayout'])); + // read specialized variables + foreach ($this->specialVariables as $variableName) { + if (isset($_POST[$variableName])) $this->variables[$variableName] = StringUtil::trim($_POST[$variableName]); + } + $this->variables['useFluidLayout'] = (isset($_POST['useFluidLayout'])) ? 1 : 0; // style data if (isset($_POST['authorName'])) $this->authorName = StringUtil::trim($_POST['authorName']); @@ -346,6 +350,10 @@ class StyleAddForm extends ACPForm { 'wcfInputHoverBorderColor', 'wcfLinkColor', 'wcfLinkHoverColor', + 'wcfPageBackgroundColor', + 'wcfPageColor', + 'wcfPageLinkColor', + 'wcfPageLinkHoverColor', 'wcfTabularBoxBackgroundColor', 'wcfTabularBoxColor', 'wcfTabularBoxHoverColor', @@ -363,6 +371,14 @@ class StyleAddForm extends ACPForm { 'wcfLayoutFluidGap' ); + // set specialized variables + $this->specialVariables = array( + 'individualLess', + 'overrideLess', + 'pageLogo', + 'useFluidLayout' + ); + EventHandler::getInstance()->fireAction($this, 'setVariables'); } @@ -415,7 +431,6 @@ class StyleAddForm extends ACPForm { $this->iconPath = 'icon/'; $this->imagePath = 'images/'; $this->templateGroupID = 0; - $this->useFluidLayout = true; // reload variables $this->readStyleVariables(); @@ -447,7 +462,6 @@ class StyleAddForm extends ACPForm { 'styleVersion' => $this->styleVersion, 'templateGroupID' => $this->templateGroupID, 'tmpHash' => $this->tmpHash, - 'useFluidLayout' => $this->useFluidLayout, 'variables' => $this->variables )); } diff --git a/language/de.xml b/language/de.xml index 241677b3be..81089b2738 100644 --- a/language/de.xml +++ b/language/de.xml @@ -8,6 +8,13 @@ + + + + + + + getPath()}acp/dereferrer.php?url=http://www.lesscss.org">LESS verwenden. Bitte beachten Sie, dass der Stil nicht erzeugt werden kann, wenn der LESS-Code ungültig ist.]]> @@ -20,13 +27,14 @@ - + + -- 2.20.1