[geeklog-cvs] geeklog: Fixed GeeklogConfig variable issue where it's data was ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Mar 20 12:13:23 EDT 2011
changeset 8190:41813f72e91b
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/41813f72e91b
user: Tom <websitemaster at cogeco.net>
date: Sun Mar 20 12:12:41 2011 -0400
description:
Fixed GeeklogConfig variable issue where it's data was seen as a template variable
diffstat:
system/classes/scripts.class.php | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 1b12a4548aa2 -r 41813f72e91b system/classes/scripts.class.php
--- a/system/classes/scripts.class.php Sat Mar 19 19:20:34 2011 -0400
+++ b/system/classes/scripts.class.php Sun Mar 20 12:12:41 2011 -0400
@@ -420,12 +420,15 @@
// Create config variable array to pass to JavaScript
$config_js = array();
$keys = array('site_url', 'site_admin_url', 'layout_url', 'path', 'path_html', 'path_layout',
- 'site_name', 'site_slogan',
+ 'site_name', 'site_slogan',
'theme', 'doctype', 'path_themes');
foreach($keys as $key){
$config_js[$key] = $_CONF[$key];
}
- $footercode .= "var GeeklogConfig = new Object(" . json_encode($config_js) . ");" . LB;
+
+ // Had to trim and add spaces to json_encode output since the data in the {} is seen by the template class as a template variable
+ //$footercode .= "var GeeklogConfig = new Object(" . json_encode($config_js) . ");" . LB;
+ $footercode .= "var GeeklogConfig = new Object({ ".trim(json_encode($config_js), '{}')." });" . LB;
$footercode .= '</script>' . LB;
// Set JavaScript Library files first incase other scripts need them
More information about the geeklog-cvs
mailing list