projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SimpleExcel.php
[Pman.Core]
/
JsTemplate.php
diff --git
a/JsTemplate.php
b/JsTemplate.php
index
fc441a6
..
f138791
100644
(file)
--- a/
JsTemplate.php
+++ b/
JsTemplate.php
@@
-40,8
+40,10
@@
class Pman_Core_JsTemplate extends Pman {
}
}
- function get()
+ function get(
$v, $opts=array()
)
{
{
+
+ $this->sessionState(0);
// get the modules.
header('Content-type: text/javascript');
// get the modules.
header('Content-type: text/javascript');
@@
-50,31
+52,35
@@
class Pman_Core_JsTemplate extends Pman {
$pr = $ff->project;
$mods = $this->modulesList();
$pr = $ff->project;
$mods = $this->modulesList();
- var_dump($mods);
-
- $ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']);
+ //print_r($mods);
- $prefix = $pr == 'Pman' ? 'Pman.' : '';
+ //$ar = explode(PATH_SEPARATOR, $ff->HTML_Template_Flexy['templateDir']);
+ array_push($mods, $pr);
- foreach($ar as $mod) {
- $dir = dirname($mod) . '/jtemplates';
+ foreach($mods as $mod )
+ {
+ $prefix = $mod == $pr ? "" : "{$pr}.";
+ //var_dump($prefix);
+ $pdir = $mod == $pr ? '' : ($pr .'/') ;
+
+ $dir = $this->rootDir .'/'.$pdir . $mod . '/jtemplates';
if (!file_exists($dir)) {
echo '// missing directory '. htmlspecialchars($dir) ."\n";
continue;
}
// got a directory..
if (!file_exists($dir)) {
echo '// missing directory '. htmlspecialchars($dir) ."\n";
continue;
}
// got a directory..
- $mn = basename(dirname($mod));
+
$ar = glob("$dir/*.html") ;
if (empty($ar)) {
echo '// no template is directory '. htmlspecialchars($dir) ."\n";
continue;
}
$ar = glob("$dir/*.html") ;
if (empty($ar)) {
echo '// no template is directory '. htmlspecialchars($dir) ."\n";
continue;
}
- echo "{$prefix}{$m
n} = {$prefix}{$mn
} || {};\n";
- echo "{$prefix}{$m
n}.template = {$prefix}{$mn
}.template || {};\n\n";
+ echo "{$prefix}{$m
od} = {$prefix}{$mod
} || {};\n";
+ echo "{$prefix}{$m
od}.template = {$prefix}{$mod
}.template || {};\n\n";
foreach(glob("$dir/*.html") as $fn) {
foreach(glob("$dir/*.html") as $fn) {
- $name = "{$prefix}{$m
n
}.template." . preg_replace('/\.html$/i', '', basename($fn));
+ $name = "{$prefix}{$m
od
}.template." . preg_replace('/\.html$/i', '', basename($fn));
echo $this->compile($fn, $name) . "\n";
echo $this->compile($fn, $name) . "\n";
@@
-107,7
+113,7
@@
class Pman_Core_JsTemplate extends Pman {
$out= array();
$out= array();
- $head = "$name = function(t)\n{\n var ret =
[]
;\n\n";
+ $head = "$name = function(t)\n{\n var ret =
''
;\n\n";
$funcs = array();
// do not allow nested functions..?
$funcs = array();
// do not allow nested functions..?