si c'est un json, pas d'insertion

This commit is contained in:
Christophe 2020-07-23 11:44:28 +02:00
parent 59289b1ae4
commit 7f5174dca1

View file

@ -28,12 +28,14 @@ function gamutable_affichage_final($flux) {
include_spip('inc/autoriser'); include_spip('inc/autoriser');
if (autoriser("purger","gamutable") and test_plugin_actif('minibando')) { if (autoriser("purger","gamutable") and test_plugin_actif('minibando')) {
$p = stripos($flux, '</body>'); $p = stripos($flux, '</body>');
$url_relecture = parametre_url(self(), 'var_mode', 'gamutable', '&'); if ($p) {
$label = "Mode gamuTable"; $url_relecture = parametre_url(self(), 'var_mode', 'gamutable', '&');
$js .= "jQuery('#minibando_bouton_debug ul').append('<li><a class=\"spip-admin-boutons \" href=\"$url_relecture\">$label</a></li>');"; $label = "Mode gamuTable";
$js = "jQuery(function(){ $js });"; $js .= "jQuery('#minibando_bouton_debug ul').append('<li><a class=\"spip-admin-boutons \" href=\"$url_relecture\">$label</a></li>');";
$js = "<script>$js</script>"; $js = "jQuery(function(){ $js });";
$flux = substr_replace($flux, $js, $p, 0); $js = "<script>$js</script>";
$flux = substr_replace($flux, $js, $p, 0);
}
} }
return $flux; return $flux;
} }