Allow variying template 'okey'

This commit is contained in:
Garvin Hicking 2007-08-21 10:25:57 +00:00
parent 2528c7cc7d
commit cb75ef15ce
2 changed files with 9 additions and 3 deletions

View File

@ -1969,10 +1969,15 @@ function serendipity_setFormToken($type = 'form') {
* @param array Referenced variable coming from the config.inc.php file, where the config values will be stored in
* @return array Final return array with default values
*/
function &serendipity_loadThemeOptions(&$template_config) {
function &serendipity_loadThemeOptions(&$template_config, $okey = '') {
global $serendipity;
if (empty($okey)) {
$okey = $serendipity['template'];
}
$_template_vars =& serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}options
WHERE okey = 't_" . serendipity_db_escape_string($serendipity['template']) . "'", false, 'assoc', false, 'name', 'value');
WHERE okey = 't_" . serendipity_db_escape_string($okey) . "'", false, 'assoc', false, 'name', 'value');
if (!is_array($_template_vars)) {
$template_vars = array();
} else {
@ -1988,6 +1993,7 @@ function &serendipity_loadThemeOptions(&$template_config) {
return $template_vars;
}
/**
* Check if a member of a group has permissions to execute a plugin
*

View File

@ -903,7 +903,7 @@ function serendipity_smarty_init($vars = array()) {
$template_vars =& $template_loaded_config;
$serendipity['smarty']->assign_by_ref('template_option', $template_vars);
} elseif (is_array($template_config)) {
$template_vars =& serendipity_loadThemeOptions($template_config);
$template_vars =& serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option']);
$serendipity['smarty']->assign_by_ref('template_option', $template_vars);
}
}