From: Alexander Ebert Date: Thu, 25 Oct 2012 16:02:05 +0000 (+0200) Subject: Added support for individual CSS/LESS X-Git-Tag: 2.0.0_Beta_1~833^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c51de58be629be90d6079a86fc56abd9396a3ec;p=GitHub%2FWoltLab%2FWCF.git Added support for individual CSS/LESS --- diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 81b1132f74..40812b2429 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -64,17 +64,17 @@ class StyleCompiler extends SingletonFactory { // get style variables $variables = $style->getVariables(); - $individualCss = ''; - if (isset($variables['individualCss'])) { - $individualCss = $variables['individualCss']; - unset($variables['individualCss']); + $individualLess = ''; + if (isset($variables['individualLess'])) { + $individualLess = $variables['individualLess']; + unset($variables['individualLess']); } $this->compileStylesheet( WCF_DIR.'style/style-'.ApplicationHandler::getInstance()->getPrimaryApplication()->packageID.'-'.$style->styleID, $files, $variables, - $individualCss, + $individualLess, new Callback(function($content) use ($style) { return "/* stylesheet for '".$style->styleName."', generated on ".gmdate('r')." -- DO NOT EDIT */\n\n" . $content; }) @@ -155,10 +155,10 @@ class StyleCompiler extends SingletonFactory { * @param string $filename * @param array $files * @param array $variables - * @param string $individualCss + * @param string $individualLess * @param wcf\system\Callback $callback */ - protected function compileStylesheet($filename, array $files, array $variables, $individualCss, Callback $callback) { + protected function compileStylesheet($filename, array $files, array $variables, $individualLess, Callback $callback) { // build LESS bootstrap $less = $this->bootstrap($variables); foreach ($files as $file) { @@ -166,8 +166,8 @@ class StyleCompiler extends SingletonFactory { } // append individual CSS/LESS - if ($individualCss) { - $less .= $individualCss; + if ($individualLess) { + $less .= $individualLess; } try { diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index ebcf59e64b..b942ae23ee 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -1019,3 +1019,6 @@ INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfMainMen INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfUserPanelHoverBackgroundColor', 'rgba(60, 60, 60, 1)'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfMarkedBackgroundColor', 'rgba(255, 255, 200, 1)'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('useFluidLayout', '1'); +INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('pageLogo', '~""'); +INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('individualLess', '~""'); +INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('overrideLess', '~""');