[SPIP] ~maj v2.1.25-->2.1.26
[velocampus/web/www.git] / www / plugins / auto / couteau_suisse / couteau_suisse / config_outils.php
1 <?php
2
3 #-----------------------------------------------------#
4 # Plugin : Couteau Suisse - Licence : GPL #
5 # Auteur : Patrice Vanneufville, 2006 #
6 # Contact : patrice¡.!vanneufville¡@!laposte¡.!net #
7 # Infos : http://www.spip-contrib.net/?article2166 #
8 #-----------------------------------------------------#
9 if(!defined("_ECRIRE_INC_VERSION")) return;
10
11 // Noter :
12 // outils/mon_outil.php : inclus par les pipelines de l'outil
13 // outils/mon_outil_options.php : inclus par couteau_suisse_options.php
14 // outils/mon_outil_fonctions.php : inclus par couteau_suisse_fonctions.php
15
16 cs_log("inclusion de config_outils.php");
17 //-----------------------------------------------------------------------------//
18 // options //
19 //-----------------------------------------------------------------------------//
20 /*
21 add_outil( array(
22 'id' => 'revision_nbsp',
23 'code:options' => '$GLOBALS["activer_revision_nbsp"] = true; $GLOBALS["test_i18n"] = true ;',
24 'categorie' => 'admin',
25 ));
26 */
27
28
29 add_variables( array(
30 'nom' => 'alinea',
31 'check' => 'couteauprive:autobr_oui',
32 'defaut' => 1,
33 'code:%s' => "define('_CS_AUTOBR_TRAIT', 1);",
34 ) ,array(
35 'nom' => 'alinea2',
36 'check' => 'couteauprive:autobr_non',
37 'defaut' => 0,
38 'code:%s' => "define('_CS_AUTOBR_RACC', 1);",
39 ));
40 add_outil( array(
41 'id' => 'autobr',
42 'code:options' => '%%alinea%%%%alinea2%%',
43 'categorie' => 'typo-corr',
44 // traitement automatique des TEXTE/articles, et TEXTE/forums (standard pour SPIP>=2.1)
45 'traitement:TEXTE/articles:pre_propre'
46 .(!defined('_SPIP20100')?',traitement:TEXTE/forums:pre_propre':'') => 'autobr_pre_propre',
47 'pipelinecode:pre_typo' => 'if(%%alinea2%%) { include_spip(\'outils/autobr\'); $flux = autobr_alinea($flux); }',
48 'pipeline:nettoyer_raccourcis_typo' => 'autobr_nettoyer_raccourcis',
49 'pipeline:porte_plume_cs_pre_charger' => 'autobr_CS_pre_charger',
50 'pipeline:porte_plume_lien_classe_vers_icone' => 'autobr_PP_icones',
51 'code:fonctions' => "// pour le traitement TEXTE/articles et la balise #INTRODUCTION
52 include_spip('outils/autobr');
53 \$GLOBALS['cs_introduire'][] = 'autobr_nettoyer_raccourcis';",
54 'pipelinecode:pre_description_outil' => 'if($id=="autobr")
55 $texte=str_replace("@BALISES@",cs_balises_traitees("autobr"),$texte);',
56 ));
57
58 // ici on a besoin d'une case input. La variable est : dossier_squelettes
59 // a la toute premiere activation de l'outil, la valeur sera : $GLOBALS['dossier_squelettes']
60 add_variable( array(
61 'nom' => 'dossier_squelettes',
62 'format' => _format_CHAINE,
63 'defaut' => "\$GLOBALS['dossier_squelettes']",
64 'code' => "\$GLOBALS['dossier_squelettes']=%s;",
65 ));
66 add_outil( array(
67 'id' => 'dossier_squelettes',
68 'code:spip_options' => '%%dossier_squelettes%%',
69 'categorie' => 'admin',
70 ));
71
72 add_outil( array(
73 'id' => 'supprimer_numero',
74 /* inserer :
75 $table_des_traitements['TITRE'][]= 'typo(supprimer_numero(%s))';
76 $table_des_traitements['TYPE']['mots']= 'typo(supprimer_numero(%s))';
77 $table_des_traitements['NOM'][]= 'typo(supprimer_numero(%s))'; */
78 'traitement:TITRE:pre_typo,
79 traitement:TITRE/mots:pre_typo,
80 traitement:NOM:pre_typo,
81 traitement:TYPE/mots:pre_typo' => 'supprimer_numero',
82 'categorie' => 'public',
83 ));
84
85 add_variable( array(
86 'nom' => 'paragrapher',
87 'format' => _format_NOMBRE,
88 'radio' => array(1 => 'item_oui', 0 => 'item_non', -1 => 'couteauprive:par_defaut'),
89 'defaut' => "-1",
90 'code:%s>=0' => "\$GLOBALS['toujours_paragrapher']=%s;",
91 ));
92 add_outil( array(
93 'id' => 'paragrapher2',
94 'code:spip_options' => '%%paragrapher%%',
95 'categorie' => 'admin',
96 ));
97
98 add_outil( array(
99 'id' => 'forcer_langue',
100 'code:spip_options' => "\$GLOBALS['forcer_lang']=true;",
101 'categorie' => 'public',
102 ));
103
104 add_variable( array(
105 'nom' => 'webmestres',
106 'format' => _format_CHAINE,
107 'defaut' => '"1"',
108 'code:strlen(%s)' => "define('_ID_WEBMESTRES', %s);",
109 'code:!strlen(%s)' => "define('_ID_WEBMESTRES', 1);",
110 ));
111 add_outil( array(
112 'id' => 'webmestres',
113 'code:spip_options' => '%%webmestres%%',
114 'categorie' => 'admin',
115 // non supporte avant la version 1.92
116 'version-min' => '1.9200',
117 'autoriser' => "autoriser('webmestre')",
118 'pipelinecode:pre_description_outil' => 'if($id=="webmestres")
119 $texte=str_replace(array("@_CS_LISTE_WEBMESTRES@","@_CS_LISTE_ADMINS@"),get_liste_administrateurs(),$texte);',
120 ));
121
122 add_outil( array(
123 'id' => 'insert_head',
124 'code:options' => "\$GLOBALS['spip_pipeline']['affichage_final'] .= '|f_insert_head';",
125 'categorie' => 'spip',
126 ));
127
128 // ici on a besoin d'une case input. La variable est : suite_introduction
129 // a la toute premiere activation de l'outil, la valeur sera : '&nbsp;(...)'
130 add_variables( array(
131 'nom' => 'suite_introduction',
132 'format' => _format_CHAINE,
133 'defaut' => '"&nbsp;(...)"',
134 'code' => "define('_INTRODUCTION_SUITE', %s);\n",
135 ), array(
136 'nom' => 'lgr_introduction',
137 'format' => _format_NOMBRE,
138 'defaut' => 100,
139 'code:%s && %s!=100' => "define('_INTRODUCTION_LGR', %s);\n",
140 ), array(
141 'nom' => 'lien_introduction',
142 'format' => _format_NOMBRE,
143 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
144 'defaut' => 0,
145 'code' => "define('_INTRODUCTION_LIEN', %s);",
146 ));
147 add_outil( array(
148 'id' => 'introduction',
149 'code:options' => "%%lgr_introduction%%%%suite_introduction%%%%lien_introduction%%",
150 'categorie' => 'spip',
151 ));
152
153 // ici on a besoin de deux boutons radio : _T('icone_interface_simple') et _T('icone_interface_complet')
154 add_variable( array(
155 'nom' => 'radio_set_options4',
156 'format' => _format_CHAINE,
157 'radio' => array('basiques' => 'icone_interface_simple', 'avancees' => 'icone_interface_complet'),
158 'defaut' => '"avancees"',
159 'label' => '@_CS_CHOIX@',
160 'code' => "\$_GET['set_options']=\$GLOBALS['set_options']=%s;",
161 ));
162 add_outil( array(
163 'id' => 'set_options',
164 'auteur' => 'Vincent Ramos',
165 'code:options' => "%%radio_set_options4%%",
166 'categorie' => 'interface',
167 // pipeline pour retirer en JavaScript le bouton de controle de l'interface
168 'pipeline:header_prive' => 'set_options_header_prive',
169 // non supporte a partir de la version 1.93
170 'version-max' => '1.9299',
171 ));
172
173 // ici on a besoin de trois boutons radio : _T('couteauprive:js_jamais'), _T('couteauprive:js_defaut') et _T('couteauprive:js_toujours')
174 add_variable( array(
175 'nom' => 'radio_filtrer_javascript3',
176 'format' => _format_NOMBRE,
177 'radio' => array(-1 => 'couteauprive:js_jamais', 0 => 'couteauprive:js_defaut', 1 => 'couteauprive:js_toujours'),
178 'defaut' => 0,
179 'label' => '@_CS_CHOIX@',
180 // si la variable est non nulle, on code...
181 'code:%s' => "\$GLOBALS['filtrer_javascript']=%s;",
182 ));
183 add_outil( array(
184 'id' => 'filtrer_javascript',
185 'code:options' => "%%radio_filtrer_javascript3%%",
186 'categorie' => 'securite',
187 'version-min' => '1.9200',
188 ));
189
190 // ici on a besoin d'une case input. La variable est : forum_lgrmaxi
191 // a la toute premiere activation de l'outil, la valeur sera : 0 (aucune limite)
192 add_variable( array(
193 'nom' => 'forum_lgrmaxi',
194 'format' => _format_NOMBRE,
195 'defaut' => 0,
196 'code:%s' => "define('_FORUM_LONGUEUR_MAXI', %s);",
197 ));
198 add_outil( array(
199 'id' => 'forum_lgrmaxi',
200 'code:spip_options' => "%%forum_lgrmaxi%%",
201 'categorie' => 'securite',
202 'version-min' => '1.9200',
203 ));
204
205
206 add_variables( array(
207 'nom' => 'logo_Hmax',
208 'format' => _format_NOMBRE,
209 'defaut' => 0,
210 'code:%s' => "@define('_LOGO_MAX_HEIGHT', %s);\n",
211 ), array(
212 'nom' => 'logo_Wmax',
213 'format' => _format_NOMBRE,
214 'defaut' => 0,
215 'code:%s' => "@define('_LOGO_MAX_WIDTH', %s);\n",
216 ), array(
217 'nom' => 'logo_Smax',
218 'format' => _format_NOMBRE,
219 'defaut' => 0,
220 'code:%s' => "@define('_LOGO_MAX_SIZE', %s);\n",
221 ), array(
222 'nom' => 'img_Hmax',
223 'format' => _format_NOMBRE,
224 'defaut' => 0,
225 'code:%s' => "@define('_IMG_MAX_HEIGHT', %s);\n",
226 ), array(
227 'nom' => 'img_Wmax',
228 'format' => _format_NOMBRE,
229 'defaut' => 0,
230 'code:%s' => "@define('_IMG_MAX_WIDTH', %s);\n",
231 ), array(
232 'nom' => 'img_Smax',
233 'format' => _format_NOMBRE,
234 'defaut' => 0,
235 'code:%s' => "@define('_IMG_MAX_SIZE', %s);\n",
236 ), array(
237 'nom' => 'doc_Smax',
238 'format' => _format_NOMBRE,
239 'defaut' => 0,
240 'code:%s' => "@define('_DOC_MAX_SIZE', %s);\n",
241 ), array(
242 'nom' => 'img_GDmax',
243 'format' => _format_NOMBRE,
244 'defaut' => 0,
245 'code:%s' => "@define('_IMG_GD_MAX_PIXELS', %s);\n",
246 ), array(
247 'nom' => 'img_GDqual',
248 'format' => _format_NOMBRE,
249 'defaut' => 85,
250 'code:%s' => "@define('_IMG_GD_QUALITE', %s);\n",
251 'label' => '@_CS_CHOIX@',
252 ), array(
253 'nom' => 'copie_Smax',
254 'format' => _format_NOMBRE,
255 'defaut' => 16,
256 'code' => "@define('_COPIE_LOCALE_MAX_SIZE', %s*1048576);",
257 ));
258 add_outil( array(
259 'id' => 'SPIP_tailles',
260 'code:spip_options' => "%%logo_Hmax%%%%logo_Wmax%%%%logo_Smax%%%%img_Hmax%%%%img_Wmax%%%%img_Smax%%%%doc_Smax%%%%img_GDmax%%%%img_GDqual%%%%copie_Smax%%",
261 'categorie' => 'securite',
262 ));
263
264 add_outil( array(
265 'id' => 'previsualisation',
266 'categorie' => 'interface',
267 'auteur' => '[C&eacute;dric Morin->http://www.yterium.net]',
268 'pipeline:pre_boucle' => 'previsu_redac_pre_boucle',
269 'pipeline:boite_infos' => 'previsu_redac_boite_infos',
270 // fichier distant pour les pipelines
271 'distant_pipelines' => 'http://zone.spip.org/trac/spip-zone/export/32230/_plugins_/previsu_redaction/previsu_redac_pipelines.php',
272 'version-min' => '1.9300',
273 ));
274
275 add_variable( array(
276 'nom' => 'mot_masquer',
277 'format' => _format_CHAINE,
278 'defaut' => "'masquer'",
279 'code' => "define('_MOT_MASQUER', %s);",
280 'commentaire' => '!sql_countsel("spip_mots", "titre="._q(%s))?"<span style=\"color:red\">"._T("couteauprive:erreur_mot", array("mot"=>%s))."</span>":""',
281 ));
282 add_outil( array(
283 'id' => 'masquer',
284 'categorie' => 'spip',
285 'auteur' => 'Nicolas Hoizey, St&eacute;phanie Caron',
286 'pipeline:pre_boucle' => 'masquer_pre_boucle',
287 // fichier distant pour le pipeline
288 'distant_pipelines' => 'http://zone.spip.org/trac/spip-zone/export/35809/_plugins_/masquer/masquer_pipelines.php',
289 'code:options' => "%%mot_masquer%%",
290 'code:fonctions' => 'if (!function_exists("critere_tout_voir_dist")){
291 function critere_tout_voir_dist($idb, &$boucles, $crit) {
292 $boucle = &$boucles[$idb];
293 $boucle->modificateur["tout_voir"] = true;
294 }
295 }',
296 'version-min' => '1.9300',
297 ));
298
299 add_variables( array(
300 'nom' => 'auteur_forum_nom',
301 'check' => 'couteauprive:auteur_forum_nom',
302 'defaut' => 1,
303 ), array(
304 'nom' => 'auteur_forum_email',
305 'check' => 'couteauprive:auteur_forum_email',
306 'defaut' => 0,
307 ), array(
308 'nom' => 'auteur_forum_deux',
309 'check' => 'couteauprive:auteur_forum_deux',
310 'defaut' => 0,
311 ));
312 // chaine de langue en extension sous SPIP>=3.0
313 $cs_temp = defined('_SPIP30000')?'forum:':'';
314 add_outil( array(
315 'id' => 'auteur_forum',
316 'categorie' => 'securite',
317 'jquery' => 'oui',
318 'code:jq_init' => 'cs_auteur_forum.apply(this);',
319 'code:js' => "var cs_verif_email = %%auteur_forum_email%%;\nvar cs_verif_nom = %%auteur_forum_nom%%;\nvar cs_verif_deux = %%auteur_forum_deux%%;",
320 'pipelinecode:pre_description_outil' => 'if($id=="auteur_forum") $texte=str_replace(array("@_CS_FORUM_NOM@","@_CS_FORUM_EMAIL@"),
321 array(preg_replace(\',:$,\',"",_T("'.$cs_temp.'forum_votre_nom")),preg_replace(\',:$,\',"",_T("'.$cs_temp.'forum_votre_email"))),$texte);',
322 ));
323 /* Astuce de b_b en php (a tester !)
324 'pipeline:formulaire_verifier' => 'nom_obligatoire',
325 function nom_obligatoire($flux){
326 $form = $flux['args']['form'];
327 if ($form=='forum'){
328 if (!sinon($GLOBALS['visiteur_session']['nom'],$GLOBALS['visiteur_session']['session_nom'])){
329 $flux['data']['message_erreur'] .= _T('nom_obligatoire');
330 $flux['data']['session_nom'] = _T('nom_obligatoire');
331 unset($flux['data']['previsu']);
332 }
333 }
334 return $flux;
335 }*/
336
337 // ici on a besoin de trois boutons radio : _T('couteauprive:par_defaut'), _T('couteauprive:sf_amont') et _T('couteauprive:sf_tous')
338 add_variable( array(
339 'nom' => 'radio_suivi_forums3',
340 'format' => _format_CHAINE,
341 'radio' => array('defaut' => 'couteauprive:par_defaut', '_SUIVI_FORUMS_REPONSES' => 'couteauprive:sf_amont', '_SUIVI_FORUM_THREAD' => 'couteauprive:sf_tous'),
342 'defaut' => '"defaut"',
343 'label' => '@_CS_CHOIX@',
344 // si la variable est differente de 'defaut' alors on codera le define
345 'code:%s!=="defaut"' => "define(%s, true);",
346 ));
347 add_outil( array(
348 'id' => 'suivi_forums',
349 'code:options' => "%%radio_suivi_forums3%%",
350 'categorie' => 'admin',
351 // effectif que dans la version 1.92 (cf : plugin notifications)
352 'version-min' => '1.9200',
353 'version-max' => '1.9299',
354 ));
355
356 add_variables( array(
357 'nom' => 'spam_mots',
358 'format' => _format_CHAINE,
359 'lignes' => 8,
360 'defaut' => '"sucking blowjob superbabe ejakulation fucking (asses)"',
361 'code' => "define('_spam_MOTS', %s);",
362 ), array(
363 'nom' => 'spam_ips',
364 'format' => _format_CHAINE,
365 'lignes' => 6,
366 'defaut' => '""',
367 'code' => "define('_spam_IPS', %s);",
368 ));
369 add_outil( array(
370 'id' => 'spam',
371 'code:options' => "%%spam_mots%%\n%%spam_ips%%",
372 // sauvegarde de l'IP pour tests
373 'code:spip_options' => '$ip_=$ip;',
374 'categorie' => 'securite',
375 ));
376
377 // a placer apres l'outil 'spam' pour compatibilite IP
378 add_outil( array(
379 'id' => 'no_IP',
380 'code:spip_options' => '$ip = substr(md5($ip),0,16);',
381 'categorie' => 'securite',
382 ));
383
384 add_outil( array(
385 'id' => 'flock',
386 'code:spip_options' => "define('_SPIP_FLOCK',false);",
387 'categorie' => 'admin',
388 'version-min' => '1.9300',
389 ));
390
391 add_variables( array(
392 'nom' => 'ecran_actif',
393 'check' => 'couteauprive:ecran_activer',
394 'defaut' => 1,
395 // code d'appel en realpath() pour config/mes_options.php (SPIP < 2.1)
396 'code:%s' => "// bug SPIP 1.92, 2.0 et 2.1
397 if(isset(\$_REQUEST['exec']) && strncmp('admin_couteau_suisse',\$_REQUEST['exec'],20)==0) \$_REQUEST['exec']='admin_couteau_suisse';
398 ".((!defined('_SPIP20100'))?"if(!defined('_ECRAN_SECURITE') && @file_exists(\$f=\"".str_replace('\\','/',realpath(dirname(__FILE__)))."/lib/ecran_securite/distant_ecran_securite.php\")) include \$f;":''),
399 ), array(
400 'nom' => 'ecran_load',
401 'format' => _format_NOMBRE,
402 'defaut' => 4,
403 'code:%s' => "define('_ECRAN_SECURITE_LOAD',%s);\n",
404 ));
405 add_outil( array(
406 'id' => 'ecran_securite',
407 'code:spip_options' => '%%ecran_load%%%%ecran_actif%%',
408 'categorie' => 'securite',
409 'distant' => 'http://zone.spip.org/trac/spip-zone/browser/_core_/securite/ecran_securite.php?format=txt',
410 'pipeline:fichier_distant' => defined('_SPIP20100')?'ecran_securite_fichier_distant':'',
411 'pipelinecode:pre_description_outil' => 'if($id=="ecran_securite") $flux["non"] = !%%ecran_actif%% || !$flux["actif"];',
412 'pipeline:pre_description_outil' => 'ecran_securite_pre_description_outil',
413 'description' => "<:ecran_securite::>{{@_ECRAN_SECURITE@}}@_ECRAN_SUITE@",
414 ));
415
416 add_variables( array(
417 'nom' => 'log_couteau_suisse',
418 'check' => 'couteauprive:cs_log_couteau_suisse',
419 'defaut' => 0,
420 ), array(
421 'nom' => 'spip_options_on',
422 'check' => 'couteauprive:cs_spip_options_on',
423 'defaut' => 0,
424 'commentaire' => 'cs_outils_concernes("code:spip_options");',
425 ), array(
426 'nom' => 'distant_off',
427 'check' => 'couteauprive:cs_distant_off',
428 'defaut' => 0,
429 'code:%s' => "define('_CS_PAS_DE_DISTANT','oui');",
430 ), array(
431 'nom' => 'distant_outils_off',
432 'check' => 'couteauprive:cs_distant_outils_off',
433 'defaut' => 0,
434 'code:%s' => "define('_CS_PAS_D_OUTIL_DISTANT','oui');",
435 'commentaire' => 'cs_outils_concernes("fichiers_distants",%s);',
436 ));
437 add_outil( array(
438 'id' => 'cs_comportement',
439 'code:spip_options' => "%%distant_off%% %%distant_outils_off%%",
440 'pipelinecode:pre_description_outil' => 'if($id=="cs_comportement") {
441 $tmp=(!%%spip_options_on%%||!$flux["actif"]||defined("_CS_SPIP_OPTIONS_OK"))?"":"<span style=\"color:red\">"._T("couteauprive:cs_spip_options_erreur")."</span>";
442 $texte=str_replace(array("@_CS_FILE_OPTIONS_ERR@","@_CS_DIR_TMP@","@_CS_FILE_OPTIONS@"),
443 array($tmp,cs_canonicalize(_DIR_RESTREINT_ABS._DIR_TMP),show_file_options()),$texte);
444 }',
445 ));
446
447
448 add_outil( array(
449 'id' => 'xml',
450 'code:options' => "\$GLOBALS['xhtml']='sax';",
451 'auteur' => 'Ma&iuml;eul Rouquette',
452 'categorie' =>'public',
453 'version-min' => '1.9200',
454 ));
455
456 add_outil( array(
457 'id' => 'f_jQuery',
458 'code:spip_options' => "\$GLOBALS['spip_pipeline']['insert_head'] = str_replace('|f_jQuery', '', \$GLOBALS['spip_pipeline']['insert_head']);",
459 'auteur' => 'Fil',
460 'categorie' =>'public',
461 'version-min' => '1.9200',
462 ));
463
464 add_variables( array(
465 'nom' => 'prive_travaux',
466 'format' => _format_NOMBRE,
467 'radio' => array(0 => 'couteauprive:tous', 1 => 'couteauprive:admins_seuls'),
468 'defaut' => 0,
469 'code:%s' => "define('_en_travaux_PRIVE', %s);\n",
470 ), array(
471 'nom' => 'admin_travaux',
472 'format' => _format_NOMBRE,
473 'radio' => array(0 => 'couteauprive:tous', 1 => 'couteauprive:sauf_admin', 2 => 'couteauprive:sauf_admin_redac', 3 => 'couteauprive:sauf_identifies'),
474 'radio/ligne' => 1,
475 'defaut' => 0,
476 'code' => "define('_en_travaux_PUBLIC', %s);\n",
477 ), array(
478 'nom' => 'avertir_travaux',
479 'check' => 'couteauprive:travaux_masquer_avert',
480 'defaut' => 0,
481 'code:%s' => "define('_en_travaux_SANSMSG', %s);\n",
482 ), array(
483 'nom' => 'message_travaux',
484 'format' => _format_CHAINE,
485 'defaut' => "_T('couteauprive:travaux_prochainement')",
486 'lignes' => 3,
487 'code' => "\$tr_message=%s;\n",
488 ), array(
489 'nom' => 'titre_travaux',
490 'format' => _format_NOMBRE,
491 'radio' => array(1 => 'couteauprive:travaux_titre', 0 => 'couteauprive:travaux_nom_site'),
492 'defaut' => 1,
493 'code:%s' => "define('_en_travaux_TITRE', %s);",
494 ), array(
495 'nom' => 'cache_travaux',
496 'format' => _format_NOMBRE,
497 'check' => 'couteauprive:travaux_nocache',
498 'defaut' => 1,
499 'code:%s' => "define('_NO_CACHE',1);", // SPIP >=2.0
500 ));
501 add_outil( array(
502 'id' => 'en_travaux',
503 'code:options' => "%%message_travaux%%%%prive_travaux%%%%admin_travaux%%%%avertir_travaux%%%%titre_travaux%%",
504 'categorie' => 'admin',
505 'auteur' => "Arnaud Ventre pour l'id&eacute;e originale",
506 'pipeline:affichage_final' => 'en_travaux_affichage_final',
507 'pipelinecode:pre_description_outil' => 'if($id=="en_travaux") $texte=str_replace(array("@_CS_TRAVAUX_TITRE@","@_CS_NOM_SITE@"),
508 array("["._T("info_travaux_titre")."]","[".$GLOBALS["meta"]["nom_site"]."]"),$texte);',
509 'description' => '<:en_travaux::>[[%message_travaux%]][[%titre_travaux%]][[%admin_travaux%]][[-><admin_travaux valeur="1/2/3">%avertir_travaux%</admin_travaux>]][[->%cache_travaux%]][[%prive_travaux%]]',
510 ));
511
512 add_variables( array(
513 'nom' => 'bp_tri_auteurs',
514 'check' => 'couteauprive:bp_tri_auteurs',
515 'defaut' => 1,
516 'code:%s' => "define('boites_privees_TRI_AUTEURS', %s);\n",
517 ), array(
518 'nom' => 'bp_urls_propres',
519 'check' => 'couteauprive:bp_urls_propres',
520 'defaut' => 1,
521 'code:%s' => "define('boites_privees_URLS_PROPRES', %s);\n",
522 ), array(
523 'nom' => 'cs_rss',
524 'check' => 'couteauprive:rss_var',
525 'defaut' => 1,
526 'code:%s' => "define('boites_privees_CS', %s);\n",
527 ), array(
528 'nom' => 'format_spip',
529 'check' => 'couteauprive:format_spip',
530 'defaut' => 1,
531 'code:%s' => "define('boites_privees_ARTICLES', %s);\n",
532 ), array(
533 'nom' => 'stat_auteurs',
534 'check' => 'couteauprive:stat_auteurs',
535 'defaut' => 1,
536 'code:%s' => "define('boites_privees_AUTEURS', %s);\n",
537 ), array(
538 'nom' => 'qui_webmasters',
539 'check' => 'couteauprive:qui_webmestres',
540 'defaut' => 1,
541 'code:%s' => "define('boites_privees_WEBMASTERS', %s);\n",
542 ));
543 add_outil( array(
544 'id' => 'boites_privees',
545 'auteur'=>'Pat, Joseph LARMARANGE (format SPIP)',
546 'contrib' => 2564,
547 'code:options' => "%%cs_rss%%%%format_spip%%%%stat_auteurs%%%%qui_webmasters%%%%bp_urls_propres%%%%bp_tri_auteurs%%",
548 'categorie' => 'interface',
549 'pipeline:affiche_milieu' => 'boites_privees_affiche_milieu',
550 'pipeline:affiche_droite' => 'boites_privees_affiche_droite',
551 'pipeline:affiche_gauche' => 'boites_privees_affiche_gauche',
552 // controle de la boucle AUTEURS afin de respecter l'ordre des auteurs stockes en base
553 'pipeline:pre_boucle' => defined('_SPIP30000')?'boites_privees_pre_boucle':'',
554 'code:fonctions' => 'include_spip("outils/boites_privees");',
555 // Pour la constante _CS_RSS_SOURCE
556 # 'pipelinecode:pre_description_outil' => 'if($id=="boites_privees") include_spip("cout_define");',
557 ));
558
559 add_variables( array(
560 'nom' => 'max_auteurs_page',
561 'format' => _format_NOMBRE,
562 'defaut' => 30,
563 'code:%s' => "@define('MAX_AUTEURS_PAR_PAGE', %s);\n",
564 ), array(
565 'nom' => 'auteurs_0', 'check' => 'info_administrateurs', 'defaut' => 1, 'code:%s' => "'0minirezo',",
566 ), array(
567 'nom' => 'auteurs_1', 'check' => 'info_redacteurs', 'defaut' => 1, 'code:%s' => "'1comite',",
568 ), array(
569 'nom' => 'auteurs_5', 'check' => 'info_statut_site_4', 'defaut' => 1, 'code:%s' => "'5poubelle',",
570 ), array(
571 'nom' => 'auteurs_6', 'check' => 'info_visiteurs', 'defaut' => 0, 'code:%s' => "'6forum',",
572 ), array(
573 'nom' => 'auteurs_n', 'check' => 'couteauprive:nouveaux', 'defaut' => 0, 'code:%s' => "'nouveau',",
574 ), array(
575 'nom' => 'auteurs_tout_voir',
576 'format' => _format_NOMBRE,
577 'radio' => array(1 => 'couteauprive:statuts_tous', 0 => 'couteauprive:statuts_spip'),
578 'radio/ligne' => 1,
579 'defaut' => 0,
580 'label' => '@_CS_CHOIX@',
581 // 'code:!%s' => "@define('AUTEURS_DEFAUT', join(\$temp_auteurs,','));",
582 'code:!%s' => "if(_request('exec')=='auteurs' && !_request('statut')) \$_GET['statut'] = join(\$temp_auteurs,',');",
583 'code:%s' => "if(_request('exec')=='auteurs' && !_request('statut')) \$_GET['statut'] = '!foo';",
584 ));
585 add_outil( array(
586 'id' => 'auteurs',
587 'code:options' => "%%max_auteurs_page%%\$temp_auteurs=array(%%auteurs_0%%%%auteurs_1%%%%auteurs_5%%%%auteurs_6%%%%auteurs_n%%); %%auteurs_tout_voir%% unset(\$temp_auteurs);",
588 'categorie' => 'interface',
589 'version-min' => '1.9300',
590 // 'pipeline:affiche_milieu' => 'auteurs_affiche_milieu',
591 ));
592
593 //-----------------------------------------------------------------------------//
594 // fonctions //
595 //-----------------------------------------------------------------------------//
596
597 add_outil( array(
598 'id' => 'verstexte',
599 'auteur' => 'C&eacute;dric MORIN',
600 'categorie' => 'spip',
601 ));
602
603 add_outil( array(
604 'id' => 'orientation',
605 'auteur' => 'Pierre Andrews (Mortimer) &amp; IZO',
606 'categorie' => 'spip',
607 ));
608
609 add_variable( array(
610 'nom' => 'balise_decoupe',
611 'format' => _format_NOMBRE,
612 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
613 'defaut' => 0,
614 'code:%s' => "define('_decoupe_BALISE', %s);\n",
615 ));
616 add_outil( array(
617 'id' => 'decoupe',
618 'contrib' => 2135,
619 // Le separateur <span class="csfoo xxxx"></span> est supprime en fin de calcul de page
620 'code:options' => "%%balise_decoupe%%define('_onglets_FIN', '<span class=\"csfoo ongl\"></span>');\n@define('_decoupe_SEPARATEUR', '++++');
621 if(!defined('_SPIP19300') && isset(\$_GET['var_recherche'])) {
622 include_spip('inc/headers');
623 redirige_par_entete(str_replace('var_recherche=', 'decoupe_recherche=', \$GLOBALS['REQUEST_URI']));
624 }",
625 // construction des onglets
626 'code:jq_init' => "onglets_init.apply(this);",
627 // pour les balises #TEXTE : $table_des_traitements['TEXTE'] = 'cs_decoupe(propre(%s))';
628 // pour les articles, breves et rubriques : $table_des_traitements['TEXTE']['articles'] = 'cs_decoupe(propre(%s))';
629 'traitement:TEXTE:post_propre,
630 traitement:TEXTE/articles:post_propre,
631 traitement:TEXTE/forums:post_propre,
632 traitement:TEXTE/breves:post_propre,
633 traitement:TEXTE/rubriques:post_propre' => 'cs_decoupe',
634 // pour les balises #TEXTE : $table_des_traitements['TEXTE'] = 'propre(cs_onglets(%s))';
635 // pour les articles, breves et rubriques : $table_des_traitements['TEXTE']['articles'] = 'propre(cs_onglets(%s))';
636 'traitement:TEXTE:pre_propre,
637 traitement:TEXTE/articles:pre_propre,
638 traitement:TEXTE/forums:pre_propre,
639 traitement:TEXTE/breves:pre_propre,
640 traitement:TEXTE/rubriques:pre_propre' => 'cs_onglets',
641 'categorie' => 'typo-racc',
642 'pipeline:nettoyer_raccourcis_typo' => 'decoupe_nettoyer_raccourcis',
643 'pipeline:porte_plume_cs_pre_charger' => 'decoupe_CS_pre_charger',
644 'pipeline:porte_plume_lien_classe_vers_icone' => 'decoupe_PP_icones',
645 ));
646
647 // couplage avec l'outil 'decoupe', donc 'sommaire' doit etre place juste apres :
648 // il faut inserer le sommaire dans l'article et ensuite seulement choisir la page
649 add_variables( array(
650 'nom' => 'prof_sommaire',
651 'format' => _format_NOMBRE,
652 'defaut' => 1,
653 'code:%s>=2 && %s<=4' => "define('_sommaire_PROFONDEUR', %s);\n",
654 ), array(
655 'nom' => 'lgr_sommaire',
656 'format' => _format_NOMBRE,
657 'defaut' => 30,
658 'code:%s>=9 && %s<=99' => "define('_sommaire_NB_CARACTERES', %s);\n",
659 ), array(
660 'nom' => 'auto_sommaire',
661 'format' => _format_NOMBRE,
662 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
663 'defaut' => 1,
664 'code:%s' => "define('_sommaire_AUTOMATIQUE', %s);\n",
665 ), array(
666 'nom' => 'jolies_ancres',
667 'format' => _format_NOMBRE,
668 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
669 'defaut' => 0,
670 'code:%s' => "define('_sommaire_JOLIES_ANCRES', %s);\n",
671 ), array(
672 'nom' => 'balise_sommaire',
673 'format' => _format_NOMBRE,
674 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
675 'defaut' => 0,
676 'code:%s' => "define('_sommaire_BALISE', %s);",
677 ));
678 include_spip('inc/filtres');
679 add_outil( array(
680 'id' => 'sommaire',
681 'contrib' => 2378,
682 // Le separateur <span class="csfoo xxxx"></span> est supprime en fin de calcul de page
683 'code:options' => "define('_sommaire_REM', '<span class=\"csfoo somm\"></span>');\ndefine('_CS_SANS_SOMMAIRE', '[!sommaire]');\ndefine('_CS_AVEC_SOMMAIRE', '[sommaire]');\n%%prof_sommaire%%%%lgr_sommaire%%%%auto_sommaire%%%%jolies_ancres%%%%balise_sommaire%%",
684 'code:jq' => 'if(jQuery("div.cs_sommaire").length) {
685 // s\'il y a un sommaire, on cache la navigation haute sur les pages
686 jQuery("div.decoupe_haut").css("display", "none");
687 // utilisation des cookies pour conserver l\'etat du sommaire si on quitte la page
688 if(cs_CookiePlugin) jQuery.getScript(cs_CookiePlugin, cs_sommaire_cookie);
689 }',
690 'code:jq_init' => 'cs_sommaire_init.apply(this);',
691 // inserer : $table_des_traitements['TEXTE']['articles']= 'sommaire_d_article(propre(%s))';
692 // idem pour les breves et les rubriques
693 'traitement:TEXTE/articles:post_propre,
694 traitement:TEXTE/breves:post_propre,
695 traitement:TEXTE/rubriques:post_propre' => 'sommaire_d_article',
696 'traitement:CS_SOMMAIRE:post_propre' => 'sommaire_d_article_balise',
697 'categorie' => 'typo-corr',
698 'pipeline:nettoyer_raccourcis_typo' => 'sommaire_nettoyer_raccourcis',
699 'pipeline:pre_description_outil' => 'sommaire_description_outil',
700 'pipeline:pre_propre' => 'sommaire_intertitres',
701 ));
702
703 // intertitres typo, outil compatible avec 'sommaire' :
704 add_variables( array(
705 'nom' => 'i_align',
706 'radio' => array('left' => 'left', 'right' => 'right', 'center' => 'center'),
707 'defaut' => "'left'",
708 ), array(
709 'nom' => 'i_padding',
710 'format' => _format_NOMBRE,
711 'defaut' => 0,
712 ), array(
713 'nom' => 'i_hauteur',
714 'format' => _format_NOMBRE,
715 'defaut' => 0,
716 ), array(
717 'nom' => 'i_largeur',
718 'format' => _format_NOMBRE,
719 'defaut' => 600,
720 ), array(
721 'nom' => 'i_taille',
722 'format' => _format_NOMBRE,
723 'defaut' => 16,
724 ), array(
725 'nom' => 'i_couleur',
726 'format' => _format_CHAINE,
727 'defaut' => "'black'",
728 ), array(
729 'nom' => 'i_police',
730 'format' => _format_CHAINE,
731 'defaut' => "'dustismo.ttf'",
732 ));
733 add_outil( array(
734 'id' => 'titres_typo',
735 'categorie' => 'typo-corr',
736 'code:options' => 'define("_titres_typo_ARG", "couleur=%%i_couleur%%,taille=%%i_taille%%,police=%%i_police%%,largeur=%%i_largeur%%,hauteur_ligne=%%i_hauteur%%,padding=%%i_padding%%,align=%%i_align%%");',
737 defined('_SPIP19300')?'pipeline:pre_propre':'pipeline:pre_typo' => 'titres_typo_pre_typo',
738 'pipelinecode:pre_description_outil' => 'if($id=="titres_typo")
739 $texte=str_replace("@_CS_FONTS@",join(" - ",get_liste_fonts()),$texte);',
740 ));
741
742 //-----------------------------------------------------------------------------//
743 // PUBLIC //
744 //-----------------------------------------------------------------------------//
745
746 // TODO : gestion du jQuery dans la fonction a revoir ?
747 add_outil( array(
748 'id' => 'desactiver_flash',
749 'auteur' => 'C&eacute;dric MORIN',
750 'categorie' => 'public',
751 'jquery' => 'oui',
752 // fonction InhibeFlash_init() codee dans desactiver_flash.js : executee lors du chargement de la page et a chaque hit ajax
753 'code:jq_init' => 'InhibeFlash_init.apply(this);',
754 ));
755
756 add_variables( array(
757 'nom' => 'radio_target_blank3',
758 'format' => _format_NOMBRE,
759 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
760 'defaut' => 0,
761 'code' => '$GLOBALS["tweak_target_blank"]=%s;',
762 ), array(
763 'nom' => 'url_glossaire_externe2',
764 'format' => _format_CHAINE,
765 'defaut' => '""',
766 'code:strlen(%s)' => '$GLOBALS["url_glossaire_externe"]=%s;',
767 ), array(
768 'nom' => 'enveloppe_mails',
769 'format' => _format_NOMBRE,
770 'radio' => array(1 => 'item_oui', 0 => 'item_non', -1 => 'couteauprive:par_defaut'),
771 'defaut' => -1,
772 // Code pour le CSS
773 'code:%s>0' => 'a.spip_mail:before{content:"\002709" !important;}',
774 'code:%s===0' => 'a.spip_mail:before{content:"" !important;}',
775 ));
776 add_outil( array(
777 'id' => 'SPIP_liens',
778 'categorie' => 'public',
779 'contrib' => 2443,
780 'jquery' => 'oui',
781 'description' => '<:SPIP_liens::>'.(defined('_SPIP19300')?'<:SPIP_liens:1:>':''),
782 'code:options' => "%%radio_target_blank3%%\n%%url_glossaire_externe2%%",
783 'code:jq_init' => 'if(%%radio_target_blank3%%) { if(!cs_prive) jQuery("a.spip_out,a.spip_url,a.spip_glossaire",this).attr("target", "_blank"); }',
784 'code:css' => defined('_SPIP19300')?'[[%enveloppe_mails%]]':NULL,
785 ));
786
787 add_variables( array(
788 'nom' => 'tout_rub',
789 'check' => 'icone_rubriques',
790 'defaut' => 0,
791 ), array(
792 'nom' => 'tout_aut',
793 'check' => 'icone_auteurs',
794 'defaut' => 0,
795 ));
796 add_outil( array(
797 'id' => 'aff_tout',
798 'categorie' => 'public',
799 'auteur' => 'b_b',
800 'description' => '<:aff_tout::>[[%tout_rub%]][[->%tout_aut%]]',
801 'pipelinecode:pre_boucle' =>
802 'if(%%tout_rub%%) {if($flux->type_requete == \'rubriques\' && !isset($flux->modificateur[\'criteres\'][\'statut\']))
803 $flux->modificateur[\'criteres\'][\'statut\'] = true;}
804 if(%%tout_aut%%) {if($flux->type_requete == \'auteurs\' && !isset($flux->modificateur[\'criteres\'][\'statut\']))
805 $flux->modificateur[\'criteres\'][\'statut\'] = true;}',
806 ));
807
808 //-----------------------------------------------------------------------------//
809 // NOISETTES //
810 //-----------------------------------------------------------------------------//
811
812 add_outil( array(
813 'id' => 'visiteurs_connectes',
814 'auteur' => "Phil d'apr&egrave;s spip-contrib",
815 'categorie' => 'public',
816 'contrib' => 3412,
817 'code:options' => "
818 function cs_compter_visiteurs(){ return count(preg_files(_DIR_TMP.'visites/','.')); }
819 function action_visiteurs_connectes(){ echo cs_compter_visiteurs(); return true; }",
820 'version-min' => '1.9200', // pour la balise #ARRAY
821 'pipelinecode:pre_description_outil' => 'if($id=="visiteurs_connectes") if($GLOBALS["meta"]["activer_statistiques"]!="oui")
822 $texte.="\n\n<span style=\\"color:red;\\">"._T("couteauprive:visiteurs_connectes:inactif")."</span>";',
823
824 // une mise a jour toutes les 120 sec ?
825 /* 'code:js' => 'function Timer_visiteurs_connectes(){
826 jQuery("span.cs_nb_visiteurs").load("spip.php?action=visiteurs_connectes");
827 setTimeout("Timer_visiteurs_connectes()",120000);
828 }',
829 'code:jq' => ' if(jQuery("span.cs_nb_visiteurs").length) Timer_visiteurs_connectes(); ',
830 'jquery' => 'oui',*/
831 ));
832
833 //-----------------------------------------------------------------------------//
834 // TYPO //
835 //-----------------------------------------------------------------------------//
836
837 add_outil( array(
838 'id' => 'toutmulti',
839 'categorie' => 'typo-racc',
840 'pipeline:pre_typo' => 'ToutMulti_pre_typo',
841 ));
842
843 add_variable( array( // variable utilisee par 'pipelinecode:insert_head'
844 'nom' => 'puceSPIP',
845 'check' => 'couteauprive:puceSPIP',
846 'defaut' => 0,
847 'label' => '@_CS_CHOIX@',
848 ));
849 add_outil( array(
850 'id' => 'pucesli',
851 'auteur' => "J&eacute;r&ocirc;me Combaz pour l'id&eacute;e originale",
852 'categorie' => 'typo-corr',
853 'pipelinecode:pre_typo' => 'if(strpos($flux, "-")!==false OR strpos($flux, "*")!==false) $flux = cs_echappe_balises("", "pucesli_remplace", $flux);',
854 'code:options' => 'function pucesli_remplace($texte) {
855 if(%%puceSPIP%%) {$texte = preg_replace(\'/^[*]\s*/m\', \'- \', $texte);}
856 return preg_replace(\'/^-\s*(?![-*#])/m\', \'-* \', $texte);
857 }
858 if(%%puceSPIP%%) {function pucesli_raccourcis() {return _T(\'couteauprive:puceSPIP_aide\');}}',
859 ));
860
861 add_outil( array(
862 'id' => 'citations_bb',
863 'auteur' => 'Bertrand Marne, Romy T&ecirc;tue',
864 'categorie' => 'typo-corr',
865 'code:css' => '/* Specifie des paires de guillemets sur plusieurs niveaux pour chaque langue */
866 /* Cf.: http://www.yoyodesign.org/doc/w3c/css2/generate.html#quotes-specify */
867 q { quotes: \'"\' \'"\' "\'" "\'" }
868 /* Guillemets selon la langue du texte */
869 :lang(fr) q { quotes: "\00AB\A0" "\A0\00BB" "\201C" "\201D" "\2018" "\2019"; }
870 :lang(en) q { quotes: "\201C" "\201D" "\2018" "\2019" }
871 :lang(es) q { quotes: "\00AB" "\00BB" "\201C" "\201D"; }
872 :lang(it) q { quotes: "\00AB\A0" "\A0\00BB" "\201C" "\201D"; }
873 :lang(de) q { quotes: "\00BB" "\00AB" ">" "<" }
874 :lang(no) q { quotes: "\00AB\A0" "\A0\00BB" "<" ">" }
875 /* Insere des guillemets avant et apres le contenu d\'un element Q */
876 q:before { content: open-quote; }
877 q:after { content: close-quote; }
878 /* IE */
879 * html q { font-style: italic; }
880 *+html q { font-style: italic; }',
881 'pipelinecode:pre_propre' => 'if(strpos($flux, "<qu")!==false) $flux=cs_echappe_balises("", "citations_bb_rempl", $flux);',
882 // Remplacer <quote> par <q> quand il n'y a pas de retour a la ligne (3 niveaux, preg sans l'option s)
883 'code:options' => 'function citations_bb_rempl($texte){
884 $texte = preg_replace($a="/<quote>(.*?)<\/quote>/", $b="<q>\$1</q>", $texte);
885 if(strpos($texte, "<qu")!==false) {
886 $texte = preg_replace($a, $b, $texte);
887 if(strpos($texte, "<qu")!==false) $texte = preg_replace($a, $b, $texte);
888 }
889 return $texte;
890 }',
891 ));
892
893 add_variable( array(
894 'nom' => 'decoration_styles',
895 'format' => _format_CHAINE,
896 'lignes' => 8,
897 'defaut' => '"span.sc = font-variant:small-caps;
898 span.souligne = text-decoration:underline;
899 span.barre = text-decoration:line-through;
900 span.dessus = text-decoration:overline;
901 span.clignote = text-decoration:blink;
902 span.surfluo = background-color:#ffff00; padding:0px 2px;
903 span.surgris = background-color:#EAEAEC; padding:0px 2px;
904 fluo = surfluo"',
905 'code:trim(%s)' => 'function _decoration_BALISES() { return trim(%s); }',
906 ));
907 add_outil( array(
908 'id' => 'decoration',
909 'auteur' => 'izo@aucuneid.net, Pat',
910 'contrib' => 2427,
911 'categorie' => 'typo-racc',
912 'code:options' => "%%decoration_styles%%",
913 'pipeline:pre_typo' => 'decoration_pre_typo',
914 'pipeline:bt_toolbox' => 'decoration_BarreTypo',
915 'pipeline:porte_plume_barre_pre_charger' => 'decoration_PP_pre_charger',
916 'pipeline:porte_plume_lien_classe_vers_icone' => 'decoration_PP_icones',
917 ));
918
919 add_variables( array(
920 'nom' => 'couleurs_fonds',
921 'format' => _format_NOMBRE,
922 'radio' => array(1 => 'item_oui', 0 => 'item_non' ),
923 'defaut' => 1,
924 'code' => "define('_COULEURS_FONDS', %s);\n",
925 ), array(
926 'nom' => 'set_couleurs',
927 'format' => _format_NOMBRE,
928 'radio' => array(0 => 'couteauprive:toutes_couleurs', 1 => 'couteauprive:certaines_couleurs'),
929 'radio/ligne' => 1,
930 'defaut' => 0,
931 'code' => "define('_COULEURS_SET', %s);\n",
932 ), array(
933 'nom' => 'couleurs_perso',
934 'format' => _format_CHAINE,
935 'lignes' => 3,
936 'defaut' => '"gris, rouge"',
937 'code' => "define('_COULEURS_PERSO', %s);",
938 ));
939 add_outil( array(
940 'id' => 'couleurs',
941 'auteur' => 'Aur&eacute;lien PIERARD (id&eacute;e originale), Pat',
942 'categorie' => 'typo-racc',
943 'contrib' => 2427,
944 'pipeline:pre_typo' => 'couleurs_pre_typo',
945 'pipeline:nettoyer_raccourcis_typo' => 'couleurs_nettoyer_raccourcis',
946 'pipeline:bt_toolbox' => 'couleurs_BarreTypo',
947 'pipeline:porte_plume_barre_pre_charger' => 'couleurs_PP_pre_charger',
948 'pipeline:porte_plume_lien_classe_vers_icone' => 'couleurs_PP_icones',
949 'pipeline:pre_description_outil' => 'couleurs_pre_description_outil',
950 'code:options' => "%%couleurs_fonds%%%%set_couleurs%%%%couleurs_perso%%",
951 'code:fonctions' => "// aide le Couteau Suisse a calculer la balise #INTRODUCTION
952 include_spip('outils/couleurs');
953 \$GLOBALS['cs_introduire'][] = 'couleurs_nettoyer_raccourcis';
954 ",
955 ));
956
957 // outil essentiellement français. D'autres langues peuvent etre ajoutees dans outils/typo_exposants.php
958 add_variable( array(
959 'nom' => 'expo_bofbof',
960 'format' => _format_NOMBRE,
961 'radio' => array(1 => 'item_oui', 0 => 'item_non' ),
962 'defaut' => 0,
963 'code:%s' => "define('_CS_EXPO_BOFBOF', %s);",
964 ));
965 add_outil( array(
966 'id' => 'typo_exposants',
967 'auteur' => 'Vincent Ramos, Pat',
968 'categorie' => 'typo-corr',
969 'contrib' => 1564,
970 'code:options' => '%%expo_bofbof%%',
971 'pipeline:post_typo' => 'typo_exposants',
972 'code:css' => 'sup, sup.typo_exposants { font-size:78%; font-variant:inherit; vertical-align:23%; }',
973 ));
974
975 add_outil( array(
976 'id' => 'guillemets',
977 'auteur' => 'Vincent Ramos',
978 'categorie' => 'typo-corr',
979 'pipeline:post_typo' => 'typo_guillemets',
980 ));
981
982 add_variables( array(
983 'nom' => 'liens_interrogation',
984 'format' => _format_NOMBRE,
985 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
986 'defaut' => 1,
987 'code:%s' => "\$GLOBALS['liens_interrogation']=true;\n",
988 ), array(
989 'nom' => 'liens_orphelins',
990 'format' => _format_NOMBRE,
991 'radio' => array(-1 => 'item_non', 0 => 'couteauprive:basique', 1 => 'couteauprive:etendu', -2 => 'couteauprive:par_defaut'),
992 'defaut' => 0,
993 'code' => '$GLOBALS["liens_orphelins"]=%s;',
994 // empeche SPIP de convertir les URLs orphelines (URLs brutes)
995 'code:%s<>-2' => defined('_SPIP19300')?"\n// Pas de traitement automatique des liens orphelins :\n\$GLOBALS['spip_pipeline']['pre_liens']=str_replace('|traiter_raccourci_liens','',\$GLOBALS['spip_pipeline']['pre_liens']);
996 @define('_EXTRAIRE_LIENS',',^\$,');":'',
997 ), array(
998 'nom' => 'long_url',
999 'format' => _format_NOMBRE,
1000 'defaut' => 40,
1001 'code:%s' => "define('_MAX_LONG_URL', %s);",
1002 ), array(
1003 'nom' => 'coupe_url',
1004 'format' => _format_NOMBRE,
1005 'defaut' => 35,
1006 'code:%s' => "define('_MAX_COUPE_URL', %s);",
1007 ));
1008 // attention : liens_orphelins doit etre place avant mailcrypt ou liens_en_clair
1009 add_outil( array(
1010 'id' => 'liens_orphelins',
1011 'categorie' => 'typo-corr',
1012 'contrib' => 2443,
1013 'code:options' => '%%liens_interrogation%%',
1014 'code:spip_options' => '%%liens_orphelins%%%%long_url%%%%coupe_url%%',
1015 'pipeline:pre_propre' => 'liens_orphelins_pipeline',
1016 'traitement:EMAIL' => 'expanser_liens(liens_orphelins',
1017 'pipeline:pre_typo' => 'interro_pre_typo',
1018 'pipeline:post_propre' => 'interro_post_propre',
1019 'description' => defined('_SPIP19300')?'<:liens_orphelins::><liens_orphelins valeur="0/1/-2"><:liens_orphelins:1:></liens_orphelins>':'<:liens_orphelins::>',
1020 ));
1021
1022 add_outil( array(
1023 'id' => 'filets_sep',
1024 'auteur' => 'FredoMkb',
1025 'categorie' => 'typo-racc',
1026 'contrib' => 1563,
1027 'pipeline:pre_typo' => 'filets_sep',
1028 'pipeline:bt_toolbox' => 'filets_sep_BarreTypo',
1029 'pipeline:porte_plume_barre_pre_charger' => 'filets_PP_pre_charger',
1030 'pipeline:porte_plume_lien_classe_vers_icone' => 'filets_PP_icones',
1031 ));
1032
1033 add_outil( array(
1034 'id' => 'smileys',
1035 'auteur' => "Sylvain, Pat",
1036 'categorie' => 'typo-corr',
1037 'contrib' => 1561,
1038 'code:css' => "table.cs_smileys td {text-align:center; font-size:90%; font-weight:bold;}",
1039 'pipeline:pre_typo' => 'cs_smileys_pre_typo',
1040 'pipeline:bt_toolbox' => 'cs_smileys_BarreTypo',
1041 'pipeline:porte_plume_barre_pre_charger' => 'cs_smileys_PP_pre_charger',
1042 'pipeline:porte_plume_lien_classe_vers_icone' => 'cs_smileys_PP_icones',
1043 ));
1044
1045 add_outil( array(
1046 'id' => 'chatons',
1047 'auteur' => "BoOz, Pat",
1048 'categorie' => 'typo-racc',
1049 'pipeline:pre_typo' => 'chatons_pre_typo',
1050 'pipeline:bt_toolbox' => 'chatons_BarreTypo',
1051 'pipeline:porte_plume_barre_pre_charger' => 'chatons_PP_pre_charger',
1052 'pipeline:porte_plume_lien_classe_vers_icone' => 'chatons_PP_icones',
1053 ));
1054
1055 add_variables( array(
1056 'nom' => 'glossaire_groupes',
1057 'format' => _format_CHAINE,
1058 'defaut' => "'Glossaire'",
1059 'code' => "\$GLOBALS['glossaire_groupes']=%s;\n",
1060 'commentaire' => defined('_SPIP19300')?'fct_glossaire_groupes(%s);
1061 function fct_glossaire_groupes($gr){
1062 $s="";
1063 foreach(explode(":",$gr) as $g)
1064 if(!sql_countsel("spip_groupes_mots", "titre="._q($g))) $s.=($s?"<br />":"")._T("couteauprive:erreur_groupe", array("groupe"=>$g));
1065 return $s?"<p style=\"color:red\">$s</p>":"";
1066 }':NULL,
1067 ), array(
1068 'nom' => 'glossaire_limite',
1069 'format' => _format_NOMBRE,
1070 'defaut' => 0,
1071 'code:%s>0' => "define('_GLOSSAIRE_LIMITE', %s);\n",
1072 ), array(
1073 'nom' => 'glossaire_js',
1074 'radio' => array(0 => 'couteauprive:glossaire_css', 1 => 'couteauprive:glossaire_js'),
1075 'format' => _format_NOMBRE,
1076 'defaut' => 1,
1077 'code:%s' => "define('_GLOSSAIRE_JS', %s);",
1078 ));
1079 add_outil( array(
1080 'id' => 'glossaire',
1081 'categorie' => 'typo-corr',
1082 'contrib' => 2206,
1083 'code:options' => "@define('_CS_SANS_GLOSSAIRE', '[!glossaire]');\n%%glossaire_limite%%%%glossaire_groupes%%%%glossaire_js%%",
1084 // 'traitement:LIEU:post_propre' => 'cs_glossaire',
1085 // sans oublier les articles, les breves, les forums et les rubriques !
1086 // SPIP ne considere pas que la premiere definition est un tronc commun...
1087 // meme traitement au chapo des articles...
1088 'traitement:TEXTE:post_propre,
1089 traitement:TEXTE/articles:post_propre,
1090 traitement:TEXTE/breves:post_propre,
1091 traitement:TEXTE/forums:post_propre,
1092 traitement:TEXTE/rubriques:post_propre,
1093 traitement:CHAPO:post_propre' => 'cs_glossaire',
1094 // Precaution pour les articles virtuels (SPIP < 3.0)
1095 defined('_SPIP30000')?'foo':'traitement:CHAPO:pre_propre' => 'nettoyer_chapo',
1096 // Mise en forme des titres
1097 'traitement:TITRE/mots:post_typo' => 'cs_glossaire_titres',
1098 'code:css' => 'a.cs_glossaire:after {display:none;}',
1099 // fonction glossaire_init() codee dans glossaire.js : executee lors du chargement de la page et a chaque hit ajax
1100 'code:jq_init' => 'glossaire_init.apply(this);',
1101 'pipelinecode:nettoyer_raccourcis_typo' => '$flux=str_replace(_CS_SANS_GLOSSAIRE, "", $flux);',
1102 ));
1103
1104 // attention : mailcrypt doit etre place apres liens_orphelins
1105 add_outil( array(
1106 'id' => 'mailcrypt',
1107 'categorie' => 'securite',
1108 'auteur' => "Alexis Roussel, Paolo, Pat",
1109 'contrib' => 2443,
1110 'jquery' => 'oui',
1111 'pipelinecode:post_propre' => "if(strpos(\$flux, '@')!==false) \$flux=cs_echappe_balises('', 'mailcrypt', \$flux);",
1112 'code:js' => "function lancerlien(a,b){ x='ma'+'ilto'+':'+a+'@'+b; return x; }",
1113 // jQuery pour remplacer l'arobase image par l'arobase texte
1114 // ... puis arranger un peu le title qui a ete protege
1115 'code:jq_init' => "jQuery('span.spancrypt', this).attr('class','cryptOK').html('&#6'+'4;');
1116 jQuery(\"a[\"+cs_sel_jQuery+\"title*='..']\", this).each(function () {
1117 this.title = this.title.replace(/\.\..t\.\./,'[@]');
1118 });",
1119 'code:css' => 'span.spancrypt {background:transparent url(' . url_absolue(find_in_path('img/mailcrypt/leure.gif'))
1120 . ') no-repeat scroll 0.1em center; padding-left:12px; text-decoration:none;}',
1121 'traitement:EMAIL' => 'mailcrypt_email_dist',
1122 // compatibilite avec le plugin facteur
1123 'pipelinecode:facteur_pre_envoi' => 'include_spip("public/parametrer"); // charger mes_fonctions
1124 $flux->Body = maildecrypt($flux->Body);
1125 $flux->AltBody = maildecrypt($flux->AltBody);',
1126 ));
1127
1128
1129 // attention : liens_en_clair doit etre place apres tous les outils traitant des liens
1130 add_outil( array(
1131 'id' => 'liens_en_clair',
1132 'categorie' => 'spip',
1133 'contrib' => 2443,
1134 'pipeline:post_propre' => 'liens_en_clair_post_propre',
1135 'code:css' => 'a.spip_out:after {display:none;}',
1136 ));
1137
1138 add_variables( array( // variable utilisee par 'pipelinecode:insert_head'
1139 'nom' => 'scrollTo',
1140 'check' => 'couteauprive:jq_scrollTo',
1141 'defaut' => 1,
1142 'format' => _format_NOMBRE,
1143 ), array( // variable utilisee par 'pipelinecode:insert_head'
1144 'nom' => 'LocalScroll',
1145 'check' => 'couteauprive:jq_localScroll',
1146 'defaut' => 1,
1147 'format' => _format_NOMBRE,
1148 ));
1149 add_outil( array(
1150 'id' => 'soft_scroller',
1151 'categorie' => 'public',
1152 'jquery' => 'oui',
1153 'pipelinecode:insert_head' => 'if(%%scrollTo%%) {$flux.=\'<script src="\'.find_in_path("outils/jquery.scrollto.js").\'" type="text/javascript"></script>\'."\n";}
1154 if(%%LocalScroll%%) {$flux.=\'<script src="\'.find_in_path("outils/jquery.localscroll.js").\'" type="text/javascript"></script>\'."\n";}',
1155 'code:js' => 'function soft_scroller_init() { if(typeof jQuery.localScroll=="function") jQuery.localScroll({hash: true}); }',
1156 'code:jq_init' => 'soft_scroller_init.apply(this);',
1157 ));
1158
1159 // http://www.malsup.com/jquery/corner/
1160 add_variables( array(
1161 'nom' => 'jcorner_classes',
1162 'format' => _format_CHAINE,
1163 'lignes' => 10,
1164 'defaut' => defined('_SPIP19300')?'"// coins ronds aux formulaires
1165 .formulaire_inscription, .formulaire_forum, .formulaire_ecrire_auteur
1166
1167 // colorisation de la dist de SPIP 2.0 en ajoutant un parent
1168 \".chapo, .texte\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:#ffe0c0; margin:4px 0;\"><\/div>\')
1169 \".menu\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:lightBlue; margin:4px 0;\"><\/div>\')
1170
1171 // coins ronds aux parents !
1172 .jc_parent"'
1173 :'" // coins ronds pour les menus de navigation
1174 .rubriques, .breves, .syndic, .forums, .divers
1175
1176 // en couleurs sur l\'accueil
1177 .liste-articles li .texte = css(\'background-color\', \'#E0F0F0\') .corner()
1178
1179 // colorisation de la dist de SPIP 1.92 en ajoutant un parent
1180 \"#contenu .texte\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:#E0F0F0; margin:4px 0;\"><\/div>\')
1181
1182 // coins ronds aux parents !
1183 .jc_parent"',
1184 'code:trim(%s)' => 'function _jcorner_CLASSES() { return trim(%s); }',
1185 ), array( // variable utilisee par 'pipelinecode:insert_head'
1186 'nom' => 'jcorner_plugin',
1187 'check' => 'couteauprive:jcorner_plugin',
1188 'defaut' => 1,
1189 'format' => _format_NOMBRE,
1190 ));
1191 add_outil( array(
1192 'id' => 'jcorner',
1193 'categorie' => 'public',
1194 'jquery' => 'oui',
1195 'contrib' => 2987,
1196 'code:options' => "%%jcorner_classes%%",
1197 // fichier distant pour le plugin jQuery : http://github.com/malsup/corner/commits/
1198 'distant' => defined('_SPIP20100')
1199 // version 2.09 (11-MAR-2010), jQuery v1.3.2 mini
1200 ?'http://github.com/malsup/corner/raw/ca8d745fdfe054e1bb62fbd22eca9850c1353e03/jquery.corner.js'
1201 // version 2.03 (05-DEC-2009)
1202 :'http://github.com/malsup/corner/raw/46bbbc8706853c879c9224b7ebf5f284f726314d/jquery.corner.js',
1203 'pipelinecode:insert_head' => 'if(%%jcorner_plugin%%) {$flux.=\'<script src="\'.find_in_path("lib/jcorner/distant_jquery.corner.js").\'" type="text/javascript"></script>\'."\n";}',
1204 'pipeline:insert_head' => 'jcorner_insert_head',
1205 // jcorner_init() n'est disponible qu'en partie publique
1206 'code:jq_init' => 'if(typeof jcorner_init=="function") jcorner_init.apply(this);',
1207 ));
1208
1209 add_variables( array(
1210 'nom' => 'insertions',
1211 'format' => _format_CHAINE,
1212 'lignes' => 10,
1213 'defaut' => '"oeuf = &oelig;uf
1214 cceuil = ccueil
1215 (a priori) = {a priori}
1216 (([hH])uits) = $1uit
1217 /([cC]h?)oeur/ = $1&oelig;ur
1218 /oeuvre/ = &oelig;uvre
1219 (O[Ee]uvre([rs]?)) = &OElig;uvre$1
1220 /\b([cC]|[mM].c|[rR]ec)on+ais+a((?:n(?:ce|te?)|ble)s?)\b/ = $1onnaissa$2
1221 "',
1222 'code' => 'function _insertions_LISTE() { return trim(%s); }',
1223 ));
1224 add_outil( array(
1225 'id' => 'insertions',
1226 'categorie' => 'typo-corr',
1227 'code:options' => "%%insertions%%",
1228 // sans oublier les articles, les breves, les forums et les rubriques !
1229 // SPIP ne considere pas que la premiere definition est un tronc commun :
1230 'traitement:CHAPO:pre_propre,
1231 traitement:PS:pre_propre,
1232 traitement:TEXTE:pre_propre,
1233 traitement:TEXTE/articles:pre_propre,
1234 traitement:TEXTE/breves:pre_propre,
1235 traitement:TEXTE/forums:post_propre,
1236 traitement:TEXTE/rubriques:pre_propre' => 'insertions_pre_propre',
1237 ));
1238
1239 // le plugin moderation moderee dans le couteau suisse
1240 include_spip('inc/charsets');
1241 add_outil( array(
1242 'id' => 'moderation_moderee',
1243 'auteur' => 'Yohann(potter64)',
1244 'categorie' => 'admin',
1245 'version-min' => '1.9300',
1246 'code:options' => '%%moderation_admin%%%%moderation_redac%%%%moderation_visit%%',
1247 'code:jq_init' => 'if(window.location.search.match(/page=forum/)!=null) jQuery("legend:contains(\''
1248 .addslashes(unicode2charset(html2unicode(_T((defined('_SPIP30000')?'forum:':'').'bouton_radio_modere_priori')))).'\')", this).next().html(\''
1249 .addslashes(_T('couteauprive:moderation_message')).'\');',
1250 'pipeline:pre_edition' => 'moderation_vip',
1251 ));
1252 add_variables( array(
1253 'nom' => 'moderation_admin',
1254 'check' => 'couteauprive:moderation_admins',
1255 'defaut' => 1,
1256 'code:%s' => "define('_MOD_MOD_0minirezo',%s);",
1257 ), array(
1258 'nom' => 'moderation_redac',
1259 'check' => 'couteauprive:moderation_redacs',
1260 'defaut' => 0,
1261 'code:%s' => "define('_MOD_MOD_1comite',%s);",
1262 ), array(
1263 'nom' => 'moderation_visit',
1264 'check' => 'couteauprive:moderation_visits',
1265 'defaut' => 0,
1266 'code:%s' => "define('_MOD_MOD_6forum',%s);",
1267 ));
1268
1269 add_outil( array(
1270 'id' => 'titre_parent',
1271 'categorie' => 'spip',
1272 'contrib' => 2900,
1273 'code:options' => '%%titres_etendus%%',
1274 ));
1275 add_variable( array(
1276 'nom' => 'titres_etendus',
1277 'check' => 'couteauprive:titres_etendus',
1278 'format' => _format_NOMBRE,
1279 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
1280 'defaut' => 0,
1281 'code:%s' => "define('_PARENTS_ETENDUS',%s);",
1282 ));
1283
1284 add_outil( array(
1285 'id' => 'balise_set',
1286 'categorie' => 'spip',
1287 ));
1288
1289 add_outil( array(
1290 'id' => 'corbeille',
1291 'categorie' => 'admin',
1292 'version-min' => '1.9300',
1293 'code:options' => "%%arret_optimisation%%",
1294 ));
1295 add_variable( array(
1296 'nom' => 'arret_optimisation',
1297 'format' => _format_NOMBRE,
1298 'radio' => array(1 => 'item_oui', 0 => 'item_non'),
1299 'defaut' => 0,
1300 'code:%s' => "define('_CORBEILLE_SANS_OPTIM', 1);
1301 if(!function_exists('genie_optimiser')) {
1302 // surcharge de la fonction d'optimisation de SPIP (inc/optimiser.php)
1303 function genie_optimiser(\$t='foo'){ include_spip('optimiser','genie'); optimiser_base_une_table(); return -(mktime(2,0,0) + rand(0, 3600*4)); }\n}",
1304 ));
1305
1306 add_outil( array(
1307 'id' => 'trousse_balises',
1308 'categorie' => 'spip',
1309 'contrib' => 3005,
1310 ));
1311
1312 add_outil( array(
1313 'id' => 'horloge',
1314 'categorie' => 'spip',
1315 'contrib' => 2998,
1316 'pipelinecode:insert_head,
1317 pipelinecode:header_prive' => '$flux.=\'<script type="text/javascript" src="\'.generer_url_public(\'cout_dates.js\',\'lang=\'.$GLOBALS[\'spip_lang\']).\'"></script>
1318 <script type="text/javascript" src="\'.find_in_path("outils/jquery.jclock.js").\'"></script>\'."\n";',
1319 'code:jq_init' => 'jclock_init.apply(this);',
1320 ));
1321
1322 add_outil(defined('_SPIP20100')?array(
1323 'id' => 'maj_auto',
1324 'categorie' => 'securite',
1325 'contrib' => 3223,
1326 ):array(
1327 'id' => 'maj_auto',
1328 'categorie' => 'securite',
1329 'version-min' => '1.9300',
1330 'contrib' => 3223,
1331 'distant' => 'http://core.spip.org/projects/spip/repository/raw/branches/spip-2.1/ecrire/genie/mise_a_jour.php',
1332 ));
1333
1334 // reglage des differents selecteurs en partie privee
1335 add_outil( array(
1336 'id' => 'brouteur',
1337 'categorie' => 'interface',
1338 'code:spip_options' => "%%rubrique_brouteur%%%%select_mots_clefs%%%%select_min_auteurs%%%%select_max_auteurs%%"
1339 ));
1340 add_variable( array(
1341 'nom' => 'rubrique_brouteur',
1342 'format' => _format_NOMBRE,
1343 'defaut' => 20,
1344 'code:%s' => "define('_SPIP_SELECT_RUBRIQUES', %s);"
1345 ));
1346 add_variable( array(
1347 'nom' => 'select_mots_clefs',
1348 'format' => _format_NOMBRE,
1349 'defaut' => 50,
1350 'code:%s<>50' => "define('_MAX_MOTS_LISTE', %s);"
1351 ));
1352 add_variable( array(
1353 'nom' => 'select_min_auteurs',
1354 'format' => _format_NOMBRE,
1355 'defaut' => 30,
1356 'code:%s<>30' => "define('_SPIP_SELECT_MIN_AUTEURS', %s);"
1357 ));
1358 add_variable( array(
1359 'nom' => 'select_max_auteurs',
1360 'format' => _format_NOMBRE,
1361 'defaut' => 30,
1362 'code:%s<>30' => "define('_SPIP_SELECT_MAX_AUTEURS', %s);"
1363 ));
1364
1365
1366 // Recuperer tous les outils (et leurs variables) de la forme outils/toto_config.xml
1367 foreach (find_all_in_path('outils/', '\w+_config\.xml$') as $f) {
1368 add_outils_xml($f);
1369 }
1370
1371 // Recuperer tous les outils de la forme outils/monoutil_config.php
1372 // y compris les lames perso dont on met le nom en italiques
1373 global $outils;
1374 foreach (find_all_in_path('outils/', '\w+_config\.php$') as $f)
1375 if(preg_match(',^([^.]*)_config$,', basename($f, '.php'),$regs)){
1376 if($outil = charger_fonction($regs[0], 'outils'))
1377 $outil(preg_match(',couteau_suisse/outils/,', $f));
1378 /*else {
1379 // compatibilite ...
1380 include $f;
1381 if(function_exists($cs_temp=$regs[1].'_add_outil')) {
1382 $cs_temp = $cs_temp();
1383 $cs_temp['id'] = $regs[1];
1384 add_outil($cs_temp);
1385 }
1386 }*/
1387 if(isset($outils[$regs[1]]) && strpos($f, '/couteau_suisse/outils/'.$regs[1])===false)
1388 $outils[$regs[1]]['perso'] = 1;
1389 }
1390
1391 // Nettoyage
1392 unset($cs_temp);
1393
1394 // Ajout des outils personnalises sous forme globale
1395 if(isset($GLOBALS['mes_outils'])) {
1396 foreach($GLOBALS['mes_outils'] as $id=>$outil) {
1397 $outil['id'] = $id;
1398 $outil['perso'] = 1;
1399 add_outil($outil);
1400 }
1401 unset($GLOBALS['mes_outils']);
1402 }
1403
1404 // Idees d'ajouts :
1405 // http://archives.rezo.net/spip-core.mbox/
1406 // http://www.spip-contrib.net/Citations
1407 // http://www.spip-contrib.net/la-balise-LESMOTS et d'autres balises #MAINTENANT #LESADMINISTRATEURS #LESREDACTEURS #LESVISITEURS
1408 // http://www.spip-contrib.net/Ajouter-une-lettrine-aux-articles
1409 // http://www.spip-contrib.net/Generation-automatique-de
1410 // http://www.spip-contrib.net/Balise-LOGO-ARTICLE-ORITRAD
1411 // boutonstexte
1412
1413 //global $cs_variables; cs_log($cs_variables, 'cs_variables :');
1414 ?>