function get()
{
// get the modules.
- header('Content-type: text/javascript');
+ //header('Content-type: text/javascript');
$ff = HTML_FlexyFramework::get();
$pr = $ff->project;
- $ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']);
- $prefix = $pr == 'Pman' ? 'Pman.' : '';
+ $mods = $this->modulesList();
+ //print_r($mods);
- foreach($ar as $mod) {
- $dir = dirname($mod) . '/jtemplates';
+ //$ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']);
+
+ $prefix = empty($mods) ? '' : ($pr .'.') ;
+ $pdir = empty($mods) ? '' : ($pr .'/') ;
+
+ foreach(empty($mods) ? array($pr) : $mods as $mod ) {
+ $dir = $this->rootDir .'/'.$pdir . $mod . '/jtemplates';
if (!file_exists($dir)) {
echo '// missing directory '. htmlspecialchars($dir) ."\n";
continue;
continue;
case ($inscript && ($item != '{end:}')):
- $ret[] = $item;
+ $ret[count($ret)-1] .= $item;
continue;
case ($inscript && ($item == '{end:}')):
case ($item == '{script:}'):
$inscript = true;
+ $ret[] = '';
continue;
case ($item[1] == '!'):
$indent++;
continue;
+ case (substr($item,1,5) == 'else:'):
+ $indent--;
+ $in = str_repeat(" ", $indent);
+ $ret[] = $in . "} else { ";
+ $indent++;
+ continue;
+
case (substr($item,1,4) == 'end:'):
$indent--;
$in = str_repeat(" ", $indent);