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 cout_options.php |
---|
14 | // outils/mon_outil_fonctions.php : inclus par cout_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 : ' (...)' |
---|
130 | add_variables( array( |
---|
131 | 'nom' => 'suite_introduction', |
---|
132 | 'format' => _format_CHAINE, |
---|
133 | 'defaut' => '" (...)"', |
---|
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é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é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 | add_outil( array( |
---|
313 | 'id' => 'auteur_forum', |
---|
314 | 'categorie' => 'securite', |
---|
315 | 'jquery' => 'oui', |
---|
316 | 'code:jq_init' => 'cs_auteur_forum.apply(this);', |
---|
317 | 'code:js' => "var cs_verif_email = %%auteur_forum_email%%;\nvar cs_verif_nom = %%auteur_forum_nom%%;\nvar cs_verif_deux = %%auteur_forum_deux%%;", |
---|
318 | 'pipelinecode:pre_description_outil' => 'if($id=="auteur_forum") $texte=str_replace(array("@_CS_FORUM_NOM@","@_CS_FORUM_EMAIL@"), |
---|
319 | array(preg_replace(\',:$,\',"",_T("forum_votre_nom")),preg_replace(\',:$,\',"",_T("forum_votre_email"))),$texte);', |
---|
320 | )); |
---|
321 | |
---|
322 | // ici on a besoin de trois boutons radio : _T('couteauprive:par_defaut'), _T('couteauprive:sf_amont') et _T('couteauprive:sf_tous') |
---|
323 | add_variable( array( |
---|
324 | 'nom' => 'radio_suivi_forums3', |
---|
325 | 'format' => _format_CHAINE, |
---|
326 | 'radio' => array('defaut' => 'couteauprive:par_defaut', '_SUIVI_FORUMS_REPONSES' => 'couteauprive:sf_amont', '_SUIVI_FORUM_THREAD' => 'couteauprive:sf_tous'), |
---|
327 | 'defaut' => '"defaut"', |
---|
328 | 'label' => '@_CS_CHOIX@', |
---|
329 | // si la variable est differente de 'defaut' alors on codera le define |
---|
330 | 'code:%s!=="defaut"' => "define(%s, true);", |
---|
331 | )); |
---|
332 | add_outil( array( |
---|
333 | 'id' => 'suivi_forums', |
---|
334 | 'code:options' => "%%radio_suivi_forums3%%", |
---|
335 | 'categorie' => 'admin', |
---|
336 | // effectif que dans la version 1.92 (cf : plugin notifications) |
---|
337 | 'version-min' => '1.9200', |
---|
338 | 'version-max' => '1.9299', |
---|
339 | )); |
---|
340 | |
---|
341 | add_variables( array( |
---|
342 | 'nom' => 'spam_mots', |
---|
343 | 'format' => _format_CHAINE, |
---|
344 | 'lignes' => 8, |
---|
345 | 'defaut' => '"sucking blowjob superbabe ejakulation fucking (asses)"', |
---|
346 | 'code' => "define('_spam_MOTS', %s);", |
---|
347 | ), array( |
---|
348 | 'nom' => 'spam_ips', |
---|
349 | 'format' => _format_CHAINE, |
---|
350 | 'lignes' => 6, |
---|
351 | 'defaut' => '""', |
---|
352 | 'code' => "define('_spam_IPS', %s);", |
---|
353 | )); |
---|
354 | add_outil( array( |
---|
355 | 'id' => 'spam', |
---|
356 | 'code:options' => "%%spam_mots%%\n%%spam_ips%%", |
---|
357 | // sauvegarde de l'IP pour tests |
---|
358 | 'code:spip_options' => '$ip_=$ip;', |
---|
359 | 'categorie' => 'securite', |
---|
360 | )); |
---|
361 | |
---|
362 | // a placer apres l'outil 'spam' pour compatibilite IP |
---|
363 | add_outil( array( |
---|
364 | 'id' => 'no_IP', |
---|
365 | 'code:spip_options' => '$ip = substr(md5($ip),0,16);', |
---|
366 | 'categorie' => 'securite', |
---|
367 | )); |
---|
368 | |
---|
369 | add_outil( array( |
---|
370 | 'id' => 'flock', |
---|
371 | 'code:spip_options' => "define('_SPIP_FLOCK',false);", |
---|
372 | 'categorie' => 'admin', |
---|
373 | 'version-min' => '1.9300', |
---|
374 | )); |
---|
375 | |
---|
376 | add_variables( array( |
---|
377 | 'nom' => 'ecran_actif', |
---|
378 | 'check' => 'couteauprive:ecran_activer', |
---|
379 | 'defaut' => 1, |
---|
380 | // code d'appel en realpath() pour config/mes_options.php (SPIP < 2.1) |
---|
381 | 'code:%s' => "// bug SPIP 1.92, 2.0 et 2.1 |
---|
382 | if(isset(\$_REQUEST['exec']) && strncmp('admin_couteau_suisse',\$_REQUEST['exec'],20)==0) \$_REQUEST['exec']='admin_couteau_suisse'; |
---|
383 | ".((!defined('_SPIP20100'))?"if(!defined('_ECRAN_SECURITE') && @file_exists(\$f=\"".str_replace('\\','/',realpath(dirname(__FILE__)))."/lib/ecran_securite/distant_ecran_securite.php\")) include \$f;":''), |
---|
384 | ), array( |
---|
385 | 'nom' => 'ecran_load', |
---|
386 | 'format' => _format_NOMBRE, |
---|
387 | 'defaut' => 4, |
---|
388 | 'code:%s' => "define('_ECRAN_SECURITE_LOAD',%s);\n", |
---|
389 | )); |
---|
390 | add_outil( array( |
---|
391 | 'id' => 'ecran_securite', |
---|
392 | 'code:spip_options' => '%%ecran_load%%%%ecran_actif%%', |
---|
393 | 'categorie' => 'securite', |
---|
394 | 'distant' => 'http://zone.spip.org/trac/spip-zone/browser/_core_/securite/ecran_securite.php?format=txt', |
---|
395 | 'pipeline:fichier_distant' => defined('_SPIP20100')?'ecran_securite_fichier_distant':'', |
---|
396 | 'pipelinecode:pre_description_outil' => 'if($id=="ecran_securite") $flux["non"] = !%%ecran_actif%% || !$flux["actif"];', |
---|
397 | 'pipeline:pre_description_outil' => 'ecran_securite_pre_description_outil', |
---|
398 | 'description' => "<:ecran_securite::>{{@_ECRAN_SECURITE@}}@_ECRAN_SUITE@", |
---|
399 | )); |
---|
400 | |
---|
401 | add_variables( array( |
---|
402 | 'nom' => 'log_couteau_suisse', |
---|
403 | 'check' => 'couteauprive:cs_log_couteau_suisse', |
---|
404 | 'defaut' => 0, |
---|
405 | ), array( |
---|
406 | 'nom' => 'spip_options_on', |
---|
407 | 'check' => 'couteauprive:cs_spip_options_on', |
---|
408 | 'defaut' => 0, |
---|
409 | 'commentaire' => 'cs_outils_concernes("code:spip_options");', |
---|
410 | ), array( |
---|
411 | 'nom' => 'distant_off', |
---|
412 | 'check' => 'couteauprive:cs_distant_off', |
---|
413 | 'defaut' => 0, |
---|
414 | 'code:%s' => "define('_CS_PAS_DE_DISTANT','oui');", |
---|
415 | ), array( |
---|
416 | 'nom' => 'distant_outils_off', |
---|
417 | 'check' => 'couteauprive:cs_distant_outils_off', |
---|
418 | 'defaut' => 0, |
---|
419 | 'code:%s' => "define('_CS_PAS_D_OUTIL_DISTANT','oui');", |
---|
420 | 'commentaire' => 'cs_outils_concernes("fichiers_distants",%s);', |
---|
421 | )); |
---|
422 | add_outil( array( |
---|
423 | 'id' => 'cs_comportement', |
---|
424 | 'code:spip_options' => "%%distant_off%% %%distant_outils_off%%", |
---|
425 | 'pipelinecode:pre_description_outil' => 'if($id=="cs_comportement") { |
---|
426 | $tmp=(!%%spip_options_on%%||!$flux["actif"]||defined("_CS_SPIP_OPTIONS_OK"))?"":"<span style=\"color:red\">"._T("couteauprive:cs_spip_options_erreur")."</span>"; |
---|
427 | $texte=str_replace(array("@_CS_FILE_OPTIONS_ERR@","@_CS_DIR_TMP@","@_CS_FILE_OPTIONS@"), |
---|
428 | array($tmp,cs_canonicalize(_DIR_RESTREINT_ABS._DIR_TMP),show_file_options()),$texte); |
---|
429 | }', |
---|
430 | )); |
---|
431 | |
---|
432 | |
---|
433 | add_outil( array( |
---|
434 | 'id' => 'xml', |
---|
435 | 'code:options' => "\$GLOBALS['xhtml']='sax';", |
---|
436 | 'auteur' => 'Maïeul Rouquette', |
---|
437 | 'categorie' =>'public', |
---|
438 | 'version-min' => '1.9200', |
---|
439 | )); |
---|
440 | |
---|
441 | add_outil( array( |
---|
442 | 'id' => 'f_jQuery', |
---|
443 | 'code:spip_options' => "\$GLOBALS['spip_pipeline']['insert_head'] = str_replace('|f_jQuery', '', \$GLOBALS['spip_pipeline']['insert_head']);", |
---|
444 | 'auteur' => 'Fil', |
---|
445 | 'categorie' =>'public', |
---|
446 | 'version-min' => '1.9200', |
---|
447 | )); |
---|
448 | |
---|
449 | add_variables( array( |
---|
450 | 'nom' => 'prive_travaux', |
---|
451 | 'format' => _format_NOMBRE, |
---|
452 | 'radio' => array(0 => 'couteauprive:tous', 1 => 'couteauprive:admins_seuls'), |
---|
453 | 'defaut' => 0, |
---|
454 | 'code:%s' => "define('_en_travaux_PRIVE', %s);\n", |
---|
455 | ), array( |
---|
456 | 'nom' => 'admin_travaux', |
---|
457 | 'format' => _format_NOMBRE, |
---|
458 | 'radio' => array(0 => 'couteauprive:tous', 1 => 'couteauprive:sauf_admin', 2 => 'couteauprive:sauf_admin_redac', 3 => 'couteauprive:sauf_identifies'), |
---|
459 | 'radio/ligne' => 1, |
---|
460 | 'defaut' => 0, |
---|
461 | 'code' => "define('_en_travaux_PUBLIC', %s);\n", |
---|
462 | ), array( |
---|
463 | 'nom' => 'avertir_travaux', |
---|
464 | 'check' => 'couteauprive:travaux_masquer_avert', |
---|
465 | 'defaut' => 0, |
---|
466 | 'code:%s' => "define('_en_travaux_SANSMSG', %s);\n", |
---|
467 | ), array( |
---|
468 | 'nom' => 'message_travaux', |
---|
469 | 'format' => _format_CHAINE, |
---|
470 | 'defaut' => "_T('couteauprive:travaux_prochainement')", |
---|
471 | 'lignes' => 3, |
---|
472 | 'code' => "\$tr_message=%s;\n", |
---|
473 | ), array( |
---|
474 | 'nom' => 'titre_travaux', |
---|
475 | 'format' => _format_NOMBRE, |
---|
476 | 'radio' => array(1 => 'couteauprive:travaux_titre', 0 => 'couteauprive:travaux_nom_site'), |
---|
477 | 'defaut' => 1, |
---|
478 | 'code:%s' => "define('_en_travaux_TITRE', %s);", |
---|
479 | )); |
---|
480 | add_outil( array( |
---|
481 | 'id' => 'en_travaux', |
---|
482 | 'code:options' => "%%message_travaux%%%%prive_travaux%%%%admin_travaux%%%%avertir_travaux%%%%titre_travaux%%", |
---|
483 | 'categorie' => 'admin', |
---|
484 | 'auteur' => "Arnaud Ventre pour l'idée originale", |
---|
485 | 'pipeline:affichage_final' => 'en_travaux_affichage_final', |
---|
486 | 'pipelinecode:pre_description_outil' => 'if($id=="en_travaux") $texte=str_replace(array("@_CS_TRAVAUX_TITRE@","@_CS_NOM_SITE@"), |
---|
487 | array("["._T("info_travaux_titre")."]","[".$GLOBALS["meta"]["nom_site"]."]"),$texte);', |
---|
488 | )); |
---|
489 | |
---|
490 | add_variables( array( |
---|
491 | 'nom' => 'bp_tri_auteurs', |
---|
492 | 'check' => 'couteauprive:bp_tri_auteurs', |
---|
493 | 'defaut' => 1, |
---|
494 | 'code:%s' => "define('boites_privees_TRI_AUTEURS', %s);\n", |
---|
495 | ), array( |
---|
496 | 'nom' => 'bp_urls_propres', |
---|
497 | 'check' => 'couteauprive:bp_urls_propres', |
---|
498 | 'defaut' => 1, |
---|
499 | 'code:%s' => "define('boites_privees_URLS_PROPRES', %s);\n", |
---|
500 | ), array( |
---|
501 | 'nom' => 'cs_rss', |
---|
502 | 'check' => 'couteauprive:rss_var', |
---|
503 | 'defaut' => 1, |
---|
504 | 'code:%s' => "define('boites_privees_CS', %s);\n", |
---|
505 | ), array( |
---|
506 | 'nom' => 'format_spip', |
---|
507 | 'check' => 'couteauprive:format_spip', |
---|
508 | 'defaut' => 1, |
---|
509 | 'code:%s' => "define('boites_privees_ARTICLES', %s);\n", |
---|
510 | ), array( |
---|
511 | 'nom' => 'stat_auteurs', |
---|
512 | 'check' => 'couteauprive:stat_auteurs', |
---|
513 | 'defaut' => 1, |
---|
514 | 'code:%s' => "define('boites_privees_AUTEURS', %s);\n", |
---|
515 | ), array( |
---|
516 | 'nom' => 'qui_webmasters', |
---|
517 | 'check' => 'couteauprive:qui_webmestres', |
---|
518 | 'defaut' => 1, |
---|
519 | 'code:%s' => "define('boites_privees_WEBMASTERS', %s);\n", |
---|
520 | )); |
---|
521 | add_outil( array( |
---|
522 | 'id' => 'boites_privees', |
---|
523 | 'auteur'=>'Pat, Joseph LARMARANGE (format SPIP)', |
---|
524 | 'contrib' => 2564, |
---|
525 | 'code:options' => "%%cs_rss%%%%format_spip%%%%stat_auteurs%%%%qui_webmasters%%%%bp_urls_propres%%%%bp_tri_auteurs%%", |
---|
526 | 'categorie' => 'interface', |
---|
527 | 'pipeline:affiche_milieu' => 'boites_privees_affiche_milieu', |
---|
528 | 'pipeline:affiche_droite' => 'boites_privees_affiche_droite', |
---|
529 | 'pipeline:affiche_gauche' => 'boites_privees_affiche_gauche', |
---|
530 | // Pour la constante _CS_RSS_SOURCE |
---|
531 | # 'pipelinecode:pre_description_outil' => 'if($id=="boites_privees") include_spip("cout_define");', |
---|
532 | )); |
---|
533 | |
---|
534 | add_variables( array( |
---|
535 | 'nom' => 'max_auteurs_page', |
---|
536 | 'format' => _format_NOMBRE, |
---|
537 | 'defaut' => 30, |
---|
538 | 'code:%s' => "@define('MAX_AUTEURS_PAR_PAGE', %s);\n", |
---|
539 | ), array( |
---|
540 | 'nom' => 'auteurs_0', 'check' => 'info_administrateurs', 'defaut' => 1, 'code:%s' => "'0minirezo',", |
---|
541 | ), array( |
---|
542 | 'nom' => 'auteurs_1', 'check' => 'info_redacteurs', 'defaut' => 1, 'code:%s' => "'1comite',", |
---|
543 | ), array( |
---|
544 | 'nom' => 'auteurs_5', 'check' => 'info_statut_site_4', 'defaut' => 1, 'code:%s' => "'5poubelle',", |
---|
545 | ), array( |
---|
546 | 'nom' => 'auteurs_6', 'check' => 'info_visiteurs', 'defaut' => 0, 'code:%s' => "'6forum',", |
---|
547 | ), array( |
---|
548 | 'nom' => 'auteurs_n', 'check' => 'couteauprive:nouveaux', 'defaut' => 0, 'code:%s' => "'nouveau',", |
---|
549 | ), array( |
---|
550 | 'nom' => 'auteurs_tout_voir', |
---|
551 | 'format' => _format_NOMBRE, |
---|
552 | 'radio' => array(1 => 'couteauprive:statuts_tous', 0 => 'couteauprive:statuts_spip'), |
---|
553 | 'radio/ligne' => 1, |
---|
554 | 'defaut' => 0, |
---|
555 | 'label' => '@_CS_CHOIX@', |
---|
556 | // 'code:!%s' => "@define('AUTEURS_DEFAUT', join(\$temp_auteurs,','));", |
---|
557 | 'code:!%s' => "if(_request('exec')=='auteurs' && !_request('statut')) \$_GET['statut'] = join(\$temp_auteurs,',');", |
---|
558 | 'code:%s' => "if(_request('exec')=='auteurs' && !_request('statut')) \$_GET['statut'] = '!foo';", |
---|
559 | )); |
---|
560 | add_outil( array( |
---|
561 | 'id' => 'auteurs', |
---|
562 | 'code:options' => "%%max_auteurs_page%%\$temp_auteurs=array(%%auteurs_0%%%%auteurs_1%%%%auteurs_5%%%%auteurs_6%%%%auteurs_n%%); %%auteurs_tout_voir%% unset(\$temp_auteurs);", |
---|
563 | 'categorie' => 'interface', |
---|
564 | 'version-min' => '1.9300', |
---|
565 | // 'pipeline:affiche_milieu' => 'auteurs_affiche_milieu', |
---|
566 | )); |
---|
567 | |
---|
568 | //-----------------------------------------------------------------------------// |
---|
569 | // fonctions // |
---|
570 | //-----------------------------------------------------------------------------// |
---|
571 | |
---|
572 | add_outil( array( |
---|
573 | 'id' => 'verstexte', |
---|
574 | 'auteur' => 'Cédric MORIN', |
---|
575 | 'categorie' => 'spip', |
---|
576 | )); |
---|
577 | |
---|
578 | add_outil( array( |
---|
579 | 'id' => 'orientation', |
---|
580 | 'auteur' => 'Pierre Andrews (Mortimer) & IZO', |
---|
581 | 'categorie' => 'spip', |
---|
582 | )); |
---|
583 | |
---|
584 | add_variable( array( |
---|
585 | 'nom' => 'balise_decoupe', |
---|
586 | 'format' => _format_NOMBRE, |
---|
587 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
588 | 'defaut' => 0, |
---|
589 | 'code:%s' => "define('_decoupe_BALISE', %s);\n", |
---|
590 | )); |
---|
591 | add_outil( array( |
---|
592 | 'id' => 'decoupe', |
---|
593 | 'contrib' => 2135, |
---|
594 | // Le separateur <span class="csfoo xxxx"></span> est supprime en fin de calcul de page |
---|
595 | 'code:options' => "%%balise_decoupe%%define('_onglets_FIN', '<span class=\"csfoo ongl\"></span>');\n@define('_decoupe_SEPARATEUR', '++++'); |
---|
596 | if(!defined('_SPIP19300') && isset(\$_GET['var_recherche'])) { |
---|
597 | include_spip('inc/headers'); |
---|
598 | redirige_par_entete(str_replace('var_recherche=', 'decoupe_recherche=', \$GLOBALS['REQUEST_URI'])); |
---|
599 | }", |
---|
600 | // construction des onglets |
---|
601 | 'code:jq_init' => "onglets_init.apply(this);", |
---|
602 | // pour les balises #TEXTE : $table_des_traitements['TEXTE'] = 'cs_decoupe(propre(%s))'; |
---|
603 | // pour les articles, breves et rubriques : $table_des_traitements['TEXTE']['articles'] = 'cs_decoupe(propre(%s))'; |
---|
604 | 'traitement:TEXTE:post_propre, |
---|
605 | traitement:TEXTE/articles:post_propre, |
---|
606 | traitement:TEXTE/forums:post_propre, |
---|
607 | traitement:TEXTE/breves:post_propre, |
---|
608 | traitement:TEXTE/rubriques:post_propre' => 'cs_decoupe', |
---|
609 | // pour les balises #TEXTE : $table_des_traitements['TEXTE'] = 'propre(cs_onglets(%s))'; |
---|
610 | // pour les articles, breves et rubriques : $table_des_traitements['TEXTE']['articles'] = 'propre(cs_onglets(%s))'; |
---|
611 | 'traitement:TEXTE:pre_propre, |
---|
612 | traitement:TEXTE/articles:pre_propre, |
---|
613 | traitement:TEXTE/forums:pre_propre, |
---|
614 | traitement:TEXTE/breves:pre_propre, |
---|
615 | traitement:TEXTE/rubriques:pre_propre' => 'cs_onglets', |
---|
616 | 'categorie' => 'typo-racc', |
---|
617 | 'pipeline:nettoyer_raccourcis_typo' => 'decoupe_nettoyer_raccourcis', |
---|
618 | 'pipeline:porte_plume_cs_pre_charger' => 'decoupe_CS_pre_charger', |
---|
619 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'decoupe_PP_icones', |
---|
620 | )); |
---|
621 | |
---|
622 | // couplage avec l'outil 'decoupe', donc 'sommaire' doit etre place juste apres : |
---|
623 | // il faut inserer le sommaire dans l'article et ensuite seulement choisir la page |
---|
624 | add_variables( array( |
---|
625 | 'nom' => 'prof_sommaire', |
---|
626 | 'format' => _format_NOMBRE, |
---|
627 | 'defaut' => 1, |
---|
628 | 'code:%s>=2 && %s<=4' => "define('_sommaire_PROFONDEUR', %s);\n", |
---|
629 | ), array( |
---|
630 | 'nom' => 'lgr_sommaire', |
---|
631 | 'format' => _format_NOMBRE, |
---|
632 | 'defaut' => 30, |
---|
633 | 'code:%s>=9 && %s<=99' => "define('_sommaire_NB_CARACTERES', %s);\n", |
---|
634 | ), array( |
---|
635 | 'nom' => 'auto_sommaire', |
---|
636 | 'format' => _format_NOMBRE, |
---|
637 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
638 | 'defaut' => 1, |
---|
639 | 'code:%s' => "define('_sommaire_AUTOMATIQUE', %s);\n", |
---|
640 | ), array( |
---|
641 | 'nom' => 'jolies_ancres', |
---|
642 | 'format' => _format_NOMBRE, |
---|
643 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
644 | 'defaut' => 0, |
---|
645 | 'code:%s' => "define('_sommaire_JOLIES_ANCRES', %s);\n", |
---|
646 | ), array( |
---|
647 | 'nom' => 'balise_sommaire', |
---|
648 | 'format' => _format_NOMBRE, |
---|
649 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
650 | 'defaut' => 0, |
---|
651 | 'code:%s' => "define('_sommaire_BALISE', %s);", |
---|
652 | )); |
---|
653 | include_spip('inc/filtres'); |
---|
654 | add_outil( array( |
---|
655 | 'id' => 'sommaire', |
---|
656 | 'contrib' => 2378, |
---|
657 | // Le separateur <span class="csfoo xxxx"></span> est supprime en fin de calcul de page |
---|
658 | '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%%", |
---|
659 | 'code:jq' => 'if(jQuery("div.cs_sommaire").length) { |
---|
660 | // s\'il y a un sommaire, on cache la navigation haute sur les pages |
---|
661 | jQuery("div.decoupe_haut").css("display", "none"); |
---|
662 | // utilisation des cookies pour conserver l\'etat du sommaire si on quitte la page |
---|
663 | if(cs_CookiePlugin) jQuery.getScript(cs_CookiePlugin, cs_sommaire_cookie); |
---|
664 | }', |
---|
665 | 'code:jq_init' => 'cs_sommaire_init.apply(this);', |
---|
666 | // inserer : $table_des_traitements['TEXTE']['articles']= 'sommaire_d_article(propre(%s))'; |
---|
667 | // idem pour les breves et les rubriques |
---|
668 | 'traitement:TEXTE/articles:post_propre, |
---|
669 | traitement:TEXTE/breves:post_propre, |
---|
670 | traitement:TEXTE/rubriques:post_propre' => 'sommaire_d_article', |
---|
671 | 'traitement:CS_SOMMAIRE:post_propre' => 'sommaire_d_article_balise', |
---|
672 | 'categorie' => 'typo-corr', |
---|
673 | 'pipeline:nettoyer_raccourcis_typo' => 'sommaire_nettoyer_raccourcis', |
---|
674 | 'pipeline:pre_description_outil' => 'sommaire_description_outil', |
---|
675 | 'pipeline:pre_propre' => 'sommaire_intertitres', |
---|
676 | )); |
---|
677 | |
---|
678 | // intertitres typo, outil compatible avec 'sommaire' : |
---|
679 | add_variables( array( |
---|
680 | 'nom' => 'i_align', |
---|
681 | 'radio' => array('left' => 'left', 'right' => 'right', 'center' => 'center'), |
---|
682 | 'defaut' => "'left'", |
---|
683 | ), array( |
---|
684 | 'nom' => 'i_padding', |
---|
685 | 'format' => _format_NOMBRE, |
---|
686 | 'defaut' => 0, |
---|
687 | ), array( |
---|
688 | 'nom' => 'i_hauteur', |
---|
689 | 'format' => _format_NOMBRE, |
---|
690 | 'defaut' => 0, |
---|
691 | ), array( |
---|
692 | 'nom' => 'i_largeur', |
---|
693 | 'format' => _format_NOMBRE, |
---|
694 | 'defaut' => 600, |
---|
695 | ), array( |
---|
696 | 'nom' => 'i_taille', |
---|
697 | 'format' => _format_NOMBRE, |
---|
698 | 'defaut' => 16, |
---|
699 | ), array( |
---|
700 | 'nom' => 'i_couleur', |
---|
701 | 'format' => _format_CHAINE, |
---|
702 | 'defaut' => "'black'", |
---|
703 | ), array( |
---|
704 | 'nom' => 'i_police', |
---|
705 | 'format' => _format_CHAINE, |
---|
706 | 'defaut' => "'dustismo.ttf'", |
---|
707 | )); |
---|
708 | add_outil( array( |
---|
709 | 'id' => 'titres_typo', |
---|
710 | 'categorie' => 'typo-corr', |
---|
711 | '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%%");', |
---|
712 | defined('_SPIP19300')?'pipeline:pre_propre':'pipeline:pre_typo' => 'titres_typo_pre_typo', |
---|
713 | 'pipelinecode:pre_description_outil' => 'if($id=="titres_typo") |
---|
714 | $texte=str_replace("@_CS_FONTS@",join(" - ",get_liste_fonts()),$texte);', |
---|
715 | )); |
---|
716 | |
---|
717 | //-----------------------------------------------------------------------------// |
---|
718 | // PUBLIC // |
---|
719 | //-----------------------------------------------------------------------------// |
---|
720 | |
---|
721 | // TODO : gestion du jQuery dans la fonction a revoir ? |
---|
722 | add_outil( array( |
---|
723 | 'id' => 'desactiver_flash', |
---|
724 | 'auteur' => 'Cédric MORIN', |
---|
725 | 'categorie' => 'public', |
---|
726 | 'jquery' => 'oui', |
---|
727 | // fonction InhibeFlash_init() codee dans desactiver_flash.js : executee lors du chargement de la page et a chaque hit ajax |
---|
728 | 'code:jq_init' => 'InhibeFlash_init.apply(this);', |
---|
729 | )); |
---|
730 | |
---|
731 | add_variables( array( |
---|
732 | 'nom' => 'radio_target_blank3', |
---|
733 | 'format' => _format_NOMBRE, |
---|
734 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
735 | 'defaut' => 0, |
---|
736 | 'code' => '$GLOBALS["tweak_target_blank"]=%s;', |
---|
737 | ), array( |
---|
738 | 'nom' => 'url_glossaire_externe2', |
---|
739 | 'format' => _format_CHAINE, |
---|
740 | 'defaut' => '""', |
---|
741 | 'code:strlen(%s)' => '$GLOBALS["url_glossaire_externe"]=%s;', |
---|
742 | ), array( |
---|
743 | 'nom' => 'enveloppe_mails', |
---|
744 | 'format' => _format_NOMBRE, |
---|
745 | 'radio' => array(1 => 'item_oui', 0 => 'item_non', -1 => 'couteauprive:par_defaut'), |
---|
746 | 'defaut' => -1, |
---|
747 | // Code pour le CSS |
---|
748 | 'code:%s>0' => 'a.spip_mail:before{content:"\002709" !important;}', |
---|
749 | 'code:%s===0' => 'a.spip_mail:before{content:"" !important;}', |
---|
750 | )); |
---|
751 | add_outil( array( |
---|
752 | 'id' => 'SPIP_liens', |
---|
753 | 'categorie' => 'public', |
---|
754 | 'contrib' => 2443, |
---|
755 | 'jquery' => 'oui', |
---|
756 | 'description' => '<:SPIP_liens::>'.(defined('_SPIP19300')?'<:SPIP_liens:1:>':''), |
---|
757 | 'code:options' => "%%radio_target_blank3%%\n%%url_glossaire_externe2%%", |
---|
758 | 'code:jq_init' => 'if(%%radio_target_blank3%%) { if(!cs_prive) jQuery("a.spip_out,a.spip_url,a.spip_glossaire",this).attr("target", "_blank"); }', |
---|
759 | 'code:css' => defined('_SPIP19300')?'[[%enveloppe_mails%]]':NULL, |
---|
760 | )); |
---|
761 | |
---|
762 | //-----------------------------------------------------------------------------// |
---|
763 | // NOISETTES // |
---|
764 | //-----------------------------------------------------------------------------// |
---|
765 | |
---|
766 | add_outil( array( |
---|
767 | 'id' => 'visiteurs_connectes', |
---|
768 | 'auteur' => "Phil d'après spip-contrib", |
---|
769 | 'categorie' => 'public', |
---|
770 | 'contrib' => 3412, |
---|
771 | 'code:options' => " |
---|
772 | function cs_compter_visiteurs(){ return count(preg_files(_DIR_TMP.'visites/','.')); } |
---|
773 | function action_visiteurs_connectes(){ echo cs_compter_visiteurs(); return true; }", |
---|
774 | 'version-min' => '1.9200', // pour la balise #ARRAY |
---|
775 | // une mise a jour toutes les 120 sec ? |
---|
776 | /* 'code:js' => 'function Timer_visiteurs_connectes(){ |
---|
777 | jQuery("span.cs_nb_visiteurs").load("spip.php?action=visiteurs_connectes"); |
---|
778 | setTimeout("Timer_visiteurs_connectes()",120000); |
---|
779 | }', |
---|
780 | 'code:jq' => ' if(jQuery("span.cs_nb_visiteurs").length) Timer_visiteurs_connectes(); ', |
---|
781 | 'jquery' => 'oui',*/ |
---|
782 | )); |
---|
783 | |
---|
784 | //-----------------------------------------------------------------------------// |
---|
785 | // TYPO // |
---|
786 | //-----------------------------------------------------------------------------// |
---|
787 | |
---|
788 | add_outil( array( |
---|
789 | 'id' => 'toutmulti', |
---|
790 | 'categorie' => 'typo-racc', |
---|
791 | 'pipeline:pre_typo' => 'ToutMulti_pre_typo', |
---|
792 | )); |
---|
793 | |
---|
794 | add_variable( array( // variable utilisee par 'pipelinecode:insert_head' |
---|
795 | 'nom' => 'puceSPIP', |
---|
796 | 'check' => 'couteauprive:puceSPIP', |
---|
797 | 'defaut' => 0, |
---|
798 | 'label' => '@_CS_CHOIX@', |
---|
799 | )); |
---|
800 | add_outil( array( |
---|
801 | 'id' => 'pucesli', |
---|
802 | 'auteur' => "Jérôme Combaz pour l'idée originale", |
---|
803 | 'categorie' => 'typo-corr', |
---|
804 | 'pipelinecode:pre_typo' => 'if(strpos($flux, "-")!==false OR strpos($flux, "*")!==false) $flux = cs_echappe_balises("", "pucesli_remplace", $flux);', |
---|
805 | 'code:options' => 'function pucesli_remplace($texte) { |
---|
806 | if(%%puceSPIP%%) {$texte = preg_replace(\'/^[*]\s*/m\', \'- \', $texte);} |
---|
807 | return preg_replace(\'/^-\s*(?![-*#])/m\', \'-* \', $texte); |
---|
808 | } |
---|
809 | if(%%puceSPIP%%) {function pucesli_raccourcis() {return _T(\'couteauprive:puceSPIP_aide\');}}', |
---|
810 | )); |
---|
811 | |
---|
812 | add_outil( array( |
---|
813 | 'id' => 'citations_bb', |
---|
814 | 'auteur' => 'Bertrand Marne, Romy Têtue', |
---|
815 | 'categorie' => 'typo-corr', |
---|
816 | 'code:css' => '/* fr */ |
---|
817 | q:lang(fr):before { content: "\00AB\A0"; } |
---|
818 | q:lang(fr):after { content: "\A0\00BB"; } |
---|
819 | q:lang(fr) q:before { content: "\201C"; } |
---|
820 | q:lang(fr) q:after { content: "\201D"; } |
---|
821 | q:lang(fr) q q:before { content: "\2018"; } |
---|
822 | q:lang(fr) q q:after { content: "\2019"; } |
---|
823 | /* IE */ |
---|
824 | * html q { font-style: italic; } |
---|
825 | *+html q { font-style: italic; }', |
---|
826 | 'pipelinecode:pre_propre' => 'if(strpos($flux, "<qu")!==false) $flux=cs_echappe_balises("", "citations_bb_rempl", $flux);', |
---|
827 | // Remplacer <quote> par <q> quand il n'y a pas de retour a la ligne (3 niveaux, preg sans l'option s) |
---|
828 | 'code:options' => 'function citations_bb_rempl($texte){ |
---|
829 | $texte = preg_replace($a="/<quote>(.*?)<\/quote>/", $b="<q>\$1</q>", $texte); |
---|
830 | if(strpos($texte, "<qu")!==false) { |
---|
831 | $texte = preg_replace($a, $b, $texte); |
---|
832 | if(strpos($texte, "<qu")!==false) $texte = preg_replace($a, $b, $texte); |
---|
833 | } |
---|
834 | return $texte; |
---|
835 | }', |
---|
836 | )); |
---|
837 | |
---|
838 | add_variable( array( |
---|
839 | 'nom' => 'decoration_styles', |
---|
840 | 'format' => _format_CHAINE, |
---|
841 | 'lignes' => 8, |
---|
842 | 'defaut' => '"span.sc = font-variant:small-caps; |
---|
843 | span.souligne = text-decoration:underline; |
---|
844 | span.barre = text-decoration:line-through; |
---|
845 | span.dessus = text-decoration:overline; |
---|
846 | span.clignote = text-decoration:blink; |
---|
847 | span.surfluo = background-color:#ffff00; padding:0px 2px; |
---|
848 | span.surgris = background-color:#EAEAEC; padding:0px 2px; |
---|
849 | fluo = surfluo"', |
---|
850 | 'code' => "define('_decoration_BALISES', %s);", |
---|
851 | )); |
---|
852 | add_outil( array( |
---|
853 | 'id' => 'decoration', |
---|
854 | 'auteur' => 'izo@aucuneid.net, Pat', |
---|
855 | 'contrib' => 2427, |
---|
856 | 'categorie' => 'typo-racc', |
---|
857 | 'code:options' => "%%decoration_styles%%", |
---|
858 | 'pipeline:pre_typo' => 'decoration_pre_typo', |
---|
859 | 'pipeline:bt_toolbox' => 'decoration_BarreTypo', |
---|
860 | 'pipeline:porte_plume_barre_pre_charger' => 'decoration_PP_pre_charger', |
---|
861 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'decoration_PP_icones', |
---|
862 | )); |
---|
863 | |
---|
864 | add_variables( array( |
---|
865 | 'nom' => 'couleurs_fonds', |
---|
866 | 'format' => _format_NOMBRE, |
---|
867 | 'radio' => array(1 => 'item_oui', 0 => 'item_non' ), |
---|
868 | 'defaut' => 1, |
---|
869 | 'code' => "define('_COULEURS_FONDS', %s);\n", |
---|
870 | ), array( |
---|
871 | 'nom' => 'set_couleurs', |
---|
872 | 'format' => _format_NOMBRE, |
---|
873 | 'radio' => array(0 => 'couteauprive:toutes_couleurs', 1 => 'couteauprive:certaines_couleurs'), |
---|
874 | 'radio/ligne' => 1, |
---|
875 | 'defaut' => 0, |
---|
876 | 'code' => "define('_COULEURS_SET', %s);\n", |
---|
877 | ), array( |
---|
878 | 'nom' => 'couleurs_perso', |
---|
879 | 'format' => _format_CHAINE, |
---|
880 | 'lignes' => 3, |
---|
881 | 'defaut' => '"gris, rouge"', |
---|
882 | 'code' => "define('_COULEURS_PERSO', %s);", |
---|
883 | )); |
---|
884 | add_outil( array( |
---|
885 | 'id' => 'couleurs', |
---|
886 | 'auteur' => 'Aurélien PIERARD (idée originale), Pat', |
---|
887 | 'categorie' => 'typo-racc', |
---|
888 | 'contrib' => 2427, |
---|
889 | 'pipeline:pre_typo' => 'couleurs_pre_typo', |
---|
890 | 'pipeline:nettoyer_raccourcis_typo' => 'couleurs_nettoyer_raccourcis', |
---|
891 | 'pipeline:bt_toolbox' => 'couleurs_BarreTypo', |
---|
892 | 'pipeline:porte_plume_barre_pre_charger' => 'couleurs_PP_pre_charger', |
---|
893 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'couleurs_PP_icones', |
---|
894 | 'pipeline:pre_description_outil' => 'couleurs_pre_description_outil', |
---|
895 | 'code:options' => "%%couleurs_fonds%%%%set_couleurs%%%%couleurs_perso%%", |
---|
896 | 'code:fonctions' => "// aide le Couteau Suisse a calculer la balise #INTRODUCTION |
---|
897 | include_spip('outils/couleurs'); |
---|
898 | \$GLOBALS['cs_introduire'][] = 'couleurs_nettoyer_raccourcis'; |
---|
899 | ", |
---|
900 | )); |
---|
901 | |
---|
902 | // outil essentiellement français. D'autres langues peuvent etre ajoutees dans outils/typo_exposants.php |
---|
903 | add_variable( array( |
---|
904 | 'nom' => 'expo_bofbof', |
---|
905 | 'format' => _format_NOMBRE, |
---|
906 | 'radio' => array(1 => 'item_oui', 0 => 'item_non' ), |
---|
907 | 'defaut' => 0, |
---|
908 | 'code:%s' => "define('_CS_EXPO_BOFBOF', %s);", |
---|
909 | )); |
---|
910 | add_outil( array( |
---|
911 | 'id' => 'typo_exposants', |
---|
912 | 'auteur' => 'Vincent Ramos, Pat', |
---|
913 | 'categorie' => 'typo-corr', |
---|
914 | 'contrib' => 1564, |
---|
915 | 'code:options' => '%%expo_bofbof%%', |
---|
916 | 'pipeline:post_typo' => 'typo_exposants', |
---|
917 | 'code:css' => 'sup, sup.typo_exposants { font-size:78%; font-variant:inherit; vertical-align:23%; }', |
---|
918 | )); |
---|
919 | |
---|
920 | add_outil( array( |
---|
921 | 'id' => 'guillemets', |
---|
922 | 'auteur' => 'Vincent Ramos', |
---|
923 | 'categorie' => 'typo-corr', |
---|
924 | 'pipeline:post_typo' => 'typo_guillemets', |
---|
925 | )); |
---|
926 | |
---|
927 | add_variables( array( |
---|
928 | 'nom' => 'liens_interrogation', |
---|
929 | 'format' => _format_NOMBRE, |
---|
930 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
931 | 'defaut' => 1, |
---|
932 | 'code:%s' => "\$GLOBALS['liens_interrogation']=true;\n", |
---|
933 | ), array( |
---|
934 | 'nom' => 'liens_orphelins', |
---|
935 | 'format' => _format_NOMBRE, |
---|
936 | 'radio' => array(-1 => 'item_non', 0 => 'couteauprive:basique', 1 => 'couteauprive:etendu', -2 => 'couteauprive:par_defaut'), |
---|
937 | 'defaut' => 0, |
---|
938 | 'code' => '$GLOBALS["liens_orphelins"]=%s;', |
---|
939 | // empeche SPIP de convertir les URLs orphelines (URLs brutes) |
---|
940 | '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']); |
---|
941 | @define('_EXTRAIRE_LIENS',',^\$,');":'', |
---|
942 | ), array( |
---|
943 | 'nom' => 'long_url', |
---|
944 | 'format' => _format_NOMBRE, |
---|
945 | 'defaut' => 40, |
---|
946 | 'code:%s' => "define('_MAX_LONG_URL', %s);", |
---|
947 | ), array( |
---|
948 | 'nom' => 'coupe_url', |
---|
949 | 'format' => _format_NOMBRE, |
---|
950 | 'defaut' => 35, |
---|
951 | 'code:%s' => "define('_MAX_COUPE_URL', %s);", |
---|
952 | ), array( |
---|
953 | )); |
---|
954 | // attention : liens_orphelins doit etre place avant mailcrypt ou liens_en_clair |
---|
955 | add_outil( array( |
---|
956 | 'id' => 'liens_orphelins', |
---|
957 | 'categorie' => 'typo-corr', |
---|
958 | 'contrib' => 2443, |
---|
959 | 'code:options' => '%%liens_interrogation%%', |
---|
960 | 'code:spip_options' => '%%liens_orphelins%%%%long_url%%%%coupe_url%%', |
---|
961 | 'pipeline:pre_propre' => 'liens_orphelins_pipeline', |
---|
962 | 'traitement:EMAIL' => 'expanser_liens(liens_orphelins', |
---|
963 | 'pipeline:pre_typo' => 'interro_pre_typo', |
---|
964 | 'pipeline:post_propre' => 'interro_post_propre', |
---|
965 | 'description' => defined('_SPIP19300')?'<:liens_orphelins::><liens_orphelins valeur="0/1/-2"><:liens_orphelins:1:></liens_orphelins>':'<:liens_orphelins::>', |
---|
966 | )); |
---|
967 | |
---|
968 | add_outil( array( |
---|
969 | 'id' => 'filets_sep', |
---|
970 | 'auteur' => 'FredoMkb', |
---|
971 | 'categorie' => 'typo-racc', |
---|
972 | 'contrib' => 1563, |
---|
973 | 'pipeline:pre_typo' => 'filets_sep', |
---|
974 | 'pipeline:bt_toolbox' => 'filets_sep_BarreTypo', |
---|
975 | 'pipeline:porte_plume_barre_pre_charger' => 'filets_PP_pre_charger', |
---|
976 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'filets_PP_icones', |
---|
977 | )); |
---|
978 | |
---|
979 | add_outil( array( |
---|
980 | 'id' => 'smileys', |
---|
981 | 'auteur' => "Sylvain, Pat", |
---|
982 | 'categorie' => 'typo-corr', |
---|
983 | 'contrib' => 1561, |
---|
984 | 'code:css' => "table.cs_smileys td {text-align:center; font-size:90%; font-weight:bold;}", |
---|
985 | 'pipeline:pre_typo' => 'cs_smileys_pre_typo', |
---|
986 | 'pipeline:bt_toolbox' => 'cs_smileys_BarreTypo', |
---|
987 | 'pipeline:porte_plume_barre_pre_charger' => 'cs_smileys_PP_pre_charger', |
---|
988 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'cs_smileys_PP_icones', |
---|
989 | )); |
---|
990 | |
---|
991 | add_outil( array( |
---|
992 | 'id' => 'chatons', |
---|
993 | 'auteur' => "BoOz, Pat", |
---|
994 | 'categorie' => 'typo-racc', |
---|
995 | 'pipeline:pre_typo' => 'chatons_pre_typo', |
---|
996 | 'pipeline:bt_toolbox' => 'chatons_BarreTypo', |
---|
997 | 'pipeline:porte_plume_barre_pre_charger' => 'chatons_PP_pre_charger', |
---|
998 | 'pipeline:porte_plume_lien_classe_vers_icone' => 'chatons_PP_icones', |
---|
999 | )); |
---|
1000 | |
---|
1001 | add_variables( array( |
---|
1002 | 'nom' => 'glossaire_groupes', |
---|
1003 | 'format' => _format_CHAINE, |
---|
1004 | 'defaut' => "'Glossaire'", |
---|
1005 | 'code' => "\$GLOBALS['glossaire_groupes']=%s;\n", |
---|
1006 | 'commentaire' => defined('_SPIP19300')?'fct_glossaire_groupes(%s); |
---|
1007 | function fct_glossaire_groupes($gr){ |
---|
1008 | $s=""; |
---|
1009 | foreach(explode(":",$gr) as $g) |
---|
1010 | if(!sql_countsel("spip_groupes_mots", "titre="._q($g))) $s.=($s?"<br />":"")._T("couteauprive:erreur_groupe", array("groupe"=>$g)); |
---|
1011 | return $s?"<p style=\"color:red\">$s</p>":""; |
---|
1012 | }':NULL, |
---|
1013 | ), array( |
---|
1014 | 'nom' => 'glossaire_limite', |
---|
1015 | 'format' => _format_NOMBRE, |
---|
1016 | 'defaut' => 0, |
---|
1017 | 'code:%s>0' => "define('_GLOSSAIRE_LIMITE', %s);\n", |
---|
1018 | ), array( |
---|
1019 | 'nom' => 'glossaire_js', |
---|
1020 | 'radio' => array(0 => 'couteauprive:glossaire_css', 1 => 'couteauprive:glossaire_js'), |
---|
1021 | 'format' => _format_NOMBRE, |
---|
1022 | 'defaut' => 1, |
---|
1023 | 'code:%s' => "define('_GLOSSAIRE_JS', %s);", |
---|
1024 | )); |
---|
1025 | add_outil( array( |
---|
1026 | 'id' => 'glossaire', |
---|
1027 | 'categorie' => 'typo-corr', |
---|
1028 | 'contrib' => 2206, |
---|
1029 | 'code:options' => "@define('_CS_SANS_GLOSSAIRE', '[!glossaire]');\n%%glossaire_limite%%%%glossaire_groupes%%%%glossaire_js%%", |
---|
1030 | // 'traitement:LIEU:post_propre' => 'cs_glossaire', |
---|
1031 | // sans oublier les articles, les breves, les forums et les rubriques ! |
---|
1032 | // SPIP ne considere pas que la premiere definition est un tronc commun... |
---|
1033 | // meme traitement au chapo des articles... |
---|
1034 | 'traitement:TEXTE:post_propre, |
---|
1035 | traitement:TEXTE/articles:post_propre, |
---|
1036 | traitement:TEXTE/breves:post_propre, |
---|
1037 | traitement:TEXTE/forums:post_propre, |
---|
1038 | traitement:TEXTE/rubriques:post_propre, |
---|
1039 | traitement:CHAPO:post_propre' => 'cs_glossaire', |
---|
1040 | // Precaution pour les articles virtuels |
---|
1041 | 'traitement:CHAPO:pre_propre' => 'nettoyer_chapo', |
---|
1042 | // Mise en forme des titres |
---|
1043 | 'traitement:TITRE/mots:post_typo' => 'cs_glossaire_titres', |
---|
1044 | 'code:css' => 'a.cs_glossaire:after {display:none;}', |
---|
1045 | // fonction glossaire_init() codee dans glossaire.js : executee lors du chargement de la page et a chaque hit ajax |
---|
1046 | 'code:jq_init' => 'glossaire_init.apply(this);', |
---|
1047 | 'pipelinecode:nettoyer_raccourcis_typo' => '$flux=str_replace(_CS_SANS_GLOSSAIRE, "", $flux);', |
---|
1048 | )); |
---|
1049 | |
---|
1050 | // attention : mailcrypt doit etre place apres liens_orphelins |
---|
1051 | add_outil( array( |
---|
1052 | 'id' => 'mailcrypt', |
---|
1053 | 'categorie' => 'securite', |
---|
1054 | 'auteur' => "Alexis Roussel, Paolo, Pat", |
---|
1055 | 'contrib' => 2443, |
---|
1056 | 'jquery' => 'oui', |
---|
1057 | 'pipelinecode:post_propre' => "if(strpos(\$flux, '@')!==false) \$flux=cs_echappe_balises('', 'mailcrypt', \$flux);", |
---|
1058 | 'code:js' => "function lancerlien(a,b){ x='ma'+'ilto'+':'+a+'@'+b; return x; }", |
---|
1059 | // jQuery pour remplacer l'arobase image par l'arobase texte |
---|
1060 | // ... puis arranger un peu le title qui a ete protege |
---|
1061 | 'code:jq_init' => "jQuery('span.spancrypt', this).attr('class','cryptOK').html(''+'4;'); |
---|
1062 | jQuery(\"a[\"+cs_sel_jQuery+\"title*='..']\", this).each(function () { |
---|
1063 | this.title = this.title.replace(/\.\..t\.\./,'[@]'); |
---|
1064 | });", |
---|
1065 | 'code:css' => 'span.spancrypt {background:transparent url(' . url_absolue(find_in_path('img/mailcrypt/leure.gif')) |
---|
1066 | . ') no-repeat scroll 0.1em center; padding-left:12px; text-decoration:none;}', |
---|
1067 | 'traitement:EMAIL' => 'mailcrypt', |
---|
1068 | )); |
---|
1069 | |
---|
1070 | |
---|
1071 | // attention : liens_en_clair doit etre place apres tous les outils traitant des liens |
---|
1072 | add_outil( array( |
---|
1073 | 'id' => 'liens_en_clair', |
---|
1074 | 'categorie' => 'spip', |
---|
1075 | 'contrib' => 2443, |
---|
1076 | 'pipeline:post_propre' => 'liens_en_clair_post_propre', |
---|
1077 | 'code:css' => 'a.spip_out:after {display:none;}', |
---|
1078 | )); |
---|
1079 | |
---|
1080 | add_variables( array( // variable utilisee par 'pipelinecode:insert_head' |
---|
1081 | 'nom' => 'scrollTo', |
---|
1082 | 'check' => 'couteauprive:jq_scrollTo', |
---|
1083 | 'defaut' => 1, |
---|
1084 | 'format' => _format_NOMBRE, |
---|
1085 | ), array( // variable utilisee par 'pipelinecode:insert_head' |
---|
1086 | 'nom' => 'LocalScroll', |
---|
1087 | 'check' => 'couteauprive:jq_localScroll', |
---|
1088 | 'defaut' => 1, |
---|
1089 | 'format' => _format_NOMBRE, |
---|
1090 | )); |
---|
1091 | add_outil( array( |
---|
1092 | 'id' => 'soft_scroller', |
---|
1093 | 'categorie' => 'public', |
---|
1094 | 'jquery' => 'oui', |
---|
1095 | 'pipelinecode:insert_head' => 'if(%%scrollTo%%) {$flux.=\'<script src="\'.find_in_path("outils/jquery.scrollto.js").\'" type="text/javascript"></script>\'."\n";} |
---|
1096 | if(%%LocalScroll%%) {$flux.=\'<script src="\'.find_in_path("outils/jquery.localscroll.js").\'" type="text/javascript"></script>\'."\n";}', |
---|
1097 | 'code:js' => 'function soft_scroller_init() { if(typeof jQuery.localScroll=="function") jQuery.localScroll({hash: true}); }', |
---|
1098 | 'code:jq_init' => 'soft_scroller_init.apply(this);', |
---|
1099 | )); |
---|
1100 | |
---|
1101 | // http://www.malsup.com/jquery/corner/ |
---|
1102 | add_variables( array( |
---|
1103 | 'nom' => 'jcorner_classes', |
---|
1104 | 'format' => _format_CHAINE, |
---|
1105 | 'lignes' => 10, |
---|
1106 | 'defaut' => defined('_SPIP19300')?'"// coins ronds aux formulaires |
---|
1107 | .formulaire_inscription, .formulaire_forum, .formulaire_ecrire_auteur |
---|
1108 | |
---|
1109 | // colorisation de la dist de SPIP 2.0 en ajoutant un parent |
---|
1110 | \".chapo, .texte\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:#ffe0c0; margin:4px 0;\"><\/div>\') |
---|
1111 | \".menu\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:lightBlue; margin:4px 0;\"><\/div>\') |
---|
1112 | |
---|
1113 | // coins ronds aux parents ! |
---|
1114 | .jc_parent"' |
---|
1115 | :'" // coins ronds pour les menus de navigation |
---|
1116 | .rubriques, .breves, .syndic, .forums, .divers |
---|
1117 | |
---|
1118 | // en couleurs sur l\'accueil |
---|
1119 | .liste-articles li .texte = css(\'background-color\', \'#E0F0F0\') .corner() |
---|
1120 | |
---|
1121 | // colorisation de la dist de SPIP 1.92 en ajoutant un parent |
---|
1122 | \"#contenu .texte\" = wrap(\'<div class=\"jc_parent\" style=\"padding:4px; background-color:#E0F0F0; margin:4px 0;\"><\/div>\') |
---|
1123 | |
---|
1124 | // coins ronds aux parents ! |
---|
1125 | .jc_parent"', |
---|
1126 | 'code' => "define('_jcorner_CLASSES', %s);", |
---|
1127 | ), array( // variable utilisee par 'pipelinecode:insert_head' |
---|
1128 | 'nom' => 'jcorner_plugin', |
---|
1129 | 'check' => 'couteauprive:jcorner_plugin', |
---|
1130 | 'defaut' => 1, |
---|
1131 | 'format' => _format_NOMBRE, |
---|
1132 | )); |
---|
1133 | add_outil( array( |
---|
1134 | 'id' => 'jcorner', |
---|
1135 | 'categorie' => 'public', |
---|
1136 | 'jquery' => 'oui', |
---|
1137 | 'contrib' => 2987, |
---|
1138 | 'code:options' => "%%jcorner_classes%%", |
---|
1139 | // fichier distant pour le plugin jQuery : http://github.com/malsup/corner/commits/ |
---|
1140 | 'distant' => defined('_SPIP20100') |
---|
1141 | // version 2.09 (11-MAR-2010), jQuery v1.3.2 mini |
---|
1142 | ?'http://github.com/malsup/corner/raw/ca8d745fdfe054e1bb62fbd22eca9850c1353e03/jquery.corner.js' |
---|
1143 | // version 2.03 (05-DEC-2009) |
---|
1144 | :'http://github.com/malsup/corner/raw/46bbbc8706853c879c9224b7ebf5f284f726314d/jquery.corner.js', |
---|
1145 | 'pipelinecode:insert_head' => 'if(%%jcorner_plugin%%) {$flux.=\'<script src="\'.find_in_path("lib/jcorner/distant_jquery.corner.js").\'" type="text/javascript"></script>\'."\n";}', |
---|
1146 | 'pipeline:insert_head' => 'jcorner_insert_head', |
---|
1147 | // jcorner_init() n'est disponible qu'en partie publique |
---|
1148 | 'code:jq_init' => 'if(typeof jcorner_init=="function") jcorner_init.apply(this);', |
---|
1149 | )); |
---|
1150 | |
---|
1151 | add_variables( array( |
---|
1152 | 'nom' => 'insertions', |
---|
1153 | 'format' => _format_CHAINE, |
---|
1154 | 'lignes' => 10, |
---|
1155 | 'defaut' => '"oeuf = œuf |
---|
1156 | cceuil = ccueil |
---|
1157 | (a priori) = {a priori} |
---|
1158 | (([hH])uits) = $1uit |
---|
1159 | /([cC]h?)oeur/ = $1œur |
---|
1160 | /oeuvre/ = œuvre |
---|
1161 | (O[Ee]uvre([rs]?)) = Œuvre$1 |
---|
1162 | /\b([cC]|[mM].c|[rR]ec)on+ais+a((?:n(?:ce|te?)|ble)s?)\b/ = $1onnaissa$2 |
---|
1163 | "', |
---|
1164 | 'code' => "define('_insertions_LISTE', %s);", |
---|
1165 | )); |
---|
1166 | add_outil( array( |
---|
1167 | 'id' => 'insertions', |
---|
1168 | 'categorie' => 'typo-corr', |
---|
1169 | 'code:options' => "%%insertions%%", |
---|
1170 | // sans oublier les articles, les breves, les forums et les rubriques ! |
---|
1171 | // SPIP ne considere pas que la premiere definition est un tronc commun : |
---|
1172 | 'traitement:CHAPO:pre_propre, |
---|
1173 | traitement:PS:pre_propre, |
---|
1174 | traitement:TEXTE:pre_propre, |
---|
1175 | traitement:TEXTE/articles:pre_propre, |
---|
1176 | traitement:TEXTE/breves:pre_propre, |
---|
1177 | traitement:TEXTE/forums:post_propre, |
---|
1178 | traitement:TEXTE/rubriques:pre_propre' => 'insertions_pre_propre', |
---|
1179 | )); |
---|
1180 | |
---|
1181 | // le plugin moderation moderee dans le couteau suisse |
---|
1182 | include_spip('inc/charsets'); |
---|
1183 | add_outil( array( |
---|
1184 | 'id' => 'moderation_moderee', |
---|
1185 | 'auteur' => 'Yohann(potter64)', |
---|
1186 | 'categorie' => 'admin', |
---|
1187 | 'version-min' => '1.9300', |
---|
1188 | 'code:options' => '%%moderation_admin%%%%moderation_redac%%%%moderation_visit%%', |
---|
1189 | 'code:jq_init' => 'if(window.location.search.match(/page=forum/)!=null) jQuery("legend:contains(\''.addslashes(unicode2charset(html2unicode(_T('bouton_radio_modere_priori')))).'\')", this).next().html(\''.addslashes(_T('couteauprive:moderation_message')).'\');', |
---|
1190 | 'pipeline:pre_edition' => 'moderation_vip', |
---|
1191 | )); |
---|
1192 | add_variables( array( |
---|
1193 | 'nom' => 'moderation_admin', |
---|
1194 | 'check' => 'couteauprive:moderation_admins', |
---|
1195 | 'defaut' => 1, |
---|
1196 | 'code:%s' => "define('_MOD_MOD_0minirezo',%s);", |
---|
1197 | ), array( |
---|
1198 | 'nom' => 'moderation_redac', |
---|
1199 | 'check' => 'couteauprive:moderation_redacs', |
---|
1200 | 'defaut' => 0, |
---|
1201 | 'code:%s' => "define('_MOD_MOD_1comite',%s);", |
---|
1202 | ), array( |
---|
1203 | 'nom' => 'moderation_visit', |
---|
1204 | 'check' => 'couteauprive:moderation_visits', |
---|
1205 | 'defaut' => 0, |
---|
1206 | 'code:%s' => "define('_MOD_MOD_6forum',%s);", |
---|
1207 | )); |
---|
1208 | |
---|
1209 | add_outil( array( |
---|
1210 | 'id' => 'titre_parent', |
---|
1211 | 'categorie' => 'spip', |
---|
1212 | 'contrib' => 2900, |
---|
1213 | 'code:options' => '%%titres_etendus%%', |
---|
1214 | )); |
---|
1215 | add_variable( array( |
---|
1216 | 'nom' => 'titres_etendus', |
---|
1217 | 'check' => 'couteauprive:titres_etendus', |
---|
1218 | 'format' => _format_NOMBRE, |
---|
1219 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
1220 | 'defaut' => 0, |
---|
1221 | 'code:%s' => "define('_PARENTS_ETENDUS',%s);", |
---|
1222 | )); |
---|
1223 | |
---|
1224 | add_outil( array( |
---|
1225 | 'id' => 'balise_set', |
---|
1226 | 'categorie' => 'spip', |
---|
1227 | )); |
---|
1228 | |
---|
1229 | add_outil( array( |
---|
1230 | 'id' => 'corbeille', |
---|
1231 | 'categorie' => 'admin', |
---|
1232 | 'version-min' => '1.9300', |
---|
1233 | 'code:options' => "%%arret_optimisation%%", |
---|
1234 | )); |
---|
1235 | add_variable( array( |
---|
1236 | 'nom' => 'arret_optimisation', |
---|
1237 | 'format' => _format_NOMBRE, |
---|
1238 | 'radio' => array(1 => 'item_oui', 0 => 'item_non'), |
---|
1239 | 'defaut' => 0, |
---|
1240 | 'code:%s' => "define('_CORBEILLE_SANS_OPTIM', 1); |
---|
1241 | if(!function_exists('genie_optimiser')) { |
---|
1242 | // surcharge de la fonction d'optimisation de SPIP (inc/optimiser.php) |
---|
1243 | function genie_optimiser(\$t='foo'){ include_spip('optimiser','genie'); optimiser_base_une_table(); return -(mktime(2,0,0) + rand(0, 3600*4)); }\n}", |
---|
1244 | )); |
---|
1245 | |
---|
1246 | add_outil( array( |
---|
1247 | 'id' => 'trousse_balises', |
---|
1248 | 'categorie' => 'spip', |
---|
1249 | 'contrib' => 3005, |
---|
1250 | )); |
---|
1251 | |
---|
1252 | add_outil( array( |
---|
1253 | 'id' => 'horloge', |
---|
1254 | 'categorie' => 'spip', |
---|
1255 | 'contrib' => 2998, |
---|
1256 | 'pipelinecode:insert_head, |
---|
1257 | pipelinecode:header_prive' => '$flux.=\'<script type="text/javascript" src="\'.generer_url_public(\'cout_dates.js\',\'lang=\'.$GLOBALS[\'spip_lang\']).\'"></script> |
---|
1258 | <script type="text/javascript" src="\'.find_in_path("outils/jquery.jclock.js").\'"></script>\'."\n";', |
---|
1259 | 'code:jq_init' => 'jclock_init.apply(this);', |
---|
1260 | )); |
---|
1261 | |
---|
1262 | add_outil(defined('_SPIP20100')?array( |
---|
1263 | 'id' => 'maj_auto', |
---|
1264 | 'categorie' => 'securite', |
---|
1265 | 'contrib' => 3223, |
---|
1266 | ):array( |
---|
1267 | 'id' => 'maj_auto', |
---|
1268 | 'categorie' => 'admin', |
---|
1269 | 'version-min' => '1.9300', |
---|
1270 | 'contrib' => 3223, |
---|
1271 | 'distant' => defined('_SPIP20100')?NULL:'http://core.spip.org/projects/spip/repository/raw/branches/spip-2.1/ecrire/genie/mise_a_jour.php', |
---|
1272 | )); |
---|
1273 | |
---|
1274 | // reglage des differents selecteurs en partie privee |
---|
1275 | add_outil( array( |
---|
1276 | 'id' => 'brouteur', |
---|
1277 | 'categorie' => 'interface', |
---|
1278 | 'code:spip_options' => "%%rubrique_brouteur%%%%select_mots_clefs%%%%select_min_auteurs%%%%select_max_auteurs%%" |
---|
1279 | )); |
---|
1280 | add_variable( array( |
---|
1281 | 'nom' => 'rubrique_brouteur', |
---|
1282 | 'format' => _format_NOMBRE, |
---|
1283 | 'defaut' => 20, |
---|
1284 | 'code:%s' => "define('_SPIP_SELECT_RUBRIQUES', %s);" |
---|
1285 | )); |
---|
1286 | add_variable( array( |
---|
1287 | 'nom' => 'select_mots_clefs', |
---|
1288 | 'format' => _format_NOMBRE, |
---|
1289 | 'defaut' => 50, |
---|
1290 | 'code:%s<>50' => "define('_MAX_MOTS_LISTE', %s);" |
---|
1291 | )); |
---|
1292 | add_variable( array( |
---|
1293 | 'nom' => 'select_min_auteurs', |
---|
1294 | 'format' => _format_NOMBRE, |
---|
1295 | 'defaut' => 30, |
---|
1296 | 'code:%s<>30' => "define('_SPIP_SELECT_MIN_AUTEURS', %s);" |
---|
1297 | )); |
---|
1298 | add_variable( array( |
---|
1299 | 'nom' => 'select_max_auteurs', |
---|
1300 | 'format' => _format_NOMBRE, |
---|
1301 | 'defaut' => 30, |
---|
1302 | 'code:%s<>30' => "define('_SPIP_SELECT_MAX_AUTEURS', %s);" |
---|
1303 | )); |
---|
1304 | |
---|
1305 | |
---|
1306 | // Recuperer tous les outils (et leurs variables) de la forme outils/toto_config.xml |
---|
1307 | foreach (find_all_in_path('outils/', '\w+_config\.xml$') as $f) { |
---|
1308 | add_outils_xml($f); |
---|
1309 | } |
---|
1310 | |
---|
1311 | // Recuperer tous les outils de la forme outils/monoutil_config.php |
---|
1312 | // y compris les lames perso dont on met le nom en italiques |
---|
1313 | global $outils; |
---|
1314 | foreach (find_all_in_path('outils/', '\w+_config\.php$') as $f) |
---|
1315 | if(preg_match(',^([^.]*)_config$,', basename($f, '.php'),$regs)){ |
---|
1316 | if($outil = charger_fonction($regs[0], 'outils')) |
---|
1317 | $outil(preg_match(',couteau_suisse/outils/,', $f)); |
---|
1318 | /*else { |
---|
1319 | // compatibilite ... |
---|
1320 | include $f; |
---|
1321 | if(function_exists($cs_temp=$regs[1].'_add_outil')) { |
---|
1322 | $cs_temp = $cs_temp(); |
---|
1323 | $cs_temp['id'] = $regs[1]; |
---|
1324 | add_outil($cs_temp); |
---|
1325 | } |
---|
1326 | }*/ |
---|
1327 | if(isset($outils[$regs[1]]) && strpos($f, '/couteau_suisse/outils/'.$regs[1])===false) |
---|
1328 | $outils[$regs[1]]['perso'] = 1; |
---|
1329 | } |
---|
1330 | |
---|
1331 | // Nettoyage |
---|
1332 | unset($cs_temp); |
---|
1333 | |
---|
1334 | // Ajout des outils personnalises sous forme globale |
---|
1335 | if(isset($GLOBALS['mes_outils'])) { |
---|
1336 | foreach($GLOBALS['mes_outils'] as $id=>$outil) { |
---|
1337 | $outil['id'] = $id; |
---|
1338 | $outil['perso'] = 1; |
---|
1339 | add_outil($outil); |
---|
1340 | } |
---|
1341 | unset($GLOBALS['mes_outils']); |
---|
1342 | } |
---|
1343 | |
---|
1344 | // Idees d'ajouts : |
---|
1345 | // http://archives.rezo.net/spip-core.mbox/ |
---|
1346 | // http://www.spip-contrib.net/Citations |
---|
1347 | // http://www.spip-contrib.net/la-balise-LESMOTS et d'autres balises #MAINTENANT #LESADMINISTRATEURS #LESREDACTEURS #LESVISITEURS |
---|
1348 | // http://www.spip-contrib.net/Ajouter-une-lettrine-aux-articles |
---|
1349 | // http://www.spip-contrib.net/Generation-automatique-de |
---|
1350 | // http://www.spip-contrib.net/Balise-LOGO-ARTICLE-ORITRAD |
---|
1351 | // boutonstexte |
---|
1352 | |
---|
1353 | //global $cs_variables; cs_log($cs_variables, 'cs_variables :'); |
---|
1354 | ?> |
---|