3 @define
('_CS_AUTOBR_BR', '<br />');
5 // pipeline pre_typo, appel automatique si defined('_CS_AUTOBR_RACC')
6 function autobr_alinea($flux) {
7 while ($fin = strpos($flux, '</alinea>')) {
8 $zone = substr($flux, 0, $fin);
9 if(($deb = strpos($zone, '<alinea>'))!==false) $zone = substr($zone, $deb +
8);
10 $flux = substr($flux, 0, $deb)
11 // protection des echappement eventuels
12 . str_replace('@ABR@', 'base64', post_autobr(trim(str_replace('base64', '@ABR@', $zone)), _CS_AUTOBR_BR
))
13 . substr($flux, $fin +
strlen('</alinea>'));
18 // traitements sur la balise #TEXTE
19 function autobr_pre_propre($flux) {
20 // post_autobr() est une fonction de traitement qui possede son propre systeme d'echappement
21 // on traite, sauf si la balise alinea est detectee
22 if(defined('_CS_AUTOBR_TRAIT') && (!defined('_CS_AUTOBR_RACC') ||
strpos($flux, '<alinea>')===false))
23 $flux = cs_echappe_balises('html|code|cadre|frame|script|jeux', 'post_autobr', $flux, _CS_AUTOBR_BR
);
27 if(defined('_CS_AUTOBR_RACC')) {
28 // liste des nouveaux raccourcis ajoutes par l'outil
29 // si cette fonction n'existe pas, le plugin cherche alors _T('couteauprive:un_outil:aide');
30 function autobr_raccourcis() {
31 return _T('couteauprive:autobr_racc');
35 function autobr_nettoyer_raccourcis($texte) {
36 return str_replace(array('<alinea>','</alinea>'), '', $texte);
39 function autobr_PP_icones($flux) {
40 if(defined('_CS_AUTOBR_RACC')) $flux['autobr'] = 'autobr.png';
44 function autobr_CS_pre_charger($flux) {
45 if(!defined('_CS_AUTOBR_RACC')) return $flux;
48 "name" => _T('couteau:pp_autobr'),
49 "className" => 'autobr',
50 "openWith" => "\n<alinea>",
51 "closeWith" => "</alinea>\n",
52 "selectionType" => "line",
54 foreach(cs_pp_liste_barres('autobr') as $b)
55 $flux[$b] = isset($flux[$b])?
array_merge($flux[$b], $r):$r;