Fixes issue during WCFSetup
authorMatthias Schmidt <gravatronics@live.com>
Fri, 23 Aug 2013 19:27:01 +0000 (21:27 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 23 Aug 2013 19:27:01 +0000 (21:27 +0200)
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index f6881e06046da243511580ab4ee3d837a6bc61e0..bdad35224ca8bba0344ea9695a7becebfe934a9c 100644 (file)
@@ -84,13 +84,6 @@ class StyleCompiler extends SingletonFactory {
                        unset($variables['overrideLess']);
                }
                
-               // add options as LESS variables
-               foreach (Option::getOptions() as $constantName => $option) {
-                       if (in_array($option->optionType, static::$supportedOptionType)) {
-                               $variables['wcf_option_'.mb_strtolower($constantName)] = '~"'.$option->optionValue.'"';
-                       }
-               }
-               
                $this->compileStylesheet(
                        WCF_DIR.'style/style-'.$style->styleID,
                        $files,
@@ -189,6 +182,21 @@ class StyleCompiler extends SingletonFactory {
         * @param       wcf\system\Callback     $callback
         */
        protected function compileStylesheet($filename, array $files, array $variables, $individualLess, Callback $callback) {
+               // add options as LESS variables
+               if (PACKAGE_ID) {
+                       foreach (Option::getOptions() as $constantName => $option) {
+                               if (in_array($option->optionType, static::$supportedOptionType)) {
+                                       $variables['wcf_option_'.mb_strtolower($constantName)] = '~"'.$option->optionValue.'"';
+                               }
+                       }
+               }
+               else {
+                       // workaround during setup
+                       $variables['wcf_option_attachment_thumbnail_height'] = '~"210"';
+                       $variables['wcf_option_attachment_thumbnail_width'] = '~"280"';
+                       $variables['wcf_option_signature_max_image_height'] = '~"150"';
+               }
+               
                // build LESS bootstrap
                $less = $this->bootstrap($variables);
                foreach ($files as $file) {