[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / textwheel / wheels / spip / spip.php
1 <?php
2
3 /**
4 * Fonctions utiles pour les wheels SPIP
5 *
6 * @SPIP\Textwheel\Wheel\SPIP\Fonctions
7 **/
8
9 if (!defined('_ECRIRE_INC_VERSION')) {
10 return;
11 }
12
13 include_spip('inc/texte');
14
15 /**
16 * Callback pour les <math></math>
17 * Gestion du TeX
18 *
19 * @param string $t
20 * @return string
21 */
22 function replace_math($t) {
23 if (!function_exists('traiter_math')) {
24 include_spip('inc/math');
25 }
26
27 $t = traiter_math($t, '', true);
28
29 return $t;
30 }
31
32 /**
33 * Callback pour la puce qui est définissable/surchargeable
34 *
35 * @return string
36 * Code HTML d'une puce
37 */
38 function replace_puce() {
39 static $puce;
40 if (!isset($puce)) {
41 $puce = "\n<br />" . definir_puce() . "&nbsp;";
42 }
43
44 return $puce;
45 }
46
47 /**
48 * Callback pour les Abbr
49 *
50 * @example
51 * ```
52 * [ABBR|abbrevation]
53 * [ABBR|abbrevation{lang}]
54 * ```
55 * @param array $m
56 * @return string
57 * Code HTML d'une abréviation
58 */
59 function inserer_abbr($m) {
60 $title = attribut_html($m[2]);
61 $lang = (isset($m[3]) ? " lang=\"" . $m[3] . "\"" : "");
62
63 return "<abbr title=\"$title\"$lang>" . $m[1] . "</abbr>";
64 }