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
d2dc352
..
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');
@@
-57,7
+59,8
@@
class Pman_Core_JsTemplate extends Pman {
foreach($mods as $mod )
{
foreach($mods as $mod )
{
- $prefix = $mod == $pr ? '' : ($pr .'.') ;
+ $prefix = $mod == $pr ? "" : "{$pr}.";
+ //var_dump($prefix);
$pdir = $mod == $pr ? '' : ($pr .'/') ;
$dir = $this->rootDir .'/'.$pdir . $mod . '/jtemplates';
$pdir = $mod == $pr ? '' : ($pr .'/') ;
$dir = $this->rootDir .'/'.$pdir . $mod . '/jtemplates';
@@
-66,18
+69,18
@@
class Pman_Core_JsTemplate extends Pman {
continue;
}
// got a directory..
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";
@@
-110,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..?