Lot spip, Vol 429, Parution 2

Et si tu ajoutes dans ton squelettes/plugins

blocsdepliables_pipelines.php

en modifiant

function blocsdepliables_callback($matches) {
list($titre, $corps) = array_pad(preg_split(',(\n\n|\r\n\r\n|\r\r),', trim($matches[3]), 2), 2, null);
// pas de corps !
if (!strlen($corps = trim($corps))) {
$corps = $titre;
$titre = preg_replace(',[\n\r]+,s', ' ', couper(propre($titre), **5**0));
}
// pas d'intertitre !
$titre = preg_replace(',^{{{(.*)}}}$,', '$1', trim($titre));
if (!strlen($titre)) {
$titre = '???';
}
// un resume facultatif
if (preg_match(',<resume>(.*)</resume>\s?(.*)$,ms', $corps, $res)) {
$corps = $res[2];
$res = $res[1];
} else {
$res = '';
}
// types de blocs : bloc|invisible|visible
if (in_array($matches[1], array('visible', 'visible#')) || defined('_CS_PRINT')) {
$h = $d = '';
$r = ' blocs_invisible blocs_slide';
} else {
$h = ' blocs_replie';
$d = ' blocs_invisible blocs_slide';
$r = '';
}

// blocs numerotes
$b = strlen($matches[2])?" cs_bloc$matches[2]' id='deplier_num$matches[2]":'';
// title
$title = function_exists('blocs_title')
?"<div class='blocs_title blocs_invisible'>".join(_BLOC_TITLE_SEP, blocs_title($titre, $corps, $matches[2], $h<>'')).'</div>'
:''; // valeur par defaut geree en JS
$hn = blocdepliable_balise_titre();
return "<div class='cs_blocs$b'><$hn class='blocs_titre$h blocs_click'><a href='javascript:;' class='ouvrir_fermer'>$titre</a></$hn>"
.(strlen($res)?"<div class='blocs_resume$r'>\n$res\n</div>" : '')
."<div class='blocs_destination$d'>\n\n".blocsdepliables_rempl($corps)."\n\n</div>$title</div>";
}