diff --git a/inclure-ajaxload.php b/inclure-ajaxload.php index c1da98e7c04fa3cbbb2a2e4c863519813d197947..b2ede2bb284f89d156ada198686d560ad2c58488 100644 --- a/inclure-ajaxload.php +++ b/inclure-ajaxload.php @@ -12,20 +12,28 @@ if(!defined("_DUREE_CACHE_AJAXSTATIC")) define("_DUREE_CACHE_AJAXSTATIC", 7200); function balise_INCLURE($p) { $f = balise_INCLURE_dist($p); - if (false !== strpos($f->code, "'ajaxload'")) + if (false !== strpos($f->code, "'ajaxload'")) { $f->code = preg_replace('/recuperer_fond/', 'recuperer_fond_ajax', - $f->code, 1); - - // inserer UNE FOIS le X-Spip_Filtre:INCLUREAJAXLOAD_affichemeta - // equivalent a #FILTRE{INCLUREAJAXLOAD_affichemeta} - if(!defined("_INCLURE_AJAX_LOAD_INSERT")) { - define("_INCLURE_AJAX_LOAD_INSERT", "oui"); - $f->code .= ".'<' . '" - .'?php header("X-Spip-Filtre: \'.' - ."INCLUREAJAXLOAD_affichemeta" - . " . '\"); ?'.'>'"; - - $f->interdire_scripts = false; + $f->code, 1); + + // inserer UNE FOIS le X-Spip_Filtre:INCLUREAJAXLOAD_affichemeta + // equivalent a #FILTRE{INCLUREAJAXLOAD_affichemeta} + + // attention cependant, si cet ajout est fait quelque soit la balise #INCLURE + // les tests [(#INCLURE{fond=x/y}|trim) si du contenu alors... ] + // ne fonctionnent plus car le retour peut contenir le code du header insere. + // on ne le fait donc uniquement si l'on croise un inclure avec {ajaxload} + // qui de toutes facons, lui, retourne la div pour le js. + + if(!defined("_INCLURE_AJAX_LOAD_INSERT")) { + define("_INCLURE_AJAX_LOAD_INSERT", "oui"); + $f->code .= ".'<' . '" + .'?php header("X-Spip-Filtre: \'.' + ."INCLUREAJAXLOAD_affichemeta" + . " . '\"); ?'.'>'"; + + $f->interdire_scripts = false; + } } return $f; } diff --git a/plugin.xml b/plugin.xml index 2d56f530aae32a137ae866ef4e260d14b7cee640..43da2b5a4ef4e9774d3c70a3bab0ca357a83244c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ <slogan>Ajoute une option <code>{ajaxload}</code> à la balise <code>#INCLURE</code></slogan> <auteur>Fil, ARNO*</auteur> <licence>© 2009 GNU/GPL</licence> - <version>1.1.0</version> + <version>1.1.1</version> <etat>stable</etat> <description> Ce plugin ajoute une option <code>{ajaxload}</code> à la balise <code>#INCLURE</code>. La noisette n'est alors pas incluse, mais chargée dynamiquement en Ajax au chargement de la page.