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

preciser la taille de l'icone qu'on utilise en background, car en SVG elle...

preciser la taille de l'icone qu'on utilise en background, car en SVG elle n'est pas forcement par defaut bonne
parent 96856d72
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -3347,10 +3347,17 @@ function http_img_pack($img, $alt, $atts = '', $title = '', $options = array())
*
* @param string $img
* @param string $att
* @param string $size
* @return string
*/
function http_style_background($img, $att = '') {
return " style='background" . ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";'";
function http_style_background($img, $att = '', $size=null) {
if ($size and is_numeric($size)){
$size = trim($size) . "px";
}
return " style='background" .
($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
. ($size ? "background-size:{$size};" : '')
. "'";
}
/**
......@@ -3916,7 +3923,7 @@ function prepare_icone_base($type, $lien, $texte, $fond, $fonction = "", $class
// 2 images pour composer l'icone : le fond (article) en background,
// la fonction (new) en image
$icone = http_img_pack($fonction, $alt, "width='$size' height='$size'\n" .
http_style_background($fond));
http_style_background($fond, '', $size));
} else {
$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
}
......
......@@ -199,7 +199,7 @@ function f_admin($texte) {
if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and $GLOBALS['html']) {
include_spip('inc/filtres'); // pour http_img_pack
$x = "<div class='spip-previsu' "
. http_style_background('preview-32.png')
. http_style_background('preview-32.png', '', 32)
. ">"
. _T('previsualisation')
. "</div>";
......
......@@ -61,7 +61,7 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "", $id = "",
// 2 images pour composer l'icone : le fond (article) en background,
// la fonction (new) en image
$icone = http_img_pack($fonction, "", "class='cadre-icone' width='$size' height='$size'\n" .
http_style_background($fond, "no-repeat center center"));
http_style_background($fond, "no-repeat center center", $size));
} else {
$icone = http_img_pack($fond, "", "class='cadre-icone' width='$size' height='$size'");
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter