Added support for individual CSS/LESS
authorAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:02:05 +0000 (18:02 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:02:05 +0000 (18:02 +0200)
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/setup/db/install.sql

index 81b1132f742f23668a4d6242ed519127cec33973..40812b24292a886c4799013f1475519c909348dc 100644 (file)
@@ -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<string>           $files
         * @param       array<string>           $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 {
index ebcf59e64b4633e4fd82c4be7ecd1b881f9ba4f2..b942ae23eec1e1dfe43bd3448a45bf12569dc459 100644 (file)
@@ -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', '~""');