示例#1
0
 /**
  * Order of files for SCSS
  *  Variables.scss
  *  custom.scss
  *  Bootstrap.scss
  */
 protected function PreviewScss($dir)
 {
     global $langmessage;
     $style_files = array();
     // variables.scss
     $var_file = $dir . '/variables.scss';
     if (file_exists($var_file)) {
         $style_files[] = $var_file;
     }
     //custom
     $temp = trim($_REQUEST['css']);
     if (!empty($temp)) {
         $style_files[] = $_REQUEST['css'] . "\n";
         //make sure this is seen as code and not a filename
     }
     $style_files[] = $dir . '/style.scss';
     $compiled = \gp\tool\Output\Css::ParseScss($style_files);
     if ($compiled === false) {
         message($langmessage['OOPS'] . ' (Invalid SCSS)');
         return false;
     }
     $this->page->head .= '<style>' . $compiled . '</style>';
     $this->page->get_theme_css = false;
 }