1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 |
/* this is in app_controller.php */
function templateInclude($files)
{
{
}
foreach ($files as $file)
{
//check what kind of file this is
{
return false;
}
else
{
{
case 'js': $this->js_files[$file]=$file;
break;
case 'css': $this->css_files[$file]=$file;
break;
default:
$this->set("INCLUDE_ERROR",$file);
return false; //unknown type
break;
}
}
}
}
private function lockIncludes()
{
if ($this->include_lock)
{
return false; //includes already locked
}
$this->set('CSS_FILES',$this->css_files);
$this->set('JS_FILES',$this->js_files);
$this->include_lock = true;
return true;
}
/* end app_controller. remember to call lockIncludes()from beforeRender() */
/* in layout... probably should make this an element*/
foreach($CSS_FILES as $file)
{
echo '@import "http://naskb/pulse/css/'.$file.'";';
}
{
echo '<!-- include error '.$INCLUDE_ERRORS." -->\n";
}
echo '</style>';
foreach($JS_FILES as $file)
{
echo '<script type="text/javascript" src="http://naskb/pulse/js/'.$file.'"></script>';
} |
