Utilisation de la compression des css et js

This commit is contained in:
Michael RICOIS 2009-07-15 15:58:10 +00:00
parent db921cfaa0
commit 7f683faa6e
2 changed files with 17 additions and 7 deletions

View File

@ -3,10 +3,15 @@ require_once 'includecss.php';
if($sortie!='prt') require_once 'includejs.php';
if(isset($tabStyles) && count($tabStyles)>0){
foreach($tabStyles as $group){
foreach($tabStyles as $name => $group){
if( in_array('all', $group['pages']) || in_array($page, $group['pages']) ){
foreach($group['list'] as $style){
print '<link rel="stylesheet" type="text/css" href="./css/'.$style.'" />';
if(ENVIRONNEMENT == 'DEV'){
foreach($group['list'] as $style){
print '<link rel="stylesheet" type="text/css" href="./css/'.$style.'" />';
print "\n";
}
}else{
print '<link rel="stylesheet" type="text/css" href="./min/?g='.$name.'"/>';
print "\n";
}
}
@ -14,10 +19,15 @@ if(isset($tabStyles) && count($tabStyles)>0){
}
if(isset($tabScripts) && count($tabScripts)>0){
foreach($tabScripts as $group){
foreach($tabScripts as $name => $group){
if(in_array('all', $group['pages']) || in_array($page, $group['pages'])){
foreach($group['list'] as $script){
print '<script type="text/javascript" src="./js/'.$script.'"></script>';
if(ENVIRONNEMENT == 'DEV'){
foreach($group['list'] as $script){
print '<script type="text/javascript" src="./js/'.$script.'"></script>';
print "\n";
}
}else{
print '<script type="text/javascript" src="./min/?g='.$name.'"></script>';
print "\n";
}
}

View File

@ -2,7 +2,7 @@
//Inclusion des js en fonction de la variable page
$tabScripts = array(
'scripts' => array(
'list' => array('jquery.js', 'jquery.bgiframe.min.js', 'jquery.autocomplete.js', 'dropDownOverlapping.js', 'menu.js', 'scripts.js'),
'list' => array('jquery.js', 'jquery.bgiframe.js', 'jquery.autocomplete.js', 'dropDownOverlapping.js', 'menu.js', 'scripts.js'),
//Pour le nouveau menu ajout : jquery.dimensions.js, jquery.easing.js, jquery-ui.js
'pages' => array('all'),
),