24 static function pack_js(
Action &
$action, array & $static_js = array() , array & $dynamic_js = array() , $extraCode =
'')
27 print $extraCode .
"\n";
29 foreach ($static_js as $jsfile) {
30 if (is_file($jsfile)) {
31 print sprintf(
"// --- <static file='%s'> ---\n", $jsfile);
32 print str_replace(
"include_js(",
"//include_js(", file_get_contents($jsfile)) .
"\n";
33 print sprintf(
"// -- </static file='%s'> ---\n", $jsfile);
36 print (
"\nalert(\"$jsfile not found\");\n");
39 foreach ($dynamic_js as $jsfile) {
40 if (is_file($jsfile)) {
41 $action->lay->template.= sprintf(
"// --- <dynamic file='%s'> ---\n", $jsfile);
42 $action->lay->template.= str_replace(
"include_js(",
"//include_js(", file_get_contents($jsfile)) .
"\n";
43 $action->lay->template.= sprintf(
"// --- </dynamic file='%s'> ---\n", $jsfile);
45 $action->lay->template.= (
"\nalert(\"$jsfile not found\");\n");
49 $action->lay->template = str_replace(
"\ninclude_js(",
"\n//include_js(", $action->lay->template);
59 static function pack_css(
Action & $action, array $static_css = array() , array $dynamic_css = array())
61 foreach ($static_css as $cssfile) {
62 if (is_file($cssfile)) {
63 print sprintf(
"/* <static file='%s'> */\n", $cssfile);
64 print file_get_contents($cssfile) .
"\n";
65 print sprintf(
"/* </static file='%s'> */\n", $cssfile);
68 print sprintf(
"/* CSS file '%s' not found */\n", $cssfile);
69 $action->log->
error(sprintf(
"CSS file '%s' not found", $cssfile));
72 foreach ($dynamic_css as $cssfile) {
73 if (is_file($cssfile)) {
74 $action->lay->template.= sprintf(
"/* <dynamic file='%s'> */\n", $cssfile);
75 $action->lay->template.= file_get_contents($cssfile) .
"\n";
76 $action->lay->template.= sprintf(
"/* </dynamic file='%s'> */\n", $cssfile);
78 $action->lay->template.= sprintf(
"/* CSS file '%s' not found */\n", $cssfile);
79 $action->log->
error(sprintf(
"CSS file '%s' not found", $cssfile));
static pack_css(Action &$action, array $static_css=array(), array $dynamic_css=array())
static pack_js(Action &$action, array &$static_js=array(), array &$dynamic_js=array(), $extraCode= '')