diff --git a/helpers/FileHelper.php b/helpers/FileHelper.php index 63eecd7..f7df2c5 100644 --- a/helpers/FileHelper.php +++ b/helpers/FileHelper.php @@ -31,17 +31,21 @@ private static function getThemeBaseFile() public static function updateThemeFile() { + // Base Theme $theme_base = file_get_contents(self::getThemeBaseFile()); + + // CSS Variables $vars = file_get_contents(self::getVarsFile()); - $options = ''; + // Get optional CSS + $options = ''; $config = new Config(); if ($config->showUploadAsButtons) { - $options = file_get_contents(self::getOptionsPath() . '/showUploadAsButtons.css'); + $options .= file_get_contents(self::getOptionsPath() . '/showUploadAsButtons.css'); } + // Create/Update theme.css $content = $theme_base . $options . $vars; - file_put_contents(self::getThemeFile(), $content); // Clear Asset Manager to reload theme.css diff --git a/models/Config.php b/models/Config.php index a48e758..080cef5 100644 --- a/models/Config.php +++ b/models/Config.php @@ -98,6 +98,9 @@ public function save() { $module->settings->set('showTopicMenu', $this->showTopicMenu); $module->settings->set('showUploadAsButtons', $this->showUploadAsButtons); + // Make sure variables.css has the current colors + (new colorSettings())->saveVarsToFile(); + // Update theme.css (apply showUploadAsButtons) FileHelper::updateThemeFile();