From a0aa4447dd2f6fe028178806f7c38e537b97ed24 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 25 Sep 2012 00:14:51 +0200 Subject: [PATCH] Fixed styles compiling and added a few missing variables --- .../install/files/lib/data/style/Style.class.php | 3 ++- .../files/lib/system/style/StyleCompiler.class.php | 13 ++++++++++++- wcfsetup/setup/db/install.sql | 6 +++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index af45d16a48..e000dc2b6f 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -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()) { diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 5af9868393..04f2ee3d3e 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -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 diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index f80c7563b3..ff25a7ddd2 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -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'); -- 2.20.1