Skip to content
Extraits de code Groupes Projets
Valider 45c041ef rédigé par cerdic's avatar cerdic
Parcourir les fichiers

No commit message

No commit message
parent 08d2c776
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -248,12 +248,7 @@ function afficher_rubriques_filles($id_parent) { ...@@ -248,12 +248,7 @@ function afficher_rubriques_filles($id_parent) {
global $enfant, $article; global $enfant, $article;
global $spip_lang_left, $spip_lang_right, $spip_lang; global $spip_lang_left, $spip_lang_right, $spip_lang;
global $couleur_claire; global $couleur_claire;
global $browser_name;
static $decal = 0; static $decal = 0;
if ($browser_name=="MSIE")
$wrapper = file_exists($w = _DIR_IMG_PACK ."wrapper.php");
else
$wrapper = false;
$decal = $decal + 1; $decal = $decal + 1;
$droite = 500 - (10 * $decal); $droite = 500 - (10 * $decal);
...@@ -269,10 +264,8 @@ function afficher_rubriques_filles($id_parent) { ...@@ -269,10 +264,8 @@ function afficher_rubriques_filles($id_parent) {
$icone = "rubrique-24.gif"; $icone = "rubrique-24.gif";
$bgcolor = ""; $bgcolor = "";
} }
if ($wrapper)
$icone = "wrapper.php?file=".urlencode($icone);
echo "<div style='padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px; background: url(" . _DIR_IMG_PACK . "$icone) $spip_lang_left center no-repeat;$bgcolor'>"; echo "<div style='padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px; background: url(" . http_wrapper($icone) . ") $spip_lang_left center no-repeat;$bgcolor'>";
$lesarticles = isset($article[$id_rubrique]) ? $article[$id_rubrique] : ''; $lesarticles = isset($article[$id_rubrique]) ? $article[$id_rubrique] : '';
$lesenfants = isset($enfant[$id_rubrique]) ? $enfant[$id_rubrique] : ''; $lesenfants = isset($enfant[$id_rubrique]) ? $enfant[$id_rubrique] : '';
......
...@@ -102,15 +102,8 @@ function bandeau_rubrique($id_rubrique, $titre_rubrique, $z = 1) { ...@@ -102,15 +102,8 @@ function bandeau_rubrique($id_rubrique, $titre_rubrique, $z = 1) {
//else $image = "rubrique-12.gif"; //else $image = "rubrique-12.gif";
else $image = ''; else $image = '';
if (strlen($image) > 1) { if (strlen($image) > 1)
global $browser_name; $image = " style='background-image:url(" . http_wrapper($image) .");'";
include_spip('inc/layer');
verif_butineur();
if ($browser_name=="MSIE" && file_exists($w = dirname(_DIR_IMG_PACK.$image)."/wrapper.php"))
$image = " style='background-image:url($w?file=".urlencode($image) . ");'";
else
$image = " style='background-image:url(" . _DIR_IMG_PACK . $image .");'";
}
$arr_rub = extraire_article($id_rubrique); $arr_rub = extraire_article($id_rubrique);
......
...@@ -92,16 +92,12 @@ function bouton_block_visible($nom_block){ ...@@ -92,16 +92,12 @@ function bouton_block_visible($nom_block){
function produire_acceder_couche($couches, $nom, $icone) { function produire_acceder_couche($couches, $nom, $icone) {
global $spip_lang_rtl; global $spip_lang_rtl;
global $browser_name;
$f = _DIR_IMG_PACK.$icone;
if ($browser_name=="MSIE" && file_exists($w = dirname($f)."/wrapper.php"))
$icone = "wrapper.php?file=".urlencode($icone);
return http_script("acceder_couche([" . join(',',$couches) . '], ' . return http_script("acceder_couche([" . join(',',$couches) . '], ' .
$nom . $nom .
", '" . ", '" .
_DIR_IMG_PACK . _DIR_IMG_PACK .
"', '" . "', '" .
$icone . substr(http_wrapper($icone),strlen(_DIR_IMG_PACK)) .
"', '" . "', '" .
addslashes(_T('info_deplier')) . addslashes(_T('info_deplier')) .
"','$spip_lang_rtl')"); "','$spip_lang_rtl')");
......
...@@ -165,15 +165,30 @@ function http_href($href, $clic, $title='', $style='', $class='', $evt='') { ...@@ -165,15 +165,30 @@ function http_href($href, $clic, $title='', $style='', $class='', $evt='') {
// produit une balise img avec un champ alt d'office si vide // produit une balise img avec un champ alt d'office si vide
// attention le htmlentities et la traduction doivent etre appliques avant. // attention le htmlentities et la traduction doivent etre appliques avant.
function http_img_pack($img, $alt, $att, $title='') { function http_wrapper($img){
global $browser_name; static $wrapper_state=NULL;
if (!strlen($browser_name)){ static $wrapper_table = array();
include_spip('inc/layer');
$f = _DIR_IMG_PACK . $img;
if ($wrapper_state==NULL){
global $browser_name;
if (!strlen($browser_name)){include_spip('inc/layer');}
$wrapper_state = ($browser_name=="MSIE");
}
if ($wrapper_state){
if (!isset($wrapper_table[$d=dirname($f)])) {
$wrapper_table[$d] = false;
if (file_exists("$d/wrapper.php"))
$wrapper_table[$d] = "$d/wrapper.php?file=";
}
if ($wrapper_table[$d])
$f = $wrapper_table[$d] . urlencode($img);
} }
$f = _DIR_IMG_PACK.$img; return $f;
if ($browser_name=="MSIE" && file_exists($w = dirname($f)."/wrapper.php")) }
$f = "$w?file=".urlencode($img); function http_img_pack($img, $alt, $att, $title='') {
return "<img src='" . $f return "<img src='" . http_wrapper($img)
. ("'\nalt=\"" . . ("'\nalt=\"" .
($alt ? str_replace('"','',$alt) : ($title ? $title : ereg_replace('\..*$','',$img))) ($alt ? str_replace('"','',$alt) : ($title ? $title : ereg_replace('\..*$','',$img)))
. '" ') . '" ')
...@@ -188,14 +203,7 @@ function http_href_img($href, $img, $att, $title='', $style='', $class='', $evt= ...@@ -188,14 +203,7 @@ function http_href_img($href, $img, $att, $title='', $style='', $class='', $evt=
function http_style_background($img, $att='') function http_style_background($img, $att='')
{ {
global $browser_name; return " style='background: url(\"".http_wrapper($img)."\")" .
if (!strlen($browser_name)){
include_spip('inc/layer');
}
$f = _DIR_IMG_PACK.$img;
if ($browser_name=="MSIE" && file_exists($w = dirname($f)."/wrapper.php"))
$f = "$w?file=".urlencode($img);
return " style='background: url(\"$f\")" .
($att ? (' ' . $att) : '') . ";'"; ($att ? (' ' . $att) : '') . ";'";
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter