[PLUGINS] ~maj globale
[lhc/web/www.git] / www / plugins / enluminures_typographiques_v3 / enluminures_typo_pipelines.php
1 <?php
2
3 if (!defined('_ECRIRE_INC_VERSION')) {
4 return;
5 }
6
7 function typoenluminee_porte_plume_barre_pre_charger($barres) {
8 $barre = &$barres['edition'];
9
10 $barre->cacher('italic');
11 $barre->cacher('stroke_through');
12 $barre->cacher('notes');
13 $barre->cacher('sepCode');
14 $barre->cacher('grpCode');
15
16 $module_barre = 'barre_outils';
17 if (intval($GLOBALS['spip_version_branche']) > 2) {
18 $module_barre = 'barreoutils';
19 }
20
21 $barre->set('header1', array(
22 // groupe formatage paragraphe
23 'dropMenu' => array(
24 array(
25 'id' => 'intertitre',
26 'name' => _T('barre_intertitre'),
27 'className' => 'outil_intertitre1',
28 'openWith' => "\n{{{",
29 'closeWith' => "}}}\n",
30 'display' => true,
31 'selectionType' => 'line',
32 ),
33 array(
34 'id' => 'intertitre2',
35 'name' => _T('enlumtypo:barre_intertitre2'),
36 'className' => 'outil_intertitre2',
37 'openWith' => "\n{{{**",
38 'closeWith' => "}}}\n",
39 'display' => true,
40 'selectionType' => 'line',
41 ),
42 array(
43 'id' => 'intertitre3',
44 'name' => _T('enlumtypo:barre_intertitre3'),
45 'className' => 'outil_intertitre3',
46 'openWith' => "\n{{{***",
47 'closeWith' => "}}}\n",
48 'display' => true,
49 'selectionType' => 'line',
50 ),
51 array(
52 'id' => 'alignerdroite',
53 'name' => _T('enlumtypo:barre_alignerdroite'),
54 'className' => 'outil_alignerdroite',
55 'openWith' => "\n[/",
56 'closeWith' => "/]\n",
57 'display' => true,
58 'selectionType' => 'line',
59 ),
60 array(
61 'id' => 'alignergauche',
62 'name' => _T('enlumtypo:barre_alignergauche'),
63 'className' => 'outil_alignergauche',
64 'openWith' => "\n[!",
65 'closeWith' => "!]\n",
66 'display' => true,
67 'lang' => array('ar', 'fa'),
68 'selectionType' => 'line',
69 ),
70 array(
71 'id' => 'cadretexte',
72 'name' => _T('enlumtypo:barre_encadrer'),
73 'className' => 'outil_cadretexte',
74 'openWith' => "\n[(",
75 'closeWith' => ")]\n",
76 'display' => true,
77 'selectionType' => 'line',
78 ),
79 array(
80 'id' => 'barre_cadre',
81 'name' => _T($module_barre . ':barre_cadre'),
82 'className' => 'outil_barre_cadre',
83 'openWith' => "\n&lt;cadre&gt;",
84 'closeWith' => "&lt;/cadre&gt;\n",
85 'display' => true,
86 'selectionType' => 'line',
87 ),
88 ),
89 ));
90
91 $barre->set('bold', array(
92 // groupe formatage texte
93 'dropMenu' => array(
94 // Italic - {
95 array(
96 'id' => 'italic',
97 'name' => _T('barreoutils:barre_italic'),
98 'key' => 'I',
99 'className' => 'outil_italic',
100 'replaceWith' => "function(h){ return espace_si_accolade(h, '{', '}');}",
101 //'openWith' => '{',
102 //'closeWith' => '}',
103 'display' => true,
104 'selectionType' => 'word',
105 ),
106 // Petites capitales
107 array(
108 'id' => 'petitescapitales',
109 'name' => _T('enlumtypo:barre_petitescapitales'),
110 'className' => 'outil_petitescapitales',
111 'openWith' => '<sc>',
112 'closeWith' => '</sc>',
113 'display' => true,
114 'selectionType' => 'word',
115 ),
116 // montrer une suppression
117 array(
118 'id' => 'stroke_through_et',
119 'name' => _T('enlumtypo:barre_barre'), // :-)
120 'className' => 'outil_stroke_through_et',
121 'openWith' => '<del>',
122 'closeWith' => '</del>',
123 'display' => true,
124 'selectionType' => 'word',
125 ),
126 // Mise en évidence (gras + couleur)
127 array(
128 'id' => 'miseenevidence',
129 'name' => _T('enlumtypo:barre_miseenevidence'),
130 'className' => 'outil_miseenevidence',
131 'openWith' => '[*',
132 'closeWith' => '*]',
133 'display' => true,
134 'selectionType' => 'word',
135 ),
136 // Mise en évidence2 (gras + autre couleur)
137 array(
138 'id' => 'miseenevidence2',
139 'name' => _T('enlumtypo:barre_miseenevidence2'),
140 'className' => 'outil_miseenevidence2',
141 'openWith' => '[**',
142 'closeWith' => '*]',
143 'display' => true,
144 'selectionType' => 'word',
145 ),
146 // Mise en exposant
147 array(
148 'id' => 'exposant',
149 'name' => _T('enlumtypo:barre_exposant'),
150 'className' => 'outil_exposant',
151 'openWith' => '<sup>',
152 'closeWith' => '</sup>',
153 'display' => true,
154 'selectionType' => 'word',
155 ),
156 // Mise en indice
157 array(
158 'id' => 'indice',
159 'name' => _T('enlumtypo:barre_indice'),
160 'className' => 'outil_indice',
161 'openWith' => '<sub>',
162 'closeWith' => '</sub>',
163 'display' => true,
164 'selectionType' => 'word',
165 ),
166 // cadre spip
167 array(
168 'id' => 'barre_code',
169 'name' => _T($module_barre . ':barre_code'),
170 'className' => 'outil_barre_code',
171 'openWith' => '&lt;code&gt;',
172 'closeWith' => '&lt;/code&gt;',
173 'display' => true,
174 'selectionType' => 'word',
175 ),
176 ),
177 ));
178
179 $barre->set('link', array(
180 // groupe formatage texte
181 'dropMenu' => array(
182 array(
183 'id' => 'notes',
184 'name' => _T('barreoutils:barre_note'),
185 'className' => 'outil_notes',
186 'openWith' => '[[',
187 'closeWith' => ']]',
188 'display' => true,
189 'selectionType' => 'word',
190 ),
191 ),
192 ));
193
194 // Appel Tableau
195 $barre->ajouterApres('notes', array(
196 'id' => 'barre_tableau',
197 'name' => _T('enlumtypo:barre_tableau'),
198 'className' => 'outil_barre_tableau',
199 'replaceWith' => 'function(markitup) { zone_selection = markitup.textarea; window.open("?exec=tableau_edit", "","scrollbars=yes,resizable=yes,width=700,height=600") }',
200 'display' => true,
201 'selectionType' => 'line',
202 ));
203
204 $barre->set('quote', array(
205 'openWith' => '<quote>',
206 'closeWith' => '</quote>',
207 ));
208
209 $barre->set('quote', array(
210 'dropMenu' => array(
211 // poesie spip
212 array(
213 'id' => 'barre_poesie',
214 'name' => _T($module_barre . ':barre_poesie'),
215 'className' => 'outil_barre_poesie',
216 'openWith' => "\n&lt;poesie&gt;\n",
217 'closeWith' => "\n&lt;/poesie&gt;\n",
218 'display' => true,
219 'selectionType' => 'word',
220 ),
221 ),
222 ));
223
224 return $barres;
225 }
226
227 function typoenluminee_porte_plume_lien_classe_vers_icone($flux) {
228 return array_merge($flux, array(
229 'outil_intertitre1' => array('spt-v1.png', '-10px -226px'), //'intertitre.png'
230 'outil_intertitre2' => array('intertitre2.png', '0'),
231 'outil_intertitre3' => array('intertitre3.png', '0'),
232 'outil_alignerdroite' => array('right.png', '0'),
233 'outil_alignergauche' => array('left.png', '0'),
234 'outil_stroke_through_et' => array('spt-v1.png', '-10px -946px'), //'text_strikethrough.png'
235 'outil_cadretexte' => array('cadretexte.png', '0'),
236 'outil_speciaux' => array('tag.png', '0'),
237 'outil_barre_code' => array('page_white_code_red.png', '0'),
238 'outil_barre_cadre' => array('page_white_code.png', '0'),
239
240 'outil_miseenevidence' => array('miseenevidence.png', '0'),
241 'outil_miseenevidence2' => array('miseenevidence2.png', '0'),
242 'outil_exposant' => array('exposant.png', '0'),
243 'outil_indice' => array('indice.png', '0'),
244 'outil_petitescapitales' => array('petitescapitales.png', '0'),
245 'outil_barre_poesie' => array('poesie.png', '0'),
246
247 'outil_barre_tableau' => array('barre-tableau.png', '0'),
248 ));
249 }