JsTemplate.php
[Pman.Core] / JsTemplate.php
index 7364088..c9e6d8f 100644 (file)
@@ -43,7 +43,7 @@ class Pman_Core_JsTemplate extends Pman {
     function get()
     {
         // get the modules.
-        //header('Content-type: text/javascript');
+        header('Content-type: text/javascript');
         
         $ff = HTML_FlexyFramework::get();
         
@@ -53,11 +53,15 @@ class Pman_Core_JsTemplate extends Pman {
         //print_r($mods);
         
         //$ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']);
+        array_push($mods, $pr);
         
-        //$prefix = $pr == 'Pman' ? 'Pman.' : '';
-        
-        foreach($mods as $mod) {
-            $dir =  $this->rootDir .'/Pman/'.  $mod . '/jtemplates';
+        foreach($mods as $mod )
+        {
+            $prefix = $mod == $pr  ?  "{$pr}." : "{$pr}.{$mod}.";
+            var_dump($prefix)
+            $pdir = $mod == $pr  ? '' : ($pr .'/') ;
+         
+            $dir =  $this->rootDir .'/'.$pdir .  $mod . '/jtemplates';
             if (!file_exists($dir)) {
                 echo '// missing directory '. htmlspecialchars($dir) ."\n";
                 continue;