Fixed styles compiling and added a few missing variables
authorAlexander Ebert <ebert@woltlab.com>
Mon, 24 Sep 2012 22:14:51 +0000 (00:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 24 Sep 2012 22:14:51 +0000 (00:14 +0200)
wcfsetup/install/files/lib/data/style/Style.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/setup/db/install.sql

index af45d16a4830b11b0c067d022e4e045193d4afe0..e000dc2b6f395a91d8d73adb7ef68e0cfd09b228 100644 (file)
@@ -43,7 +43,8 @@ class Style extends DatabaseObject {
                $sql = "SELECT          variable.variableName, variable.defaultValue, value.variableValue
                        FROM            wcf".WCF_N."_style_variable variable
                        LEFT JOIN       wcf".WCF_N."_style_variable_value value
-                       ON              (value.variableID = variable.variableID AND value.styleID = ?)";
+                       ON              (value.variableID = variable.variableID AND value.styleID = ?)
+                       ORDER BY        variable.variableID ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array($this->styleID));
                while ($row = $statement->fetchArray()) {
index 5af9868393775fc02ec0f69d47c7aa53811d1450..04f2ee3d3e7d3f61fca528062e644321dfaabcf9 100644 (file)
@@ -87,10 +87,21 @@ class StyleCompiler extends SingletonFactory {
        public function compileACP() {
                $files = glob(WCF_DIR.'style/*.less');
                
+               // read default values
+               $sql = "SELECT          variableName, defaultValue
+                       FROM            wcf".WCF_N."_style_variable
+                       ORDER BY        variableID ASC";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute();
+               $variables = array();
+               while ($row = $statement->fetchArray()) {
+                       $variables[$row['variableName']] = $row['defaultValue'];
+               }
+               
                $this->compileStylesheet(
                        WCF_DIR.'acp/style/style',
                        $files,
-                       array(),
+                       $variables,
                        '',
                        new Callback(function($content) {
                                // fix relative paths
index f80c7563b378926fc92e95b8f35ff1533abb2ec7..ff25a7ddd24f3d97d8202ec46ee338cec6fc0a60 100644 (file)
@@ -943,7 +943,7 @@ INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfLinkHov
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerBackgroundColor', 'rgba(252, 253, 254, 1)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerAccentBackgroundColor', 'rgba(241, 245, 250, 1)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerHoverBackgroundColor', 'rgba(216, 231, 245, 1)');
-INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerBorderColor', '#ccc; //#bcd');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerBorderColor', '#ccc');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContainerBorderRadius', '6px');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTabularBoxBackgroundColor', '#369');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTabularBoxColor', '#fff');
@@ -989,12 +989,16 @@ INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTitleFo
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfSmallFontSize', '85%');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfWarningColor', '#fff');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfWarningBackgroundColor', '#ffb800');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfWarningBackgroundColor2', '#a67800');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfErrorColor', '#fff');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfErrorBackgroundColor', '#c95145');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfErrorBackgroundColor2', '#913d37');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfSuccessColor', '#fff');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfSuccessBackgroundColor', '#74a446');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfSuccessBackgroundColor2', '#4d7730');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfInfoColor', '#fff');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfInfoBackgroundColor', '#4674a4');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfInfoBackgroundColor2', '#304d77');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTooltipBackgroundColor', 'rgba(0, 0, 0, .8)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTooltipColor', 'white');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfGapTiny', '4px');