Browse Source
Retours de ligne automatiques :
Retours de ligne automatiques :
+ Choix entre : - Application automatique partout - Application entre les balises <alinea></alinea> + Insertion dans le porte-plume du raccouci <alinea></alinea>svn/attic/couteau_suisse/118435
7 changed files with 80 additions and 20 deletions
-
2.gitattributes
-
21config_outils.php
-
BINicones_barre/autobr.png
-
21lang/couteau_fr.php
-
8lang/couteauprive_fr.php
-
46outils/autobr.php
-
2plugin.xml
After Width: 16 | Height: 16 | Size: 1.1 KiB |
@ -0,0 +1,46 @@ |
|||
<?php |
|||
|
|||
function autobr_pre_typo($flux) { |
|||
// Laisser les formulaires
|
|||
if(strpos($flux, '<input')!==false) return $flux; |
|||
// Bug du filtre post_autobr sur les echappements :-(
|
|||
$flux = str_replace('base64', '@ABR@', $flux); |
|||
if(!defined('_CS_AUTOBR_RACC')) |
|||
$flux = post_autobr($flux, '<br />'); |
|||
else while ($fin = strpos($flux, '</alinea>')) { |
|||
$zone = substr($flux, 0, $fin); |
|||
if(($deb = strpos($zone, '<alinea>'))!==false) $zone = substr($zone, $deb + 8); |
|||
$flux = substr($flux, 0, $deb) . post_autobr(trim($zone), '<br />') . substr($flux, $fin + strlen('</alinea>')); |
|||
} |
|||
return str_replace('@ABR@', 'base64', $flux); |
|||
} |
|||
|
|||
if(defined('_CS_AUTOBR_RACC')) { |
|||
// liste des nouveaux raccourcis ajoutes par l'outil
|
|||
// si cette fonction n'existe pas, le plugin cherche alors _T('couteauprive:un_outil:aide');
|
|||
function autobr_raccourcis() { |
|||
return _T('couteauprive:autobr_racc'); |
|||
} |
|||
} |
|||
|
|||
function autobr_PP_icones($flux) { |
|||
if(defined('_CS_AUTOBR_RACC')) $flux['autobr'] = 'autobr.png'; |
|||
return $flux; |
|||
} |
|||
|
|||
function autobr_CS_pre_charger($flux) { |
|||
if(!defined('_CS_AUTOBR_RACC')) return $flux; |
|||
$r = array(array( |
|||
"id" => 'autobr', |
|||
"name" => _T('couteau:pp_autobr'), |
|||
"className" => 'autobr', |
|||
"openWith" => "\n<alinea>", |
|||
"closeWith" => "</alinea>\n", |
|||
"selectionType" => "line", |
|||
"display" => true)); |
|||
foreach(cs_pp_liste_barres('autobr') as $b) |
|||
$flux[$b] = isset($flux[$b])?array_merge($flux[$b], $r):$r; |
|||
return $flux; |
|||
} |
|||
|
|||
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue