From 702267086fa2e1063ac9c096761e76cd2d84ab90 Mon Sep 17 00:00:00 2001 From: flyskyko Date: Sun, 4 Sep 2011 10:50:05 +0000 Subject: [PATCH] now, you can use variable in git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9018 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateHandler.class.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 8c4e687b8..43e74017d 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -555,13 +555,22 @@ $tmp_arr = explode(".",$filename); $ext = strtolower(array_pop($tmp_arr)); + $output = ' $val) + { + $output .= '$_load_attrs[\''.$key.'\'] = \'' . preg_replace('/\{([^@^ ][^\{\}\n]+)\}/i', "'.\\1.'", $val) . '\';'; + } + $output .= '?>'; + // according to ext., import the file switch($ext) { // xml js filter case 'xml' : if(preg_match('/^(http|https)/i',$source_filename)) return; // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile - $output = sprintf( + $output .= sprintf( '", $source_filename, $attrs['targetie'], $attrs['media']); } else { $meta_file = $source_filename; - $output = sprintf("", - $source_filename, $attrs['media'], $attrs['targetie'], $attrs['index'], $attrs['usecdn'], $attrs['cdnprefix'], $attrs['cdnversion']); + $output .= ''; } break; // js file @@ -592,8 +600,7 @@ $output = sprintf("", $source_filename, $attrs['targetie']); } else { $meta_file = $source_filename; - $output = sprintf("", - $source_filename, $attrs['type'], $attrs['targetie'], $attrs['index'], $attrs['usecdn'], $attrs['cdnprefix'], $attrs['cdnversion']); + $output .= ''; } break; }