private static function get_cache_manager()
 {
     if (self::$cache_manager === null) {
         self::$cache_manager = DataStoreFactory::get_ram_store(__CLASS__);
     }
     return self::$cache_manager;
 }
 private function build_view()
 {
     $not_installed_themes = $this->get_not_installed_themes();
     foreach ($not_installed_themes as $key => $name) {
         try {
             $configuration = ThemeConfigurationManager::get($name);
             $pictures = $configuration->get_pictures();
             $id_theme = $name;
             $this->view->assign_block_vars('themes_not_installed', array('C_WEBSITE' => $configuration->get_author_link() !== '', 'C_PICTURES' => count($pictures) > 0, 'ID' => $id_theme, 'NAME' => $configuration->get_name(), 'VERSION' => $configuration->get_version(), 'MAIN_PICTURE' => count($pictures) > 0 ? Url::to_rel('/templates/' . $id_theme . '/' . current($pictures)) : '', 'AUTHOR_NAME' => $configuration->get_author_name(), 'AUTHOR_WEBSITE' => $configuration->get_author_link(), 'AUTHOR_EMAIL' => $configuration->get_author_mail(), 'DESCRIPTION' => $configuration->get_description() !== '' ? $configuration->get_description() : $this->lang['themes.bot_informed'], 'COMPATIBILITY' => $configuration->get_compatibility(), 'AUTHORIZATIONS' => Authorizations::generate_select(Theme::ACCES_THEME, array('r-1' => 1, 'r0' => 1, 'r1' => 1), array(2 => true), $id_theme), 'HTML_VERSION' => $configuration->get_html_version() !== '' ? $configuration->get_html_version() : $this->lang['themes.bot_informed'], 'CSS_VERSION' => $configuration->get_css_version() !== '' ? $configuration->get_css_version() : $this->lang['themes.bot_informed'], 'MAIN_COLOR' => $configuration->get_main_color() !== '' ? $configuration->get_main_color() : $this->lang['themes.bot_informed'], 'WIDTH' => $configuration->get_variable_width() ? $this->lang['themes.variable-width'] : $configuration->get_width()));
             if (count($pictures) > 0) {
                 unset($pictures[0]);
                 foreach ($pictures as $picture) {
                     $this->view->assign_block_vars('themes_not_installed.pictures', array('URL' => Url::to_rel('/templates/' . $id_theme . '/' . $picture)));
                 }
             }
         } catch (IOException $e) {
             unset($not_installed_themes[$key]);
         }
     }
     $this->view->put_all(array('C_THEME_INSTALL' => count($not_installed_themes) > 0, 'L_ADD' => $this->lang['themes.add_theme']));
 }
示例#3
0
 /**
  * @return ThemeConfiguration
  */
 public function get_configuration()
 {
     return ThemeConfigurationManager::get($this->theme_id);
 }