Allow variying template 'okey'
This commit is contained in:
parent
2528c7cc7d
commit
cb75ef15ce
@ -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
|
* @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
|
* @return array Final return array with default values
|
||||||
*/
|
*/
|
||||||
function &serendipity_loadThemeOptions(&$template_config) {
|
function &serendipity_loadThemeOptions(&$template_config, $okey = '') {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
|
if (empty($okey)) {
|
||||||
|
$okey = $serendipity['template'];
|
||||||
|
}
|
||||||
|
|
||||||
$_template_vars =& serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}options
|
$_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)) {
|
if (!is_array($_template_vars)) {
|
||||||
$template_vars = array();
|
$template_vars = array();
|
||||||
} else {
|
} else {
|
||||||
@ -1988,6 +1993,7 @@ function &serendipity_loadThemeOptions(&$template_config) {
|
|||||||
return $template_vars;
|
return $template_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a member of a group has permissions to execute a plugin
|
* Check if a member of a group has permissions to execute a plugin
|
||||||
*
|
*
|
||||||
|
@ -903,7 +903,7 @@ function serendipity_smarty_init($vars = array()) {
|
|||||||
$template_vars =& $template_loaded_config;
|
$template_vars =& $template_loaded_config;
|
||||||
$serendipity['smarty']->assign_by_ref('template_option', $template_vars);
|
$serendipity['smarty']->assign_by_ref('template_option', $template_vars);
|
||||||
} elseif (is_array($template_config)) {
|
} 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);
|
$serendipity['smarty']->assign_by_ref('template_option', $template_vars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user