/** * Get theme configuration and assign to a smarty var * * @param object $smarty * @return none */ function get_config(&$smarty, $params) { global $xoopsConfig; if (isset($params['theme'])) { $theme = $params['theme']; } else { $theme = $xoopsConfig['theme_set']; } $var = preg_replace('/\\s+/', '', $theme); $var = str_replace('-', '', $var); $var .= 'Config'; if (isset($this->configs[$theme])) { $smarty->assign($var, $this->configs[$theme]); return; } if (false === ($object = xt_is_valid($theme))) { return; } $this->configs[$theme] = xt_get_current_config($theme); $smarty->assign($var, $this->configs[$theme]); }
/** * Configure theme settings * * @var string */ function xt_configure_show() { global $xoopsConfig, $xoopsTpl; if (false === ($theme = xt_is_valid($xoopsConfig['theme_set']))) { redirect_header('index.php', 1, __('This theme cannot be configured by XThemes because is not a valid Theme', 'xthemes')); } if (!method_exists($theme, 'get_config')) { redirect_header('index.php', 1, __('This theme has not configuration options', 'xthemes')); } xoops_cp_header(); $xoTheme = $GLOBALS['xoTheme']; $xoTheme->addMeta('stylesheet', 'themes.css', array('href' => 'css/themes.css', 'type' => 'text/css')); $xoTheme->addMeta('script', 'include/js/xthemes.js', array('src' => 'include/js/xthemes.js', 'type' => 'text/javascript')); $element_info = $theme->get_info(); $element = $xoopsConfig['theme_set']; $xt_show = 'theme'; $current_settings = xt_get_current_config($xoopsConfig['theme_set'], true); include_once 'templates/xt_form_config.php'; xoops_cp_footer(); }