diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 7dd4dac7b..7c1d63653 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -986,7 +986,21 @@ class G $typearray = explode ( '.', $file ); $typefile = $typearray[ count($typearray) -1 ]; + $namearray = explode ( '/', $typearray[0] ); $filename = $file; + + //trick to generate the translation.language.js file , merging two files and then minified the content. + if ( strtolower ($typefile ) == 'js' && $namearray[ count($namearray) -1 ] == 'translation' ) { + G::sendHeaders ( $filename , 'text/javascript', $download, $downloadFileName ); + $output = ''; + $locale = $typearray[1]; //here we have the language , for example translation.en.js + G::LoadTranslationObject($locale); + global $translation; + $output .= JSMin::minify ( 'var TRANSLATIONS = ' . G::json_encode($translation) . ';' ); + print $output; + return; + } + if ( file_exists ( $filename ) ) { switch ( strtolower ($typefile ) ) { case 'swf' : @@ -1061,9 +1075,11 @@ class G $pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP; $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ext-all.js' ) ); $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux/ux-all.js' ) ); + $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux/miframe.js' ) ); $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.locationbar/Ext.ux.LocationBar.js' ) ); $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.statusbar/ext-statusbar.js' ) ); $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js' ) ); + $output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js' ) ); break; case 'maborak.js' : @@ -1203,7 +1219,10 @@ class G header('Pragma: cache'); - $mtime = filemtime($filename); + if ( file_exists($filename) ) + $mtime = filemtime($filename); + else + $mtime = date('U'); $gmt_mtime = gmdate("D, d M Y H:i:s", $mtime ) . " GMT"; header('ETag: "' . md5 ($mtime . $filename ) . '"' ); header("Last-Modified: " . $gmt_mtime ); diff --git a/gulliver/system/class.headPublisher.php b/gulliver/system/class.headPublisher.php index bc345aae3..13a7f888e 100644 --- a/gulliver/system/class.headPublisher.php +++ b/gulliver/system/class.headPublisher.php @@ -185,9 +185,7 @@ class headPublisher { if ($this->disableHeaderScripts) return ''; - // die(SYS_LANG); $this->addScriptFile ( "/js/widgets/js-calendar/lang/" . SYS_LANG . ".js" ); - //$this->addScriptFile ( '/gulliver/loader?t=js-translations&locale='.SYS_LANG); $head = ''; $head .= '' . $this->title . "\n"; @@ -276,14 +274,15 @@ class headPublisher { } */ $head .= " \n"; -/* - $head .= " \n"; - $head .= " \n"; - $head .= " \n"; - $head .= " \n"; - $head .= " \n"; -*/ - $head .= " \n"; + + //$head .= " \n"; + //$head .= " \n"; + //$head .= " \n"; + //$head .= " \n"; + //$head .= " \n"; + //$head .= " \n"; + + $head .= " \n"; if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') { $this->extJsSkin = 'xtheme-gray';