Browse Source

Permettre aussi d'utiliser des variantes SVG pour les icones des types de menu

pull/7/head
Cerdic 1 year ago
parent
commit
3c03496f21
  1. 11
      inc/menus.php

11
inc/menus.php

@ -89,6 +89,7 @@ function menus_charger_infos($type, $info = '') {
$fichier = preg_replace(',[.]html$,i', '', $type).'.xml';
include_spip('inc/xml');
include_spip('inc/texte');
include_spip('inc/filtres');
$entree = array();
if ($xml = spip_xml_load($fichier, false)) {
if (count($xml['entree'])) {
@ -97,7 +98,15 @@ function menus_charger_infos($type, $info = '') {
$entree['rang'] = intval(trim(spip_xml_aplatit(!empty($xml['rang']) ? $xml['rang'] : 1000)));
$entree['description'] = isset($xml['description']) ?
_T_ou_typo(spip_xml_aplatit($xml['description'])) : '';
$entree['icone'] = isset($xml['icone']) ? find_in_path(reset($xml['icone'])) : '';
$icone = (isset($xml['icone']) ? reset($xml['icone']) : '');
if ($icone) {
$icone = find_in_path($icone);
if (function_exists('http_img_variante_svg_si_possible')) {
$icone = http_img_variante_svg_si_possible($icone);
}
}
$entree['icone'] = $icone;
$entree['refuser_sous_menu'] = isset($xml['refuser_sous_menu']);
// Décomposition des paramètres
$entree['parametres'] = array();

Loading…
Cancel
Save