3 if (!defined('_ECRIRE_INC_VERSION')) return;
4 # not useful as this file is included by the engine itself
5 # require_once 'engine/textwheel.php';
7 function tw_liste_init($t){
8 charger_fonction('dummy', 'inc', true); // ne sert a rien mais evite un segmentation fault PHP, on dirait
9 return tw_liste_item($t,'init');
12 function tw_liste_close($t){
13 return tw_liste_item($t,'close');
16 function tw_liste_item($t,$quoi='item'){
17 global $class_spip, $class_spip_plus;
34 $ajout .= $pile_li[$niveau];
35 $ajout .= $pile_type[$niveau];
49 if ($l=strlen($t[2])) {
50 $profond=$l;$nouv_type='ul';
51 if (strncmp($t[2],'#',1)==0) $nouv_type='ol';
57 // changement de type de liste au meme niveau : il faut
58 // descendre un niveau plus bas, fermer ce niveau, et
60 $change_type = ($type AND ($type <> $nouv_type) AND ($profond == $niveau)) ?
1 : 0;
63 // d'abord traiter les descentes
64 while ($niveau > $profond - $change_type) {
65 $ajout .= $pile_li[$niveau];
66 $ajout .= $pile_type[$niveau];
68 unset ($pile_li[$niveau]);
72 // puis les identites (y compris en fin de descente)
73 if ($niveau == $profond && !$change_type) {
74 $ajout .= $pile_li[$niveau];
77 // puis les montees (y compris apres une descente un cran trop bas)
78 while ($niveau < $profond) {
81 elseif (!isset($pile_li[$niveau])) {
82 $ajout .= "<li$class_spip>";
83 $pile_li[$niveau] = "</li>";
86 $ajout .= "<$type$class_spip_plus>";
87 $pile_type[$niveau] = "</$type>";
90 $ajout .= "<li$class_spip>";
91 $pile_li[$profond] = "</li>";
94 $ajout = $t[1]; // puce normale ou <hr>
104 function tw_def_wrap($t){
105 global $class_spip_plus;
106 return "<dl$class_spip_plus>\n$t</dl>\n";