function complie($file = null) { $update = drupalexp_is_settings_change(); $ftime = $this->filetime($file); if (!empty($this->theme->lessc)) { foreach ($this->theme->lessc as $lessc_file) { if ($ftime < $this->filetime($lessc_file)) { $update = true; } $this->output .= "@import \"{$lessc_file}\";\n"; } } if ($update) { try { $this->css = $this->lessc->compile($this->output); } catch (exception $e) { drupal_set_message("fatal error: " . $e->getMessage(), 'error'); return FALSE; } if ($file) { $css_output = "/*This file is generated by less css (http://lesscss.org) using drupalexp framework (http://drupalexp.com)*/\n/*Please do not modify this file content*/\n" . $this->css; file_unmanaged_save_data($css_output, $file, FILE_EXISTS_REPLACE); } } return $this->css; }
function complie($file = null) { $update = drupalexp_is_settings_change(); $ftime = $this->filetime($file); if (!empty($this->theme->lessc)) { foreach ($this->theme->lessc as $lessc_file) { if ($ftime < $this->filetime($lessc_file)) { $update = true; } $this->output .= "@import \"{$lessc_file}\";\n"; } } if ($update) { try { $this->css = $this->lessc->compile($this->output); } catch (exception $e) { drupal_set_message("fatal error: " . $e->getMessage(), 'error'); return FALSE; } if ($file) { file_unmanaged_save_data($this->css, $file, FILE_EXISTS_REPLACE); } } return $this->css; }
function init() { $this->layouts(); $p = $this->get('drupalexp_presets'); $first_time = false; $init_presets = 6; if (empty($p)) { $func = $this->theme . '_default_presets'; $infunc = $this->theme . '_init_presets'; if (function_exists($func)) { $p = $func(); $first_time = true; } if (function_exists($infunc)) { $init_presets = $infunc(); } } $this->presets = json_decode(base64_decode($p)); if ($first_time) { for ($i = 0; $i < $init_presets; $i++) { if (!isset($this->presets[$i])) { $newpreset = new stdClass(); $newpreset->key = 'Preset ' . ($i + 1); $newpreset->base_color = '#666666'; $newpreset->link_color = '#666666'; $newpreset->link_hover_color = '#666666'; $newpreset->text_color = '#666666'; $newpreset->heading_color = '#666666'; $this->presets[] = $newpreset; } } } if (drupalexp_is_settings_change()) { $this->preset = $this->get('drupalexp_default_preset'); } else { $this->preset = isset($_SESSION['drupalexp_default_preset']) ? $_SESSION['drupalexp_default_preset'] : null; if ($this->preset === null) { $this->preset = $this->get('drupalexp_default_preset'); } if (empty($this->preset)) { $this->preset = 0; } } $_SESSION['drupalexp_default_preset'] = $this->preset; $this->setPresetVars(); $this->lessc = $this->getThemeInfo('lessc'); }