private function display_page(View $body_template)
 {
     $template = new FileTemplate('admin/frame.tpl');
     $customization_config = CustomizationConfig::load();
     $template->put_all(array('C_FAVICON' => $customization_config->favicon_exists(), 'C_CSS_CACHE_ENABLED' => CSSCacheConfig::load()->is_enabled(), 'FAVICON' => Url::to_rel($customization_config->get_favicon_path()), 'FAVICON_TYPE' => $customization_config->favicon_type(), 'TITLE' => $this->get_seo_meta_data()->get_full_title(), 'MODULES_CSS' => $this->get_modules_css_files_html_code(), 'JS_TOP' => new FileTemplate('js_top.tpl'), 'JS_BOTTOM' => new FileTemplate('js_bottom.tpl'), 'L_XML_LANGUAGE' => self::$lang['xml_lang'], 'BODY' => $body_template));
     $template->display();
 }
 function display_page(View $body_template)
 {
     $template = new FileTemplate('frame.tpl');
     $customization_config = CustomizationConfig::load();
     $seo_meta_data = $this->get_seo_meta_data();
     $description = $seo_meta_data->get_full_description();
     $template->put_all(array('C_CSS_CACHE_ENABLED' => CSSCacheConfig::load()->is_enabled(), 'C_FAVICON' => $customization_config->favicon_exists(), 'C_CANONICAL_URL' => $seo_meta_data->canonical_link_exists(), 'C_DESCRIPTION' => !empty($description), 'FAVICON' => Url::to_rel($customization_config->get_favicon_path()), 'FAVICON_TYPE' => $customization_config->favicon_type(), 'TITLE' => $seo_meta_data->get_full_title(), 'SITE_DESCRIPTION' => $description, 'U_CANONICAL' => $seo_meta_data->get_canonical_link(), 'L_XML_LANGUAGE' => self::$main_lang['xml_lang'], 'PHPBOOST_VERSION' => GeneralConfig::load()->get_phpboost_major_version(), 'MODULES_CSS' => $this->get_modules_css_files_html_code(), 'JS_TOP' => new FileTemplate('js_top.tpl'), 'JS_BOTTOM' => new FileTemplate('js_bottom.tpl'), 'BODY' => $body_template));
     $template->display(true);
 }
 protected function get_modules_css_files_html_code()
 {
     $css_cache_config = CSSCacheConfig::load();
     $css_files = array_merge(ModulesCssFilesService::get_css_files_always_displayed(), ModulesCssFilesService::get_css_files_running_module_displayed());
     if ($css_cache_config->is_enabled()) {
         $html_code = '<link rel="stylesheet" href="' . CSSCacheManager::get_css_path($css_files) . '" type="text/css" media="screen, print" />';
     } else {
         $html_code = '';
         foreach ($css_files as $file) {
             $html_code .= '<link rel="stylesheet" href="' . Url::to_rel($file) . '" type="text/css" media="screen, print" />';
         }
     }
     return $html_code;
 }
 public static function get_css_path($files)
 {
     if (!empty($files)) {
         if (is_array($files)) {
             $cache_file_location = '/cache/css/css-cache-' . md5(implode(';', $files)) . '.css';
         } else {
             $files = str_replace('{THEME}', AppContext::get_current_user()->get_theme(), $files);
             $cache_file_location = '/cache/css/css-cache-' . md5($files) . '.css';
             $files = explode(';', $files);
         }
         $css_cache = new CSSCacheManager();
         $css_cache->set_files($files);
         $css_cache->set_cache_file_location(PATH_TO_ROOT . $cache_file_location);
         $css_cache->execute(CSSCacheConfig::load()->get_optimization_level());
         return TPL_PATH_TO_ROOT . $cache_file_location;
     }
 }
 protected function save()
 {
     if ($this->is_apc_available()) {
         if ($this->form->get_value('enable_apc')) {
             DataStoreFactory::set_apc_enabled(true);
         } else {
             DataStoreFactory::set_apc_enabled(false);
         }
     }
     if ($this->form->get_value('enable_css_cache')) {
         $this->css_cache_config->enable();
     } else {
         $this->css_cache_config->disable();
     }
     if (!$this->form->field_is_disabled('level_css_cache')) {
         $this->css_cache_config->set_optimization_level($this->form->get_value('level_css_cache')->get_raw_value());
     }
     CSSCacheConfig::save();
     AppContext::get_cache_service()->clear_css_cache();
 }