From: Alan Knowles Date: Thu, 17 Nov 2011 09:31:10 +0000 (+0800) Subject: JsTemplate.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=d8034fd6fc8bf7ad69a53aae572e494b658f131b JsTemplate.php --- diff --git a/JsTemplate.php b/JsTemplate.php index e4d57043..02a7c0b0 100644 --- a/JsTemplate.php +++ b/JsTemplate.php @@ -46,12 +46,11 @@ class Pman_Core_JsTemplate extends Pman { header('Content-type: text/javascript'); $ff = HTML_FlexyFramework::get(); - print_R($ff); + $pr = $ff->project; $ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']); - - + $prefix = $pr == 'Pman' ? 'Pman.' : ''; foreach($ar as $mod) { $dir = dirname($mod) . '/jtemplates'; @@ -66,11 +65,12 @@ class Pman_Core_JsTemplate extends Pman { echo '// no template is directory '. htmlspecialchars($dir) ."\n"; continue; } - echo "Pman.{$mn} = Pman.{$mn} || {};\n"; - echo "Pman.{$mn}.template = Pman.{$mn}.template || {};\n\n"; + + echo "{$prefix}{$mn} = {$prefix}{$mn} || {};\n"; + echo "{$prefix}{$mn}.template = {$prefix}{$mn}.template || {};\n\n"; foreach(glob("$dir/*.html") as $fn) { - $name = 'Pman.' . $mn .'.template.' . preg_replace('/\.html$/i', '', basename($fn)); + $name = '{$prefix}.' . $mn .'.template.' . preg_replace('/\.html$/i', '', basename($fn)); echo $this->compile($fn, $name) . "\n";