]> git.mjollnir.org Git - s9y.git/commitdiff
Allow variying template 'okey'
authorgarvinhicking <garvinhicking>
Tue, 21 Aug 2007 10:25:57 +0000 (10:25 +0000)
committergarvinhicking <garvinhicking>
Tue, 21 Aug 2007 10:25:57 +0000 (10:25 +0000)
include/functions_config.inc.php
include/functions_smarty.inc.php

index 3b55656195050e4606467da3af95da71e3e9e9ea..a133583478f6c0b51d14430e248af5f5f9555121 100644 (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
  *
index e0d4152966338529794ac408c95b679376a5f8b7..4d86fcf7f2172134c18cc7d5dd4dd984c7270ed8 100644 (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);
         }
     }