Completed
Push — master ( 62aed1...8add54 )
by cam
01:34
created
ecrire/exec/demande_mise_a_jour.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 
@@ -28,29 +28,29 @@  discard block
 block discarded – undo
28 28
  * Demander à mettre à jour la base de données
29 29
  */
30 30
 function exec_demande_mise_a_jour_dist() {
31
-	// on fait la verif du path avant tout,
32
-	// et l'installation des qu'on est dans la colonne principale
33
-	// si jamais la liste des plugins actifs change, il faut faire un refresh du hit
34
-	// pour etre sur que les bons fichiers seront charges lors de l'install
35
-	include_spip('inc/plugin');
36
-	if (actualise_plugins_actifs()) {
37
-		include_spip('inc/headers');
38
-		redirige_par_entete(self());
39
-	}
31
+    // on fait la verif du path avant tout,
32
+    // et l'installation des qu'on est dans la colonne principale
33
+    // si jamais la liste des plugins actifs change, il faut faire un refresh du hit
34
+    // pour etre sur que les bons fichiers seront charges lors de l'install
35
+    include_spip('inc/plugin');
36
+    if (actualise_plugins_actifs()) {
37
+        include_spip('inc/headers');
38
+        redirige_par_entete(self());
39
+    }
40 40
 
41
-	include_spip('inc/presentation');
42
-	include_spip('inc/filtres_boites');
43
-	$commencer_page = charger_fonction('commencer_page', 'inc');
44
-	echo $commencer_page('', '', '', '', true, false, false);
41
+    include_spip('inc/presentation');
42
+    include_spip('inc/filtres_boites');
43
+    $commencer_page = charger_fonction('commencer_page', 'inc');
44
+    echo $commencer_page('', '', '', '', true, false, false);
45 45
 
46
-	echo debut_grand_cadre();
47
-	echo boite_ouvrir(_T('info_message_technique'), 'notice');
48
-	echo '<p>' . _T('info_procedure_maj_version') . '</p>',
49
-		'<p>' . _T('info_administrateur_site_01') . '</p>';
50
-	echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire('upgrade', 'reinstall=non'));
51
-	echo boite_fermer();
52
-	// masquer les erreurs sql sur cette page car proviennent de la base pas a jour !
53
-	echo '<style type="text/css">#debug-nav {display: none;}</style>';
54
-	echo fin_grand_cadre();
55
-	echo fin_page();
46
+    echo debut_grand_cadre();
47
+    echo boite_ouvrir(_T('info_message_technique'), 'notice');
48
+    echo '<p>' . _T('info_procedure_maj_version') . '</p>',
49
+        '<p>' . _T('info_administrateur_site_01') . '</p>';
50
+    echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire('upgrade', 'reinstall=non'));
51
+    echo boite_fermer();
52
+    // masquer les erreurs sql sur cette page car proviennent de la base pas a jour !
53
+    echo '<style type="text/css">#debug-nav {display: none;}</style>';
54
+    echo fin_grand_cadre();
55
+    echo fin_page();
56 56
 }
Please login to merge, or discard this patch.
ecrire/exec/404.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function exec_404_dist() {
27 27
 
28
-	$exec = _request('exec');
28
+    $exec = _request('exec');
29 29
 
30
-	$titre = "exec_$exec";
31
-	$navigation = '';
32
-	$extra = '';
30
+    $titre = "exec_$exec";
31
+    $navigation = '';
32
+    $extra = '';
33 33
 
34
-	include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
35
-	$commencer_page = charger_fonction('commencer_page', 'inc');
36
-	echo $commencer_page($titre);
34
+    include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
35
+    $commencer_page = charger_fonction('commencer_page', 'inc');
36
+    echo $commencer_page($titre);
37 37
 
38
-	echo debut_gauche();
39
-	echo pipeline('affiche_gauche', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
38
+    echo debut_gauche();
39
+    echo pipeline('affiche_gauche', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
40 40
 
41
-	echo creer_colonne_droite();
42
-	echo pipeline('affiche_droite', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
41
+    echo creer_colonne_droite();
42
+    echo pipeline('affiche_droite', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
43 43
 
44
-	echo debut_droite();
45
-	echo "<h1 class='grostitre'>" . _T('fichier_introuvable', ['fichier' => $exec]) . '</h1>';
46
-	echo pipeline('affiche_milieu', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
44
+    echo debut_droite();
45
+    echo "<h1 class='grostitre'>" . _T('fichier_introuvable', ['fichier' => $exec]) . '</h1>';
46
+    echo pipeline('affiche_milieu', ['args' => ['exec' => '404', 'exec_erreur' => $exec], 'data' => '']);
47 47
 
48
-	echo fin_gauche(), fin_page();
48
+    echo fin_gauche(), fin_page();
49 49
 }
Please login to merge, or discard this patch.
ecrire/exec/403.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -27,40 +27,40 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function exec_403_dist($message = '') {
29 29
 
30
-	$exec = _request('exec');
30
+    $exec = _request('exec');
31 31
 
32
-	$titre = "exec_$exec";
33
-	$navigation = '';
34
-	$extra = '';
32
+    $titre = "exec_$exec";
33
+    $navigation = '';
34
+    $extra = '';
35 35
 
36
-	if (!$message) {
37
-		$message = _T('avis_acces_interdit_prive', ['exec' => _request('exec')]);
38
-	}
36
+    if (!$message) {
37
+        $message = _T('avis_acces_interdit_prive', ['exec' => _request('exec')]);
38
+    }
39 39
 
40
-	$contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
40
+    $contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
41 41
 
42
-	if (_request('var_zajax')) {
43
-		include_spip('inc/actions');
44
-		ajax_retour($contenu);
45
-	} else {
46
-		include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
42
+    if (_request('var_zajax')) {
43
+        include_spip('inc/actions');
44
+        ajax_retour($contenu);
45
+    } else {
46
+        include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
47 47
 
48
-		$commencer_page = charger_fonction('commencer_page', 'inc');
49
-		echo $commencer_page($titre);
48
+        $commencer_page = charger_fonction('commencer_page', 'inc');
49
+        echo $commencer_page($titre);
50 50
 
51
-		echo debut_gauche();
52
-		echo recuperer_fond('prive/squelettes/navigation/dist', []);
53
-		echo pipeline('affiche_gauche', ['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => '']);
51
+        echo debut_gauche();
52
+        echo recuperer_fond('prive/squelettes/navigation/dist', []);
53
+        echo pipeline('affiche_gauche', ['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => '']);
54 54
 
55
-		echo creer_colonne_droite();
56
-		echo pipeline('affiche_droite', ['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => '']);
55
+        echo creer_colonne_droite();
56
+        echo pipeline('affiche_droite', ['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => '']);
57 57
 
58
-		echo debut_droite();
59
-		echo pipeline(
60
-			'affiche_milieu',
61
-			['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => $contenu]
62
-		);
58
+        echo debut_droite();
59
+        echo pipeline(
60
+            'affiche_milieu',
61
+            ['args' => ['exec' => '403', 'exec_erreur' => $exec], 'data' => $contenu]
62
+        );
63 63
 
64
-		echo fin_gauche(), fin_page();
65
-	}
64
+        echo fin_gauche(), fin_page();
65
+    }
66 66
 }
Please login to merge, or discard this patch.
ecrire/inc/presentation.php 1 patch
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Presentation
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 include_spip('inc/presentation_mini');
@@ -31,141 +31,141 @@  discard block
 block discarded – undo
31 31
 include_spip('inc/filtres_alertes');
32 32
 
33 33
 function debut_cadre($style, $icone = '', $fonction = '', $titre = '', $id = '', $class = '', $padding = true) {
34
-	$fond = null;
35
-	$style_mapping = [
36
-		'r' => 'simple',
37
-		'e' => 'raccourcis',
38
-		'couleur' => 'basic highlight',
39
-		'couleur-foncee' => 'basic highlight',
40
-		'trait-couleur' => 'important',
41
-		'alerte' => 'notice',
42
-		'info' => 'info',
43
-		'sous_rub' => 'simple sous-rub'
44
-	];
45
-	$style_titre_mapping = ['couleur' => 'topper', 'trait-couleur' => 'section'];
46
-	$c = $style_mapping[$style] ?? 'simple';
47
-	$class = $c . ($class ? " $class" : '');
48
-	if (!$padding) {
49
-		$class .= ($class ? ' ' : '') . 'no-padding';
50
-	}
51
-
52
-	//($id?"id='$id' ":"")
53
-	if (strlen($icone) > 1) {
54
-		if ($icone_renommer = charger_fonction('icone_renommer', 'inc', true)) {
55
-			[$fond, $fonction] = $icone_renommer($icone, $fonction);
56
-		}
57
-		$size = 24;
58
-		if (preg_match('/-([0-9]{1,3})[.](gif|png)$/i', $fond, $match)) {
59
-			$size = $match[1];
60
-		}
61
-		if ($fonction) {
62
-			// 2 images pour composer l'icone : le fond (article) en background,
63
-			// la fonction (new) en image
64
-			$icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n" .
65
-				http_style_background($fond, 'no-repeat center center', $size));
66
-		} else {
67
-			$icone = http_img_pack($fond, '', "class='cadre-icone' width='$size' height='$size'");
68
-		}
69
-		$titre = $icone . $titre;
70
-	}
71
-
72
-	return boite_ouvrir($titre, $class, $style_titre_mapping[$style] ?? '', $id);
34
+    $fond = null;
35
+    $style_mapping = [
36
+        'r' => 'simple',
37
+        'e' => 'raccourcis',
38
+        'couleur' => 'basic highlight',
39
+        'couleur-foncee' => 'basic highlight',
40
+        'trait-couleur' => 'important',
41
+        'alerte' => 'notice',
42
+        'info' => 'info',
43
+        'sous_rub' => 'simple sous-rub'
44
+    ];
45
+    $style_titre_mapping = ['couleur' => 'topper', 'trait-couleur' => 'section'];
46
+    $c = $style_mapping[$style] ?? 'simple';
47
+    $class = $c . ($class ? " $class" : '');
48
+    if (!$padding) {
49
+        $class .= ($class ? ' ' : '') . 'no-padding';
50
+    }
51
+
52
+    //($id?"id='$id' ":"")
53
+    if (strlen($icone) > 1) {
54
+        if ($icone_renommer = charger_fonction('icone_renommer', 'inc', true)) {
55
+            [$fond, $fonction] = $icone_renommer($icone, $fonction);
56
+        }
57
+        $size = 24;
58
+        if (preg_match('/-([0-9]{1,3})[.](gif|png)$/i', $fond, $match)) {
59
+            $size = $match[1];
60
+        }
61
+        if ($fonction) {
62
+            // 2 images pour composer l'icone : le fond (article) en background,
63
+            // la fonction (new) en image
64
+            $icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n" .
65
+                http_style_background($fond, 'no-repeat center center', $size));
66
+        } else {
67
+            $icone = http_img_pack($fond, '', "class='cadre-icone' width='$size' height='$size'");
68
+        }
69
+        $titre = $icone . $titre;
70
+    }
71
+
72
+    return boite_ouvrir($titre, $class, $style_titre_mapping[$style] ?? '', $id);
73 73
 }
74 74
 
75 75
 function fin_cadre() {
76
- return boite_fermer();
76
+    return boite_fermer();
77 77
 }
78 78
 
79 79
 
80 80
 function debut_cadre_relief(
81
-	$icone = '',
82
-	$dummy = '',
83
-	$fonction = '',
84
-	$titre = '',
85
-	$id = '',
86
-	$class = ''
81
+    $icone = '',
82
+    $dummy = '',
83
+    $fonction = '',
84
+    $titre = '',
85
+    $id = '',
86
+    $class = ''
87 87
 ) {
88
-	return debut_cadre('r', $icone, $fonction, $titre, $id, $class);
88
+    return debut_cadre('r', $icone, $fonction, $titre, $id, $class);
89 89
 }
90 90
 
91 91
 function fin_cadre_relief() {
92
- return fin_cadre();
92
+    return fin_cadre();
93 93
 }
94 94
 
95 95
 function debut_cadre_enfonce(
96
-	$icone = '',
97
-	$dummy = '',
98
-	$fonction = '',
99
-	$titre = '',
100
-	$id = '',
101
-	$class = ''
96
+    $icone = '',
97
+    $dummy = '',
98
+    $fonction = '',
99
+    $titre = '',
100
+    $id = '',
101
+    $class = ''
102 102
 ) {
103
-	return debut_cadre('e', $icone, $fonction, $titre, $id, $class);
103
+    return debut_cadre('e', $icone, $fonction, $titre, $id, $class);
104 104
 }
105 105
 
106 106
 function fin_cadre_enfonce() {
107
- return fin_cadre();
107
+    return fin_cadre();
108 108
 }
109 109
 
110 110
 function debut_cadre_sous_rub(
111
-	$icone = '',
112
-	$dummy = '',
113
-	$fonction = '',
114
-	$titre = '',
115
-	$id = '',
116
-	$class = ''
111
+    $icone = '',
112
+    $dummy = '',
113
+    $fonction = '',
114
+    $titre = '',
115
+    $id = '',
116
+    $class = ''
117 117
 ) {
118
-	return debut_cadre('sous_rub', $icone, $fonction, $titre, $id, $class);
118
+    return debut_cadre('sous_rub', $icone, $fonction, $titre, $id, $class);
119 119
 }
120 120
 
121 121
 function fin_cadre_sous_rub() {
122
- return fin_cadre();
122
+    return fin_cadre();
123 123
 }
124 124
 
125 125
 function debut_cadre_couleur(
126
-	$icone = '',
127
-	$dummy = '',
128
-	$fonction = '',
129
-	$titre = '',
130
-	$id = '',
131
-	$class = ''
126
+    $icone = '',
127
+    $dummy = '',
128
+    $fonction = '',
129
+    $titre = '',
130
+    $id = '',
131
+    $class = ''
132 132
 ) {
133
-	return debut_cadre('couleur', $icone, $fonction, $titre, $id, $class);
133
+    return debut_cadre('couleur', $icone, $fonction, $titre, $id, $class);
134 134
 }
135 135
 
136 136
 function fin_cadre_couleur() {
137
- return fin_cadre();
137
+    return fin_cadre();
138 138
 }
139 139
 
140 140
 function debut_cadre_trait_couleur(
141
-	$icone = '',
142
-	$dummy = '',
143
-	$fonction = '',
144
-	$titre = '',
145
-	$id = '',
146
-	$class = ''
141
+    $icone = '',
142
+    $dummy = '',
143
+    $fonction = '',
144
+    $titre = '',
145
+    $id = '',
146
+    $class = ''
147 147
 ) {
148
-	return debut_cadre('trait-couleur', $icone, $fonction, $titre, $id, $class);
148
+    return debut_cadre('trait-couleur', $icone, $fonction, $titre, $id, $class);
149 149
 }
150 150
 
151 151
 function fin_cadre_trait_couleur() {
152
- return fin_cadre();
152
+    return fin_cadre();
153 153
 }
154 154
 
155 155
 function debut_boite_alerte() {
156
- return debut_cadre('alerte', '', '', '', '', '');
156
+    return debut_cadre('alerte', '', '', '', '', '');
157 157
 }
158 158
 
159 159
 function fin_boite_alerte() {
160
- return fin_cadre();
160
+    return fin_cadre();
161 161
 }
162 162
 
163 163
 function debut_boite_info() {
164
- return debut_cadre('info', '', '', '', '', '');
164
+    return debut_cadre('info', '', '', '', '', '');
165 165
 }
166 166
 
167 167
 function fin_boite_info() {
168
- return fin_cadre();
168
+    return fin_cadre();
169 169
 }
170 170
 
171 171
 /**
@@ -176,17 +176,17 @@  discard block
 block discarded – undo
176 176
  * @return string Code PHP.
177 177
  **/
178 178
 function gros_titre(
179
-	$titre,
180
-	$ze_logo = ''
179
+    $titre,
180
+    $ze_logo = ''
181 181
 ) {
182
-	return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n";
182
+    return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n";
183 183
 }
184 184
 
185 185
 // La boite des raccourcis
186 186
 // Se place a droite si l'ecran est en mode panoramique.
187 187
 function bloc_des_raccourcis($bloc) {
188
-	return creer_colonne_droite()
189
-	. boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer();
188
+    return creer_colonne_droite()
189
+    . boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer();
190 190
 }
191 191
 
192 192
 //
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
 // Fonctions onglets
197 197
 // @param string $sous_classe	prend la valeur second pour definir les onglet de deuxieme niveau
198 198
 function debut_onglet($classe = 'barre_onglet') {
199
- return "<div class = '$classe clearfix'><ul>\n";
199
+    return "<div class = '$classe clearfix'><ul>\n";
200 200
 }
201 201
 
202 202
 function fin_onglet() {
203
- return "</ul></div>\n";
203
+    return "</ul></div>\n";
204 204
 }
205 205
 
206 206
 function onglet($texte, $lien, $onglet_ref, $onglet, $icone = '') {
207
-	return '<li>'
208
-	. ($icone ? http_img_pack($icone, '', " class='cadre-icone'") : '')
209
-	. lien_ou_expose($lien, $texte, $onglet == $onglet_ref)
210
-	. '</li>';
207
+    return '<li>'
208
+    . ($icone ? http_img_pack($icone, '', " class='cadre-icone'") : '')
209
+    . lien_ou_expose($lien, $texte, $onglet == $onglet_ref)
210
+    . '</li>';
211 211
 }
212 212
 
213 213
 /**
@@ -239,14 +239,14 @@  discard block
 block discarded – undo
239 239
  *     Code HTML du lien
240 240
  **/
241 241
 function icone_verticale($texte, $lien, $fond, $fonction = '', $align = '', $javascript = '') {
242
-	// cas d'ajax_action_auteur: faut defaire le boulot
243
-	// (il faudrait fusionner avec le cas $javascript)
244
-	if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i", $lien, $r)) {
245
-		[$x, $lien, $atts, $texte] = $r;
246
-		$javascript .= $atts;
247
-	}
248
-
249
-	return icone_base($lien, $texte, $fond, $fonction, "verticale $align", $javascript);
242
+    // cas d'ajax_action_auteur: faut defaire le boulot
243
+    // (il faudrait fusionner avec le cas $javascript)
244
+    if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i", $lien, $r)) {
245
+        [$x, $lien, $atts, $texte] = $r;
246
+        $javascript .= $atts;
247
+    }
248
+
249
+    return icone_base($lien, $texte, $fond, $fonction, "verticale $align", $javascript);
250 250
 }
251 251
 
252 252
 /**
@@ -271,15 +271,15 @@  discard block
 block discarded – undo
271 271
  *     Code HTML du lien
272 272
  **/
273 273
 function icone_horizontale($texte, $lien, $fond, $fonction = '', $dummy = '', $javascript = '') {
274
-	$retour = '';
275
-	// cas d'ajax_action_auteur: faut defaire le boulot
276
-	// (il faudrait fusionner avec le cas $javascript)
277
-	if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i", $lien, $r)) {
278
-		[$x, $lien, $atts, $texte] = $r;
279
-		$javascript .= $atts;
280
-	}
274
+    $retour = '';
275
+    // cas d'ajax_action_auteur: faut defaire le boulot
276
+    // (il faudrait fusionner avec le cas $javascript)
277
+    if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i", $lien, $r)) {
278
+        [$x, $lien, $atts, $texte] = $r;
279
+        $javascript .= $atts;
280
+    }
281 281
 
282
-	$retour = icone_base($lien, $texte, $fond, $fonction, 'horizontale', $javascript);
282
+    $retour = icone_base($lien, $texte, $fond, $fonction, 'horizontale', $javascript);
283 283
 
284
-	return $retour;
284
+    return $retour;
285 285
 }
Please login to merge, or discard this patch.
ecrire/inc/json.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 // Les fonctions de toggg pour faire du JSON
@@ -25,63 +25,63 @@  discard block
 block discarded – undo
25 25
  */
26 26
 
27 27
 function var2js($var) {
28
-	$asso = false;
29
-	switch (true) {
30
-		case is_null($var):
31
-			return 'null';
32
-		case is_string($var):
33
-			return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
-		case is_bool($var):
35
-			return $var ? 'true' : 'false';
36
-		case is_scalar($var):
37
-			return (string)$var;
38
-		case is_object($var):// blam
39
-			$var = get_object_vars($var);
40
-			$asso = true;
41
-			// $var devient un array, on continue
42
-		case is_array($var):
43
-			$keys = array_keys($var);
44
-			$ikey = count($keys);
45
-			while (!$asso && $ikey--) {
46
-				$asso = $ikey !== $keys[$ikey];
47
-			}
48
-			$sep = '';
49
-			if ($asso) {
50
-				$ret = '{';
51
-				foreach ($var as $key => $elt) {
52
-					$ret .= $sep . '"' . $key . '":' . var2js($elt);
53
-					$sep = ',';
54
-				}
28
+    $asso = false;
29
+    switch (true) {
30
+        case is_null($var):
31
+            return 'null';
32
+        case is_string($var):
33
+            return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
+        case is_bool($var):
35
+            return $var ? 'true' : 'false';
36
+        case is_scalar($var):
37
+            return (string)$var;
38
+        case is_object($var):// blam
39
+            $var = get_object_vars($var);
40
+            $asso = true;
41
+            // $var devient un array, on continue
42
+        case is_array($var):
43
+            $keys = array_keys($var);
44
+            $ikey = count($keys);
45
+            while (!$asso && $ikey--) {
46
+                $asso = $ikey !== $keys[$ikey];
47
+            }
48
+            $sep = '';
49
+            if ($asso) {
50
+                $ret = '{';
51
+                foreach ($var as $key => $elt) {
52
+                    $ret .= $sep . '"' . $key . '":' . var2js($elt);
53
+                    $sep = ',';
54
+                }
55 55
 
56
-				return $ret . '}';
57
-			} else {
58
-				$ret = '[';
59
-				foreach ($var as $elt) {
60
-					$ret .= $sep . var2js($elt);
61
-					$sep = ',';
62
-				}
56
+                return $ret . '}';
57
+            } else {
58
+                $ret = '[';
59
+                foreach ($var as $elt) {
60
+                    $ret .= $sep . var2js($elt);
61
+                    $sep = ',';
62
+                }
63 63
 
64
-				return $ret . ']';
65
-			}
66
-	}
64
+                return $ret . ']';
65
+            }
66
+    }
67 67
 
68
-	return false;
68
+    return false;
69 69
 }
70 70
 
71 71
 if (!function_exists('json_encode')) {
72
-	function json_encode($v) {
73
-		return var2js($v);
74
-	}
72
+    function json_encode($v) {
73
+        return var2js($v);
74
+    }
75 75
 }
76 76
 
77 77
 function json_export($var) {
78
-	$var = json_encode($var, JSON_THROW_ON_ERROR);
78
+    $var = json_encode($var, JSON_THROW_ON_ERROR);
79 79
 
80
-	// flag indiquant qu'on est en iframe et qu'il faut proteger nos
81
-	// donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
82
-	if (defined('FILE_UPLOAD')) {
83
-		return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
84
-	} else {
85
-		return $var;
86
-	}
80
+    // flag indiquant qu'on est en iframe et qu'il faut proteger nos
81
+    // donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
82
+    if (defined('FILE_UPLOAD')) {
83
+        return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
84
+    } else {
85
+        return $var;
86
+    }
87 87
 }
Please login to merge, or discard this patch.
ecrire/charsets/translit.php 1 patch
Indentation   +358 added lines, -358 removed lines patch added patch discarded remove patch
@@ -9,384 +9,384 @@
 block discarded – undo
9 9
 
10 10
 $GLOBALS['CHARSET']['translit'] = [
11 11
 // latin [fausse plage]
12
-	128 => 'EUR',
13
-	131 => 'f',
14
-	140 => 'OE',
15
-	147 => '\'\'',
16
-	148 => '\'\'',
17
-	153 => '(TM)',
18
-	156 => 'oe',
19
-	159 => 'Y',
12
+    128 => 'EUR',
13
+    131 => 'f',
14
+    140 => 'OE',
15
+    147 => '\'\'',
16
+    148 => '\'\'',
17
+    153 => '(TM)',
18
+    156 => 'oe',
19
+    159 => 'Y',
20 20
 
21 21
 // latin [legal]
22
-	160 => ' ',
23
-	161 => '!',
24
-	162 => 'c',
25
-	163 => 'L',
26
-	164 => 'O',
27
-	165 => 'yen',
28
-	166 => '|',
29
-	167 => 'p',
30
-	169 => '(c)',
31
-	171 => '<<',
32
-	172 => '-',
33
-	173 => '-',
34
-	174 => '(R)',
35
-	176 => 'o',
36
-	177 => '+-',
37
-	181 => 'mu',
38
-	182 => 'p',
39
-	183 => '.',
40
-	186 => 'o ',
41
-	187 => '>>',
42
-	191 => '?',
43
-	192 => 'A',
44
-	193 => 'A',
45
-	194 => 'A',
46
-	195 => 'A',
47
-	196 => 'A',
48
-	197 => 'A',
49
-	198 => 'AE',
50
-	199 => 'C',
51
-	200 => 'E',
52
-	201 => 'E',
53
-	202 => 'E',
54
-	203 => 'E',
55
-	204 => 'I',
56
-	205 => 'I',
57
-	206 => 'I',
58
-	207 => 'I',
59
-	209 => 'N',
60
-	210 => 'O',
61
-	211 => 'O',
62
-	212 => 'O',
63
-	213 => 'O',
64
-	214 => 'O',
65
-	216 => 'O',
66
-	217 => 'U',
67
-	218 => 'U',
68
-	219 => 'U',
69
-	220 => 'U',
70
-	223 => 'ss',
71
-	224 => 'a',
72
-	225 => 'a',
73
-	226 => 'a',
74
-	227 => 'a',
75
-	228 => 'a',
76
-	229 => 'a',
77
-	230 => 'ae',
78
-	231 => 'c',
79
-	232 => 'e',
80
-	233 => 'e',
81
-	234 => 'e',
82
-	235 => 'e',
83
-	236 => 'i',
84
-	237 => 'i',
85
-	238 => 'i',
86
-	239 => 'i',
87
-	241 => 'n',
88
-	242 => 'o',
89
-	243 => 'o',
90
-	244 => 'o',
91
-	245 => 'o',
92
-	246 => 'o',
93
-	248 => 'o',
94
-	249 => 'u',
95
-	250 => 'u',
96
-	251 => 'u',
97
-	252 => 'u',
98
-	255 => 'y',
22
+    160 => ' ',
23
+    161 => '!',
24
+    162 => 'c',
25
+    163 => 'L',
26
+    164 => 'O',
27
+    165 => 'yen',
28
+    166 => '|',
29
+    167 => 'p',
30
+    169 => '(c)',
31
+    171 => '<<',
32
+    172 => '-',
33
+    173 => '-',
34
+    174 => '(R)',
35
+    176 => 'o',
36
+    177 => '+-',
37
+    181 => 'mu',
38
+    182 => 'p',
39
+    183 => '.',
40
+    186 => 'o ',
41
+    187 => '>>',
42
+    191 => '?',
43
+    192 => 'A',
44
+    193 => 'A',
45
+    194 => 'A',
46
+    195 => 'A',
47
+    196 => 'A',
48
+    197 => 'A',
49
+    198 => 'AE',
50
+    199 => 'C',
51
+    200 => 'E',
52
+    201 => 'E',
53
+    202 => 'E',
54
+    203 => 'E',
55
+    204 => 'I',
56
+    205 => 'I',
57
+    206 => 'I',
58
+    207 => 'I',
59
+    209 => 'N',
60
+    210 => 'O',
61
+    211 => 'O',
62
+    212 => 'O',
63
+    213 => 'O',
64
+    214 => 'O',
65
+    216 => 'O',
66
+    217 => 'U',
67
+    218 => 'U',
68
+    219 => 'U',
69
+    220 => 'U',
70
+    223 => 'ss',
71
+    224 => 'a',
72
+    225 => 'a',
73
+    226 => 'a',
74
+    227 => 'a',
75
+    228 => 'a',
76
+    229 => 'a',
77
+    230 => 'ae',
78
+    231 => 'c',
79
+    232 => 'e',
80
+    233 => 'e',
81
+    234 => 'e',
82
+    235 => 'e',
83
+    236 => 'i',
84
+    237 => 'i',
85
+    238 => 'i',
86
+    239 => 'i',
87
+    241 => 'n',
88
+    242 => 'o',
89
+    243 => 'o',
90
+    244 => 'o',
91
+    245 => 'o',
92
+    246 => 'o',
93
+    248 => 'o',
94
+    249 => 'u',
95
+    250 => 'u',
96
+    251 => 'u',
97
+    252 => 'u',
98
+    255 => 'y',
99 99
 
100 100
 // turc
101
-	286 => 'G',
102
-	287 => 'g',
103
-	304 => 'I',
104
-	305 => 'i',
101
+    286 => 'G',
102
+    287 => 'g',
103
+    304 => 'I',
104
+    305 => 'i',
105 105
 
106 106
 // esperanto
107
-	264 => 'Cx',
108
-	265 => 'cx',
109
-	284 => 'Gx',
110
-	285 => 'gx',
111
-	292 => 'Hx',
112
-	293 => 'hx',
113
-	308 => 'Jx',
114
-	309 => 'jx',
115
-	348 => 'Sx',
116
-	349 => 'sx',
117
-	364 => 'Ux',
118
-	365 => 'ux',
107
+    264 => 'Cx',
108
+    265 => 'cx',
109
+    284 => 'Gx',
110
+    285 => 'gx',
111
+    292 => 'Hx',
112
+    293 => 'hx',
113
+    308 => 'Jx',
114
+    309 => 'jx',
115
+    348 => 'Sx',
116
+    349 => 'sx',
117
+    364 => 'Ux',
118
+    365 => 'ux',
119 119
 
120 120
 
121 121
 // latin2 [Czech]
122
-	283 => 'e',
123
-	353 => 's',
124
-	269 => 'c',
125
-	345 => 'r',
126
-	382 => 'z',
127
-	367 => 'u',
128
-	328 => 'n',
129
-	357 => 't',
130
-	271 => 'd',
131
-	449 => 'o',
132
-	282 => 'E',
133
-	352 => 'S',
134
-	268 => 'C',
135
-	344 => 'R',
136
-	381 => 'Z',
137
-	366 => 'U',
138
-	327 => 'N',
139
-	356 => 'T',
140
-	270 => 'D',
141
-	467 => 'O',
122
+    283 => 'e',
123
+    353 => 's',
124
+    269 => 'c',
125
+    345 => 'r',
126
+    382 => 'z',
127
+    367 => 'u',
128
+    328 => 'n',
129
+    357 => 't',
130
+    271 => 'd',
131
+    449 => 'o',
132
+    282 => 'E',
133
+    352 => 'S',
134
+    268 => 'C',
135
+    344 => 'R',
136
+    381 => 'Z',
137
+    366 => 'U',
138
+    327 => 'N',
139
+    356 => 'T',
140
+    270 => 'D',
141
+    467 => 'O',
142 142
 
143 143
 // francais
144
-	338 => 'OE',
145
-	339 => 'oe',
146
-	376 => 'Y',
147
-	402 => 'f',
144
+    338 => 'OE',
145
+    339 => 'oe',
146
+    376 => 'Y',
147
+    402 => 'f',
148 148
 
149 149
 //polskie
150
-	260 => 'A',
151
-	261 => 'a',
152
-	262 => 'C',
153
-	263 => 'c',
154
-	280 => 'E',
155
-	281 => 'e',
156
-	321 => 'L',
157
-	322 => 'l',
158
-	323 => 'N',
159
-	324 => 'n',
160
-	346 => 'S',
161
-	347 => 's',
162
-	377 => 'Z',
163
-	378 => 'z',
164
-	379 => 'Z',
165
-	380 => 'z',
150
+    260 => 'A',
151
+    261 => 'a',
152
+    262 => 'C',
153
+    263 => 'c',
154
+    280 => 'E',
155
+    281 => 'e',
156
+    321 => 'L',
157
+    322 => 'l',
158
+    323 => 'N',
159
+    324 => 'n',
160
+    346 => 'S',
161
+    347 => 's',
162
+    377 => 'Z',
163
+    378 => 'z',
164
+    379 => 'Z',
165
+    380 => 'z',
166 166
 
167 167
 //roumain
168
-	258 => 'A',
169
-	259 => 'a',
170
-	354 => 'T',
171
-	355 => 't',
168
+    258 => 'A',
169
+    259 => 'a',
170
+    354 => 'T',
171
+    355 => 't',
172 172
 
173 173
 //turc & roumain
174
-	350 => 'S',
175
-	351 => 's',
174
+    350 => 'S',
175
+    351 => 's',
176 176
 
177 177
 // cyrillique
178
-	1026 => 'D%',
179
-	1027 => 'G%',
180
-	8218 => '\'',
181
-	1107 => 'g%',
182
-	8222 => '"',
183
-	8230 => '...',
184
-	8224 => '/-',
185
-	8225 => '/=',
186
-	8364 => 'EUR',
187
-	8240 => '0/00',
188
-	1033 => 'LJ',
189
-	8249 => '<',
190
-	1034 => 'NJ',
191
-	1036 => 'KJ',
192
-	1035 => 'Ts',
193
-	1039 => 'DZ',
194
-	1106 => 'd%',
195
-	8216 => '`',
196
-	8217 => '\'',
197
-	8220 => '"',
198
-	8221 => '"',
199
-	8226 => ' o ',
200
-	8211 => '-',
201
-	8212 => '~',
202
-	8482 => '(TM)',
203
-	1113 => 'lj',
204
-	8250 => '>',
205
-	1114 => 'nj',
206
-	1116 => 'kj',
207
-	1115 => 'ts',
208
-	1119 => 'dz',
209
-	1038 => 'V%',
210
-	1118 => 'v%',
211
-	1032 => 'J%',
212
-	1168 => 'G3',
213
-	1025 => 'IO',
214
-	1028 => 'IE',
215
-	1031 => 'YI',
216
-	1030 => 'II',
217
-	1110 => 'ii',
218
-	1169 => 'g3',
219
-	1105 => 'io',
220
-	8470 => 'No.',
221
-	1108 => 'ie',
222
-	1112 => 'j%',
223
-	1029 => 'DS',
224
-	1109 => 'ds',
225
-	1111 => 'yi',
226
-	1040 => 'A',
227
-	1041 => 'B',
228
-	1042 => 'V',
229
-	1043 => 'G',
230
-	1044 => 'D',
231
-	1045 => 'E',
232
-	1046 => 'ZH',
233
-	1047 => 'Z',
234
-	1048 => 'I',
235
-	1049 => 'J',
236
-	1050 => 'K',
237
-	1051 => 'L',
238
-	1052 => 'M',
239
-	1053 => 'N',
240
-	1054 => 'O',
241
-	1055 => 'P',
242
-	1056 => 'R',
243
-	1057 => 'S',
244
-	1058 => 'T',
245
-	1059 => 'U',
246
-	1060 => 'F',
247
-	1061 => 'H',
248
-	1062 => 'C',
249
-	1063 => 'CH',
250
-	1064 => 'SH',
251
-	1065 => 'SCH',
252
-	1066 => '"',
253
-	1067 => 'Y',
254
-	1068 => '\'',
255
-	1069 => '`E',
256
-	1070 => 'YU',
257
-	1071 => 'YA',
258
-	1072 => 'a',
259
-	1073 => 'b',
260
-	1074 => 'v',
261
-	1075 => 'g',
262
-	1076 => 'd',
263
-	1077 => 'e',
264
-	1078 => 'zh',
265
-	1079 => 'z',
266
-	1080 => 'i',
267
-	1081 => 'j',
268
-	1082 => 'k',
269
-	1083 => 'l',
270
-	1084 => 'm',
271
-	1085 => 'n',
272
-	1086 => 'o',
273
-	1087 => 'p',
274
-	1088 => 'r',
275
-	1089 => 's',
276
-	1090 => 't',
277
-	1091 => 'u',
278
-	1092 => 'f',
279
-	1093 => 'h',
280
-	1094 => 'c',
281
-	1095 => 'ch',
282
-	1096 => 'sh',
283
-	1097 => 'sch',
284
-	1098 => '"',
285
-	1099 => 'y',
286
-	1100 => '\'',
287
-	1101 => '`e',
288
-	1102 => 'yu',
289
-	1103 => 'ya',
178
+    1026 => 'D%',
179
+    1027 => 'G%',
180
+    8218 => '\'',
181
+    1107 => 'g%',
182
+    8222 => '"',
183
+    8230 => '...',
184
+    8224 => '/-',
185
+    8225 => '/=',
186
+    8364 => 'EUR',
187
+    8240 => '0/00',
188
+    1033 => 'LJ',
189
+    8249 => '<',
190
+    1034 => 'NJ',
191
+    1036 => 'KJ',
192
+    1035 => 'Ts',
193
+    1039 => 'DZ',
194
+    1106 => 'd%',
195
+    8216 => '`',
196
+    8217 => '\'',
197
+    8220 => '"',
198
+    8221 => '"',
199
+    8226 => ' o ',
200
+    8211 => '-',
201
+    8212 => '~',
202
+    8482 => '(TM)',
203
+    1113 => 'lj',
204
+    8250 => '>',
205
+    1114 => 'nj',
206
+    1116 => 'kj',
207
+    1115 => 'ts',
208
+    1119 => 'dz',
209
+    1038 => 'V%',
210
+    1118 => 'v%',
211
+    1032 => 'J%',
212
+    1168 => 'G3',
213
+    1025 => 'IO',
214
+    1028 => 'IE',
215
+    1031 => 'YI',
216
+    1030 => 'II',
217
+    1110 => 'ii',
218
+    1169 => 'g3',
219
+    1105 => 'io',
220
+    8470 => 'No.',
221
+    1108 => 'ie',
222
+    1112 => 'j%',
223
+    1029 => 'DS',
224
+    1109 => 'ds',
225
+    1111 => 'yi',
226
+    1040 => 'A',
227
+    1041 => 'B',
228
+    1042 => 'V',
229
+    1043 => 'G',
230
+    1044 => 'D',
231
+    1045 => 'E',
232
+    1046 => 'ZH',
233
+    1047 => 'Z',
234
+    1048 => 'I',
235
+    1049 => 'J',
236
+    1050 => 'K',
237
+    1051 => 'L',
238
+    1052 => 'M',
239
+    1053 => 'N',
240
+    1054 => 'O',
241
+    1055 => 'P',
242
+    1056 => 'R',
243
+    1057 => 'S',
244
+    1058 => 'T',
245
+    1059 => 'U',
246
+    1060 => 'F',
247
+    1061 => 'H',
248
+    1062 => 'C',
249
+    1063 => 'CH',
250
+    1064 => 'SH',
251
+    1065 => 'SCH',
252
+    1066 => '"',
253
+    1067 => 'Y',
254
+    1068 => '\'',
255
+    1069 => '`E',
256
+    1070 => 'YU',
257
+    1071 => 'YA',
258
+    1072 => 'a',
259
+    1073 => 'b',
260
+    1074 => 'v',
261
+    1075 => 'g',
262
+    1076 => 'd',
263
+    1077 => 'e',
264
+    1078 => 'zh',
265
+    1079 => 'z',
266
+    1080 => 'i',
267
+    1081 => 'j',
268
+    1082 => 'k',
269
+    1083 => 'l',
270
+    1084 => 'm',
271
+    1085 => 'n',
272
+    1086 => 'o',
273
+    1087 => 'p',
274
+    1088 => 'r',
275
+    1089 => 's',
276
+    1090 => 't',
277
+    1091 => 'u',
278
+    1092 => 'f',
279
+    1093 => 'h',
280
+    1094 => 'c',
281
+    1095 => 'ch',
282
+    1096 => 'sh',
283
+    1097 => 'sch',
284
+    1098 => '"',
285
+    1099 => 'y',
286
+    1100 => '\'',
287
+    1101 => '`e',
288
+    1102 => 'yu',
289
+    1103 => 'ya',
290 290
 
291 291
 // vietnamien en translitteration de base
292
-	7843 => 'a',
293
-	7841 => 'a',
294
-	7845 => 'a',
295
-	7847 => 'a',
296
-	7849 => 'a',
297
-	7851 => 'a',
298
-	7853 => 'a',
299
-	7855 => 'a',
300
-	7857 => 'a',
301
-	7859 => 'a',
302
-	7861 => 'a',
303
-	7863 => 'a',
304
-	7842 => 'A',
305
-	7840 => 'A',
306
-	7844 => 'A',
307
-	7846 => 'A',
308
-	7848 => 'A',
309
-	7850 => 'A',
310
-	7852 => 'A',
311
-	7854 => 'A',
312
-	7856 => 'A',
313
-	7858 => 'A',
314
-	7860 => 'A',
315
-	7862 => 'A',
316
-	7867 => 'e',
317
-	7869 => 'e',
318
-	7865 => 'e',
319
-	7871 => 'e',
320
-	7873 => 'e',
321
-	7875 => 'e',
322
-	7877 => 'e',
323
-	7879 => 'e',
324
-	7866 => 'E',
325
-	7868 => 'E',
326
-	7864 => 'E',
327
-	7870 => 'E',
328
-	7872 => 'E',
329
-	7874 => 'E',
330
-	7876 => 'E',
331
-	7878 => 'E',
332
-	7881 => 'i',
333
-	7883 => 'i',
334
-	7880 => 'I',
335
-	7882 => 'I',
336
-	7887 => 'o',
337
-	7885 => 'o',
338
-	7889 => 'o',
339
-	7891 => 'o',
340
-	7893 => 'o',
341
-	7895 => 'o',
342
-	7897 => 'o',
343
-	417 => 'o',
344
-	7899 => 'o',
345
-	7901 => 'o',
346
-	7903 => 'o',
347
-	7905 => 'o',
348
-	7907 => 'o',
349
-	7886 => 'O',
350
-	7884 => 'O',
351
-	7888 => 'O',
352
-	7890 => 'O',
353
-	7892 => 'O',
354
-	7894 => 'O',
355
-	7896 => 'O',
356
-	416 => 'O',
357
-	7898 => 'O',
358
-	7900 => 'O',
359
-	7902 => 'O',
360
-	7904 => 'O',
361
-	7906 => 'O',
362
-	7911 => 'u',
363
-	361 => 'u',
364
-	7909 => 'u',
365
-	432 => 'u',
366
-	7913 => 'u',
367
-	7915 => 'u',
368
-	7917 => 'u',
369
-	7919 => 'u',
370
-	7921 => 'u',
371
-	7910 => 'U',
372
-	360 => 'U',
373
-	7908 => 'U',
374
-	431 => 'U',
375
-	7912 => 'U',
376
-	7914 => 'U',
377
-	7916 => 'U',
378
-	7918 => 'U',
379
-	7920 => 'U',
380
-	253 => 'y',
381
-	7923 => 'y',
382
-	7927 => 'y',
383
-	7929 => 'y',
384
-	7925 => 'y',
385
-	221 => 'Y',
386
-	7922 => 'Y',
387
-	7926 => 'Y',
388
-	7928 => 'Y',
389
-	7924 => 'Y',
390
-	273 => 'd'
292
+    7843 => 'a',
293
+    7841 => 'a',
294
+    7845 => 'a',
295
+    7847 => 'a',
296
+    7849 => 'a',
297
+    7851 => 'a',
298
+    7853 => 'a',
299
+    7855 => 'a',
300
+    7857 => 'a',
301
+    7859 => 'a',
302
+    7861 => 'a',
303
+    7863 => 'a',
304
+    7842 => 'A',
305
+    7840 => 'A',
306
+    7844 => 'A',
307
+    7846 => 'A',
308
+    7848 => 'A',
309
+    7850 => 'A',
310
+    7852 => 'A',
311
+    7854 => 'A',
312
+    7856 => 'A',
313
+    7858 => 'A',
314
+    7860 => 'A',
315
+    7862 => 'A',
316
+    7867 => 'e',
317
+    7869 => 'e',
318
+    7865 => 'e',
319
+    7871 => 'e',
320
+    7873 => 'e',
321
+    7875 => 'e',
322
+    7877 => 'e',
323
+    7879 => 'e',
324
+    7866 => 'E',
325
+    7868 => 'E',
326
+    7864 => 'E',
327
+    7870 => 'E',
328
+    7872 => 'E',
329
+    7874 => 'E',
330
+    7876 => 'E',
331
+    7878 => 'E',
332
+    7881 => 'i',
333
+    7883 => 'i',
334
+    7880 => 'I',
335
+    7882 => 'I',
336
+    7887 => 'o',
337
+    7885 => 'o',
338
+    7889 => 'o',
339
+    7891 => 'o',
340
+    7893 => 'o',
341
+    7895 => 'o',
342
+    7897 => 'o',
343
+    417 => 'o',
344
+    7899 => 'o',
345
+    7901 => 'o',
346
+    7903 => 'o',
347
+    7905 => 'o',
348
+    7907 => 'o',
349
+    7886 => 'O',
350
+    7884 => 'O',
351
+    7888 => 'O',
352
+    7890 => 'O',
353
+    7892 => 'O',
354
+    7894 => 'O',
355
+    7896 => 'O',
356
+    416 => 'O',
357
+    7898 => 'O',
358
+    7900 => 'O',
359
+    7902 => 'O',
360
+    7904 => 'O',
361
+    7906 => 'O',
362
+    7911 => 'u',
363
+    361 => 'u',
364
+    7909 => 'u',
365
+    432 => 'u',
366
+    7913 => 'u',
367
+    7915 => 'u',
368
+    7917 => 'u',
369
+    7919 => 'u',
370
+    7921 => 'u',
371
+    7910 => 'U',
372
+    360 => 'U',
373
+    7908 => 'U',
374
+    431 => 'U',
375
+    7912 => 'U',
376
+    7914 => 'U',
377
+    7916 => 'U',
378
+    7918 => 'U',
379
+    7920 => 'U',
380
+    253 => 'y',
381
+    7923 => 'y',
382
+    7927 => 'y',
383
+    7929 => 'y',
384
+    7925 => 'y',
385
+    221 => 'Y',
386
+    7922 => 'Y',
387
+    7926 => 'Y',
388
+    7928 => 'Y',
389
+    7924 => 'Y',
390
+    273 => 'd'
391 391
 
392 392
 ];
Please login to merge, or discard this patch.
ecrire/inc/liens.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
Please login to merge, or discard this patch.
prive/themes/spip/vars.css_fonctions.php 1 patch
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -8,59 +8,59 @@  discard block
 block discarded – undo
8 8
  * @param Pile $pile Pile
9 9
  */
10 10
 function spip_generer_variables_css_typo(array $Pile): Collection {
11
-	$vars = new Collection();
12
-
13
-	// Direction
14
-	$vars->add('--spip-dir', $Pile[0]['dir']);
15
-	$vars->add('--spip-left', $Pile[0]['left']);
16
-	$vars->add('--spip-right', $Pile[0]['right']);
17
-
18
-	// Typographie
19
-	$vars->add('--spip-font-size', $Pile[0]['font-size']);
20
-	$vars->add('--spip-line-height', $Pile[0]['line-height']);
21
-	$vars->add('--spip-text-indent', $Pile[0]['text-indent']);
22
-	$vars->add('--spip-font-family', $Pile[0]['font-family']);
23
-
24
-	// Couleurs hors thème
25
-	$vars->add('--spip-background-color', $Pile[0]['background-color']);
26
-	$vars->add('--spip-color', $Pile[0]['color']);
27
-
28
-	// Espacements pour le rythme vertical et les gouttières
29
-	// Basés sur la hauteur d'une ligne de texte à la racine du document
30
-	$vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
31
-	$vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
32
-	$vars->add('--spip-margin-bottom', $Pile[0]['margin-bottom']); // À déprécier
33
-
34
-	// Bordures
35
-	$vars->add('--spip-border-radius-mini', '0.2rem');
36
-	$vars->add('--spip-border-radius', '0.33rem');
37
-	$vars->add('--spip-border-radius-large', '0.66rem');
38
-
39
-	// Ombres portées
40
-	$shadow_mini =
41
-		'0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),' .
42
-		'0 0.1em  0.15em hsla(0, 0%, 0%, 0.05),' .
43
-		'0 0.1em  0.25em  hsla(0, 0%, 0%, 0.05)';
44
-	$shadow =
45
-		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),' .
46
-		'0 0.1em  0.25em hsla(0, 0%, 0%, 0.05),' .
47
-		'0 0.1em  0.5em  hsla(0, 0%, 0%, 0.05)';
48
-	$shadow_large =
49
-		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),' .
50
-		'0 0.2em  0.5em  hsla(0, 0%, 0%, 0.1),' .
51
-		'0 0.2em  1em    hsla(0, 0%, 0%, 0.075)';
52
-	$shadow_huge =
53
-		'0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),' .
54
-		'0 0.25em  1em  hsla(0, 0%, 0%, 0.1),' .
55
-		'0 0.5em  2em    hsla(0, 0%, 0%, 0.075)';
56
-	$vars->add('--spip-box-shadow-mini', $shadow_mini);
57
-	$vars->add('--spip-box-shadow-mini-hover', $shadow);
58
-	$vars->add('--spip-box-shadow', $shadow);
59
-	$vars->add('--spip-box-shadow-hover', $shadow_large);
60
-	$vars->add('--spip-box-shadow-large', $shadow_large);
61
-	$vars->add('--spip-box-shadow-large-hover', $shadow_huge);
62
-
63
-	return $vars;
11
+    $vars = new Collection();
12
+
13
+    // Direction
14
+    $vars->add('--spip-dir', $Pile[0]['dir']);
15
+    $vars->add('--spip-left', $Pile[0]['left']);
16
+    $vars->add('--spip-right', $Pile[0]['right']);
17
+
18
+    // Typographie
19
+    $vars->add('--spip-font-size', $Pile[0]['font-size']);
20
+    $vars->add('--spip-line-height', $Pile[0]['line-height']);
21
+    $vars->add('--spip-text-indent', $Pile[0]['text-indent']);
22
+    $vars->add('--spip-font-family', $Pile[0]['font-family']);
23
+
24
+    // Couleurs hors thème
25
+    $vars->add('--spip-background-color', $Pile[0]['background-color']);
26
+    $vars->add('--spip-color', $Pile[0]['color']);
27
+
28
+    // Espacements pour le rythme vertical et les gouttières
29
+    // Basés sur la hauteur d'une ligne de texte à la racine du document
30
+    $vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
31
+    $vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
32
+    $vars->add('--spip-margin-bottom', $Pile[0]['margin-bottom']); // À déprécier
33
+
34
+    // Bordures
35
+    $vars->add('--spip-border-radius-mini', '0.2rem');
36
+    $vars->add('--spip-border-radius', '0.33rem');
37
+    $vars->add('--spip-border-radius-large', '0.66rem');
38
+
39
+    // Ombres portées
40
+    $shadow_mini =
41
+        '0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),' .
42
+        '0 0.1em  0.15em hsla(0, 0%, 0%, 0.05),' .
43
+        '0 0.1em  0.25em  hsla(0, 0%, 0%, 0.05)';
44
+    $shadow =
45
+        '0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),' .
46
+        '0 0.1em  0.25em hsla(0, 0%, 0%, 0.05),' .
47
+        '0 0.1em  0.5em  hsla(0, 0%, 0%, 0.05)';
48
+    $shadow_large =
49
+        '0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),' .
50
+        '0 0.2em  0.5em  hsla(0, 0%, 0%, 0.1),' .
51
+        '0 0.2em  1em    hsla(0, 0%, 0%, 0.075)';
52
+    $shadow_huge =
53
+        '0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),' .
54
+        '0 0.25em  1em  hsla(0, 0%, 0%, 0.1),' .
55
+        '0 0.5em  2em    hsla(0, 0%, 0%, 0.075)';
56
+    $vars->add('--spip-box-shadow-mini', $shadow_mini);
57
+    $vars->add('--spip-box-shadow-mini-hover', $shadow);
58
+    $vars->add('--spip-box-shadow', $shadow);
59
+    $vars->add('--spip-box-shadow-hover', $shadow_large);
60
+    $vars->add('--spip-box-shadow-large', $shadow_large);
61
+    $vars->add('--spip-box-shadow-large-hover', $shadow_huge);
62
+
63
+    return $vars;
64 64
 }
65 65
 
66 66
 /**
@@ -69,101 +69,101 @@  discard block
 block discarded – undo
69 69
  * @param string $couleur Couleur hex
70 70
  */
71 71
 function spip_generer_variables_css_couleurs_theme(string $couleur): Collection {
72
-	$vars = new Collection();
73
-
74
-	#$vars->add('--spip-color-theme--hsl', couleur_hex_to_hsl($couleur, 'h, s, l')); // redéfini ensuite
75
-	$vars->add('--spip-color-theme--h', couleur_hex_to_hsl($couleur, 'h'));
76
-	$vars->add('--spip-color-theme--s', couleur_hex_to_hsl($couleur, 's'));
77
-	$vars->add('--spip-color-theme--l', couleur_hex_to_hsl($couleur, 'l'));
78
-
79
-	// un joli dégradé coloré de presque blanc à presque noir…
80
-	$vars->add('--spip-color-theme--100', couleur_hex_to_hsl(couleur_eclaircir($couleur, .99), 'h, s, l'));
81
-	$vars->add('--spip-color-theme--98', couleur_hex_to_hsl(couleur_eclaircir($couleur, .95), 'h, s, l'));
82
-	$vars->add('--spip-color-theme--95', couleur_hex_to_hsl(couleur_eclaircir($couleur, .90), 'h, s, l'));
83
-	$vars->add('--spip-color-theme--90', couleur_hex_to_hsl(couleur_eclaircir($couleur, .75), 'h, s, l'));
84
-	$vars->add('--spip-color-theme--80', couleur_hex_to_hsl(couleur_eclaircir($couleur, .50), 'h, s, l'));
85
-	$vars->add('--spip-color-theme--70', couleur_hex_to_hsl(couleur_eclaircir($couleur, .25), 'h, s, l'));
86
-	$vars->add('--spip-color-theme--60', couleur_hex_to_hsl($couleur, 'h, s, l'));
87
-	$vars->add('--spip-color-theme--50', couleur_hex_to_hsl(couleur_foncer($couleur, .125), 'h, s, l'));
88
-	$vars->add('--spip-color-theme--40', couleur_hex_to_hsl(couleur_foncer($couleur, .25), 'h, s, l'));
89
-	$vars->add('--spip-color-theme--30', couleur_hex_to_hsl(couleur_foncer($couleur, .375), 'h, s, l'));
90
-	$vars->add('--spip-color-theme--20', couleur_hex_to_hsl(couleur_foncer($couleur, .50), 'h, s, l'));
91
-	$vars->add('--spip-color-theme--10', couleur_hex_to_hsl(couleur_foncer($couleur, .75), 'h, s, l'));
92
-	$vars->add('--spip-color-theme--00', couleur_hex_to_hsl(couleur_foncer($couleur, .98), 'h, s, l'));
93
-
94
-	return $vars;
72
+    $vars = new Collection();
73
+
74
+    #$vars->add('--spip-color-theme--hsl', couleur_hex_to_hsl($couleur, 'h, s, l')); // redéfini ensuite
75
+    $vars->add('--spip-color-theme--h', couleur_hex_to_hsl($couleur, 'h'));
76
+    $vars->add('--spip-color-theme--s', couleur_hex_to_hsl($couleur, 's'));
77
+    $vars->add('--spip-color-theme--l', couleur_hex_to_hsl($couleur, 'l'));
78
+
79
+    // un joli dégradé coloré de presque blanc à presque noir…
80
+    $vars->add('--spip-color-theme--100', couleur_hex_to_hsl(couleur_eclaircir($couleur, .99), 'h, s, l'));
81
+    $vars->add('--spip-color-theme--98', couleur_hex_to_hsl(couleur_eclaircir($couleur, .95), 'h, s, l'));
82
+    $vars->add('--spip-color-theme--95', couleur_hex_to_hsl(couleur_eclaircir($couleur, .90), 'h, s, l'));
83
+    $vars->add('--spip-color-theme--90', couleur_hex_to_hsl(couleur_eclaircir($couleur, .75), 'h, s, l'));
84
+    $vars->add('--spip-color-theme--80', couleur_hex_to_hsl(couleur_eclaircir($couleur, .50), 'h, s, l'));
85
+    $vars->add('--spip-color-theme--70', couleur_hex_to_hsl(couleur_eclaircir($couleur, .25), 'h, s, l'));
86
+    $vars->add('--spip-color-theme--60', couleur_hex_to_hsl($couleur, 'h, s, l'));
87
+    $vars->add('--spip-color-theme--50', couleur_hex_to_hsl(couleur_foncer($couleur, .125), 'h, s, l'));
88
+    $vars->add('--spip-color-theme--40', couleur_hex_to_hsl(couleur_foncer($couleur, .25), 'h, s, l'));
89
+    $vars->add('--spip-color-theme--30', couleur_hex_to_hsl(couleur_foncer($couleur, .375), 'h, s, l'));
90
+    $vars->add('--spip-color-theme--20', couleur_hex_to_hsl(couleur_foncer($couleur, .50), 'h, s, l'));
91
+    $vars->add('--spip-color-theme--10', couleur_hex_to_hsl(couleur_foncer($couleur, .75), 'h, s, l'));
92
+    $vars->add('--spip-color-theme--00', couleur_hex_to_hsl(couleur_foncer($couleur, .98), 'h, s, l'));
93
+
94
+    return $vars;
95 95
 }
96 96
 
97 97
 /**
98 98
  * Génère les variables CSS de couleurs, dont celles dépendantes des couleurs du thème actif.
99 99
  */
100 100
 function spip_generer_variables_css_couleurs(): Collection {
101
-	$vars = new Collection();
102
-
103
-	// nos déclinaisons de couleur (basées sur le dégradé précedent, où 60 est là couleur du thème)
104
-	$vars->add('--spip-color-theme-white--hsl', 'var(--spip-color-theme--100)');
105
-	$vars->add('--spip-color-theme-lightest--hsl', 'var(--spip-color-theme--95)');
106
-	$vars->add('--spip-color-theme-lighter--hsl', 'var(--spip-color-theme--90)');
107
-	$vars->add('--spip-color-theme-light--hsl', 'var(--spip-color-theme--80)');
108
-	$vars->add('--spip-color-theme--hsl', 'var(--spip-color-theme--60)');
109
-	$vars->add('--spip-color-theme-dark--hsl', 'var(--spip-color-theme--40)');
110
-	$vars->add('--spip-color-theme-darker--hsl', 'var(--spip-color-theme--20)');
111
-	$vars->add('--spip-color-theme-darkest--hsl', 'var(--spip-color-theme--10)');
112
-	$vars->add('--spip-color-theme-black--hsl', 'var(--spip-color-theme--00)');
113
-
114
-	$vars->add('--spip-color-theme-white', 'hsl(var(--spip-color-theme-white--hsl))');
115
-	$vars->add('--spip-color-theme-lightest', 'hsl(var(--spip-color-theme-lightest--hsl))');
116
-	$vars->add('--spip-color-theme-lighter', 'hsl(var(--spip-color-theme-lighter--hsl))');
117
-	$vars->add('--spip-color-theme-light', 'hsl(var(--spip-color-theme-light--hsl))');
118
-	$vars->add('--spip-color-theme', 'hsl(var(--spip-color-theme--hsl))');
119
-	$vars->add('--spip-color-theme-dark', 'hsl(var(--spip-color-theme-dark--hsl))');
120
-	$vars->add('--spip-color-theme-darker', 'hsl(var(--spip-color-theme-darker--hsl))');
121
-	$vars->add('--spip-color-theme-darkest', 'hsl(var(--spip-color-theme-darkest--hsl))');
122
-	$vars->add('--spip-color-theme-black', 'hsl(var(--spip-color-theme-black--hsl))');
123
-
124
-	// déclinaisons de gris (luminosité calquée sur le dégradé de couleur)
125
-	$vars->add('--spip-color-white--hsl', '0, 0%, 100%');
126
-	$vars->add('--spip-color-gray-lightest--hsl', '0, 0%, 96%');
127
-	$vars->add('--spip-color-gray-lighter--hsl', '0, 0%, 90%');
128
-	$vars->add('--spip-color-gray-light--hsl', '0, 0%, 80%');
129
-	$vars->add('--spip-color-gray--hsl', '0, 0%, 60%');
130
-	$vars->add('--spip-color-gray-dark--hsl', '0, 0%, 40%');
131
-	$vars->add('--spip-color-gray-darker--hsl', '0, 0%, 20%');
132
-	$vars->add('--spip-color-gray-darkest--hsl', '0, 0%, 10%');
133
-	$vars->add('--spip-color-black--hsl', '0, 0%, 0%');
134
-
135
-	$vars->add('--spip-color-white', 'hsl(var(--spip-color-white--hsl))');
136
-	$vars->add('--spip-color-gray-lightest', 'hsl(var(--spip-color-gray-lightest--hsl))');
137
-	$vars->add('--spip-color-gray-lighter', 'hsl(var(--spip-color-gray-lighter--hsl))');
138
-	$vars->add('--spip-color-gray-light', 'hsl(var(--spip-color-gray-light--hsl))');
139
-	$vars->add('--spip-color-gray', 'hsl(var(--spip-color-gray--hsl))');
140
-	$vars->add('--spip-color-gray-dark', 'hsl(var(--spip-color-gray-dark--hsl))');
141
-	$vars->add('--spip-color-gray-darker', 'hsl(var(--spip-color-gray-darker--hsl))');
142
-	$vars->add('--spip-color-gray-darkest', 'hsl(var(--spip-color-gray-darkest--hsl))');
143
-	$vars->add('--spip-color-black', 'hsl(var(--spip-color-black--hsl))');
144
-
145
-	// Différents états : erreur, etc.
146
-	$vars->add('--spip-color-success--hsl', '72, 66%, 62%');
147
-	$vars->add('--spip-color-success--h', '72');
148
-	$vars->add('--spip-color-success--s', '66%');
149
-	$vars->add('--spip-color-success--l', '62%');
150
-	$vars->add('--spip-color-error--hsl', '356, 70%, 57%');
151
-	$vars->add('--spip-color-error--h', '356');
152
-	$vars->add('--spip-color-error--s', '70%');
153
-	$vars->add('--spip-color-error--l', '57%');
154
-	$vars->add('--spip-color-notice--hsl', '47, 100%, 62%');
155
-	$vars->add('--spip-color-notice--h', '47');
156
-	$vars->add('--spip-color-notice--s', '100%');
157
-	$vars->add('--spip-color-notice--l', '62%');
158
-	$vars->add('--spip-color-info--hsl', '197, 56%, 27%');
159
-	$vars->add('--spip-color-info--h', '197');
160
-	$vars->add('--spip-color-info--s', '56%');
161
-	$vars->add('--spip-color-info--l', '27%');
162
-
163
-	$vars->add('--spip-color-success', 'hsl(var(--spip-color-success--hsl))');
164
-	$vars->add('--spip-color-error', 'hsl(var(--spip-color-error--hsl))');
165
-	$vars->add('--spip-color-notice', 'hsl(var(--spip-color-notice--hsl))');
166
-	$vars->add('--spip-color-info', 'hsl(var(--spip-color-info--hsl))');
167
-
168
-	return $vars;
101
+    $vars = new Collection();
102
+
103
+    // nos déclinaisons de couleur (basées sur le dégradé précedent, où 60 est là couleur du thème)
104
+    $vars->add('--spip-color-theme-white--hsl', 'var(--spip-color-theme--100)');
105
+    $vars->add('--spip-color-theme-lightest--hsl', 'var(--spip-color-theme--95)');
106
+    $vars->add('--spip-color-theme-lighter--hsl', 'var(--spip-color-theme--90)');
107
+    $vars->add('--spip-color-theme-light--hsl', 'var(--spip-color-theme--80)');
108
+    $vars->add('--spip-color-theme--hsl', 'var(--spip-color-theme--60)');
109
+    $vars->add('--spip-color-theme-dark--hsl', 'var(--spip-color-theme--40)');
110
+    $vars->add('--spip-color-theme-darker--hsl', 'var(--spip-color-theme--20)');
111
+    $vars->add('--spip-color-theme-darkest--hsl', 'var(--spip-color-theme--10)');
112
+    $vars->add('--spip-color-theme-black--hsl', 'var(--spip-color-theme--00)');
113
+
114
+    $vars->add('--spip-color-theme-white', 'hsl(var(--spip-color-theme-white--hsl))');
115
+    $vars->add('--spip-color-theme-lightest', 'hsl(var(--spip-color-theme-lightest--hsl))');
116
+    $vars->add('--spip-color-theme-lighter', 'hsl(var(--spip-color-theme-lighter--hsl))');
117
+    $vars->add('--spip-color-theme-light', 'hsl(var(--spip-color-theme-light--hsl))');
118
+    $vars->add('--spip-color-theme', 'hsl(var(--spip-color-theme--hsl))');
119
+    $vars->add('--spip-color-theme-dark', 'hsl(var(--spip-color-theme-dark--hsl))');
120
+    $vars->add('--spip-color-theme-darker', 'hsl(var(--spip-color-theme-darker--hsl))');
121
+    $vars->add('--spip-color-theme-darkest', 'hsl(var(--spip-color-theme-darkest--hsl))');
122
+    $vars->add('--spip-color-theme-black', 'hsl(var(--spip-color-theme-black--hsl))');
123
+
124
+    // déclinaisons de gris (luminosité calquée sur le dégradé de couleur)
125
+    $vars->add('--spip-color-white--hsl', '0, 0%, 100%');
126
+    $vars->add('--spip-color-gray-lightest--hsl', '0, 0%, 96%');
127
+    $vars->add('--spip-color-gray-lighter--hsl', '0, 0%, 90%');
128
+    $vars->add('--spip-color-gray-light--hsl', '0, 0%, 80%');
129
+    $vars->add('--spip-color-gray--hsl', '0, 0%, 60%');
130
+    $vars->add('--spip-color-gray-dark--hsl', '0, 0%, 40%');
131
+    $vars->add('--spip-color-gray-darker--hsl', '0, 0%, 20%');
132
+    $vars->add('--spip-color-gray-darkest--hsl', '0, 0%, 10%');
133
+    $vars->add('--spip-color-black--hsl', '0, 0%, 0%');
134
+
135
+    $vars->add('--spip-color-white', 'hsl(var(--spip-color-white--hsl))');
136
+    $vars->add('--spip-color-gray-lightest', 'hsl(var(--spip-color-gray-lightest--hsl))');
137
+    $vars->add('--spip-color-gray-lighter', 'hsl(var(--spip-color-gray-lighter--hsl))');
138
+    $vars->add('--spip-color-gray-light', 'hsl(var(--spip-color-gray-light--hsl))');
139
+    $vars->add('--spip-color-gray', 'hsl(var(--spip-color-gray--hsl))');
140
+    $vars->add('--spip-color-gray-dark', 'hsl(var(--spip-color-gray-dark--hsl))');
141
+    $vars->add('--spip-color-gray-darker', 'hsl(var(--spip-color-gray-darker--hsl))');
142
+    $vars->add('--spip-color-gray-darkest', 'hsl(var(--spip-color-gray-darkest--hsl))');
143
+    $vars->add('--spip-color-black', 'hsl(var(--spip-color-black--hsl))');
144
+
145
+    // Différents états : erreur, etc.
146
+    $vars->add('--spip-color-success--hsl', '72, 66%, 62%');
147
+    $vars->add('--spip-color-success--h', '72');
148
+    $vars->add('--spip-color-success--s', '66%');
149
+    $vars->add('--spip-color-success--l', '62%');
150
+    $vars->add('--spip-color-error--hsl', '356, 70%, 57%');
151
+    $vars->add('--spip-color-error--h', '356');
152
+    $vars->add('--spip-color-error--s', '70%');
153
+    $vars->add('--spip-color-error--l', '57%');
154
+    $vars->add('--spip-color-notice--hsl', '47, 100%, 62%');
155
+    $vars->add('--spip-color-notice--h', '47');
156
+    $vars->add('--spip-color-notice--s', '100%');
157
+    $vars->add('--spip-color-notice--l', '62%');
158
+    $vars->add('--spip-color-info--hsl', '197, 56%, 27%');
159
+    $vars->add('--spip-color-info--h', '197');
160
+    $vars->add('--spip-color-info--s', '56%');
161
+    $vars->add('--spip-color-info--l', '27%');
162
+
163
+    $vars->add('--spip-color-success', 'hsl(var(--spip-color-success--hsl))');
164
+    $vars->add('--spip-color-error', 'hsl(var(--spip-color-error--hsl))');
165
+    $vars->add('--spip-color-notice', 'hsl(var(--spip-color-notice--hsl))');
166
+    $vars->add('--spip-color-info', 'hsl(var(--spip-color-info--hsl))');
167
+
168
+    return $vars;
169 169
 }
Please login to merge, or discard this patch.
ecrire/public/interfaces.php 1 patch
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 
@@ -48,90 +48,90 @@  discard block
 block discarded – undo
48 48
  */
49 49
 function declarer_interfaces() {
50 50
 
51
-	$GLOBALS['table_des_tables']['articles'] = 'articles';
52
-	$GLOBALS['table_des_tables']['auteurs'] = 'auteurs';
53
-	$GLOBALS['table_des_tables']['rubriques'] = 'rubriques';
54
-	$GLOBALS['table_des_tables']['hierarchie'] = 'rubriques';
55
-
56
-	// definition des statuts de publication
57
-	$GLOBALS['table_statut'] = [];
58
-
59
-	//
60
-	// tableau des tables de jointures
61
-	// Ex: gestion du critere {id_mot} dans la boucle(ARTICLES)
62
-	$GLOBALS['tables_jointures'] = [];
63
-	$GLOBALS['tables_jointures']['spip_jobs'][] = 'jobs_liens';
64
-
65
-	// $GLOBALS['exceptions_des_jointures']['titre_mot'] = array('spip_mots', 'titre'); // pour exemple
66
-	$GLOBALS['exceptions_des_jointures']['profondeur'] = ['spip_rubriques', 'profondeur'];
67
-
68
-
69
-	if (!defined('_TRAITEMENT_TYPO')) {
70
-		define('_TRAITEMENT_TYPO', 'typo(%s, "TYPO", $connect, $Pile[0])');
71
-	}
72
-	if (!defined('_TRAITEMENT_RACCOURCIS')) {
73
-		define('_TRAITEMENT_RACCOURCIS', 'propre(%s, $connect, $Pile[0])');
74
-	}
75
-	if (!defined('_TRAITEMENT_TYPO_SANS_NUMERO')) {
76
-		define('_TRAITEMENT_TYPO_SANS_NUMERO', 'supprimer_numero(typo(%s, "TYPO", $connect, $Pile[0]))');
77
-	}
78
-	$GLOBALS['table_des_traitements']['BIO'][] = 'safehtml(' . _TRAITEMENT_RACCOURCIS . ')';
79
-	$GLOBALS['table_des_traitements']['NOM_SITE']['auteurs'] = 'entites_html(%s)';
80
-	$GLOBALS['table_des_traitements']['NOM']['auteurs'] = 'safehtml(' . _TRAITEMENT_TYPO_SANS_NUMERO . ')';
81
-	$GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS;
82
-	$GLOBALS['table_des_traitements']['DATE'][] = 'normaliser_date(%s)';
83
-	$GLOBALS['table_des_traitements']['DATE_REDAC'][] = 'normaliser_date(%s)';
84
-	$GLOBALS['table_des_traitements']['DATE_MODIF'][] = 'normaliser_date(%s)';
85
-	$GLOBALS['table_des_traitements']['DATE_NOUVEAUTES'][] = 'normaliser_date(%s)';
86
-	$GLOBALS['table_des_traitements']['DESCRIPTIF'][] = _TRAITEMENT_RACCOURCIS;
87
-	$GLOBALS['table_des_traitements']['INTRODUCTION'][] = _TRAITEMENT_RACCOURCIS;
88
-	$GLOBALS['table_des_traitements']['NOM_SITE_SPIP'][] = _TRAITEMENT_TYPO;
89
-	$GLOBALS['table_des_traitements']['NOM'][] = _TRAITEMENT_TYPO_SANS_NUMERO;
90
-	$GLOBALS['table_des_traitements']['AUTEUR'][] = _TRAITEMENT_TYPO;
91
-	$GLOBALS['table_des_traitements']['PS'][] = _TRAITEMENT_RACCOURCIS;
92
-	$GLOBALS['table_des_traitements']['SOURCE'][] = _TRAITEMENT_TYPO;
93
-	$GLOBALS['table_des_traitements']['SOUSTITRE'][] = _TRAITEMENT_TYPO;
94
-	$GLOBALS['table_des_traitements']['SURTITRE'][] = _TRAITEMENT_TYPO;
95
-	$GLOBALS['table_des_traitements']['TAGS'][] = '%s';
96
-	$GLOBALS['table_des_traitements']['TEXTE'][] = _TRAITEMENT_RACCOURCIS;
97
-	$GLOBALS['table_des_traitements']['TITRE'][] = _TRAITEMENT_TYPO_SANS_NUMERO;
98
-	$GLOBALS['table_des_traitements']['TYPE'][] = _TRAITEMENT_TYPO;
99
-	$GLOBALS['table_des_traitements']['DESCRIPTIF_SITE_SPIP'][] = _TRAITEMENT_RACCOURCIS;
100
-	$GLOBALS['table_des_traitements']['SLOGAN_SITE_SPIP'][] = _TRAITEMENT_TYPO;
101
-	$GLOBALS['table_des_traitements']['ENV'][] = 'entites_html(%s,true)';
102
-
103
-	// valeur par defaut pour les balises non listees ci-dessus
104
-	$GLOBALS['table_des_traitements']['*'][] = false; // pas de traitement, mais permet au compilo de trouver la declaration suivante
105
-	// toujours securiser les DATA
106
-	$GLOBALS['table_des_traitements']['*']['DATA'] = 'safehtml(%s)';
107
-	// expliciter pour VALEUR qui est un champ calcule et ne sera pas protege par le catch-all *
108
-	$GLOBALS['table_des_traitements']['VALEUR']['DATA'] = 'safehtml(%s)';
109
-
110
-
111
-	// gerer l'affectation en 2 temps car si le pipe n'est pas encore declare, on ecrase les globales
112
-	$interfaces = pipeline(
113
-		'declarer_tables_interfaces',
114
-		[
115
-			'table_des_tables' => $GLOBALS['table_des_tables'],
116
-			'exceptions_des_tables' => $GLOBALS['exceptions_des_tables'],
117
-			'table_date' => $GLOBALS['table_date'],
118
-			'table_titre' => $GLOBALS['table_titre'],
119
-			'tables_jointures' => $GLOBALS['tables_jointures'],
120
-			'exceptions_des_jointures' => $GLOBALS['exceptions_des_jointures'],
121
-			'table_des_traitements' => $GLOBALS['table_des_traitements'],
122
-			'table_statut' => $GLOBALS['table_statut'],
123
-		]
124
-	);
125
-	if ($interfaces) {
126
-		$GLOBALS['table_des_tables'] = $interfaces['table_des_tables'];
127
-		$GLOBALS['exceptions_des_tables'] = $interfaces['exceptions_des_tables'];
128
-		$GLOBALS['table_date'] = $interfaces['table_date'];
129
-		$GLOBALS['table_titre'] = $interfaces['table_titre'];
130
-		$GLOBALS['tables_jointures'] = $interfaces['tables_jointures'];
131
-		$GLOBALS['exceptions_des_jointures'] = $interfaces['exceptions_des_jointures'];
132
-		$GLOBALS['table_des_traitements'] = $interfaces['table_des_traitements'];
133
-		$GLOBALS['table_statut'] = $interfaces['table_statut'];
134
-	}
51
+    $GLOBALS['table_des_tables']['articles'] = 'articles';
52
+    $GLOBALS['table_des_tables']['auteurs'] = 'auteurs';
53
+    $GLOBALS['table_des_tables']['rubriques'] = 'rubriques';
54
+    $GLOBALS['table_des_tables']['hierarchie'] = 'rubriques';
55
+
56
+    // definition des statuts de publication
57
+    $GLOBALS['table_statut'] = [];
58
+
59
+    //
60
+    // tableau des tables de jointures
61
+    // Ex: gestion du critere {id_mot} dans la boucle(ARTICLES)
62
+    $GLOBALS['tables_jointures'] = [];
63
+    $GLOBALS['tables_jointures']['spip_jobs'][] = 'jobs_liens';
64
+
65
+    // $GLOBALS['exceptions_des_jointures']['titre_mot'] = array('spip_mots', 'titre'); // pour exemple
66
+    $GLOBALS['exceptions_des_jointures']['profondeur'] = ['spip_rubriques', 'profondeur'];
67
+
68
+
69
+    if (!defined('_TRAITEMENT_TYPO')) {
70
+        define('_TRAITEMENT_TYPO', 'typo(%s, "TYPO", $connect, $Pile[0])');
71
+    }
72
+    if (!defined('_TRAITEMENT_RACCOURCIS')) {
73
+        define('_TRAITEMENT_RACCOURCIS', 'propre(%s, $connect, $Pile[0])');
74
+    }
75
+    if (!defined('_TRAITEMENT_TYPO_SANS_NUMERO')) {
76
+        define('_TRAITEMENT_TYPO_SANS_NUMERO', 'supprimer_numero(typo(%s, "TYPO", $connect, $Pile[0]))');
77
+    }
78
+    $GLOBALS['table_des_traitements']['BIO'][] = 'safehtml(' . _TRAITEMENT_RACCOURCIS . ')';
79
+    $GLOBALS['table_des_traitements']['NOM_SITE']['auteurs'] = 'entites_html(%s)';
80
+    $GLOBALS['table_des_traitements']['NOM']['auteurs'] = 'safehtml(' . _TRAITEMENT_TYPO_SANS_NUMERO . ')';
81
+    $GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS;
82
+    $GLOBALS['table_des_traitements']['DATE'][] = 'normaliser_date(%s)';
83
+    $GLOBALS['table_des_traitements']['DATE_REDAC'][] = 'normaliser_date(%s)';
84
+    $GLOBALS['table_des_traitements']['DATE_MODIF'][] = 'normaliser_date(%s)';
85
+    $GLOBALS['table_des_traitements']['DATE_NOUVEAUTES'][] = 'normaliser_date(%s)';
86
+    $GLOBALS['table_des_traitements']['DESCRIPTIF'][] = _TRAITEMENT_RACCOURCIS;
87
+    $GLOBALS['table_des_traitements']['INTRODUCTION'][] = _TRAITEMENT_RACCOURCIS;
88
+    $GLOBALS['table_des_traitements']['NOM_SITE_SPIP'][] = _TRAITEMENT_TYPO;
89
+    $GLOBALS['table_des_traitements']['NOM'][] = _TRAITEMENT_TYPO_SANS_NUMERO;
90
+    $GLOBALS['table_des_traitements']['AUTEUR'][] = _TRAITEMENT_TYPO;
91
+    $GLOBALS['table_des_traitements']['PS'][] = _TRAITEMENT_RACCOURCIS;
92
+    $GLOBALS['table_des_traitements']['SOURCE'][] = _TRAITEMENT_TYPO;
93
+    $GLOBALS['table_des_traitements']['SOUSTITRE'][] = _TRAITEMENT_TYPO;
94
+    $GLOBALS['table_des_traitements']['SURTITRE'][] = _TRAITEMENT_TYPO;
95
+    $GLOBALS['table_des_traitements']['TAGS'][] = '%s';
96
+    $GLOBALS['table_des_traitements']['TEXTE'][] = _TRAITEMENT_RACCOURCIS;
97
+    $GLOBALS['table_des_traitements']['TITRE'][] = _TRAITEMENT_TYPO_SANS_NUMERO;
98
+    $GLOBALS['table_des_traitements']['TYPE'][] = _TRAITEMENT_TYPO;
99
+    $GLOBALS['table_des_traitements']['DESCRIPTIF_SITE_SPIP'][] = _TRAITEMENT_RACCOURCIS;
100
+    $GLOBALS['table_des_traitements']['SLOGAN_SITE_SPIP'][] = _TRAITEMENT_TYPO;
101
+    $GLOBALS['table_des_traitements']['ENV'][] = 'entites_html(%s,true)';
102
+
103
+    // valeur par defaut pour les balises non listees ci-dessus
104
+    $GLOBALS['table_des_traitements']['*'][] = false; // pas de traitement, mais permet au compilo de trouver la declaration suivante
105
+    // toujours securiser les DATA
106
+    $GLOBALS['table_des_traitements']['*']['DATA'] = 'safehtml(%s)';
107
+    // expliciter pour VALEUR qui est un champ calcule et ne sera pas protege par le catch-all *
108
+    $GLOBALS['table_des_traitements']['VALEUR']['DATA'] = 'safehtml(%s)';
109
+
110
+
111
+    // gerer l'affectation en 2 temps car si le pipe n'est pas encore declare, on ecrase les globales
112
+    $interfaces = pipeline(
113
+        'declarer_tables_interfaces',
114
+        [
115
+            'table_des_tables' => $GLOBALS['table_des_tables'],
116
+            'exceptions_des_tables' => $GLOBALS['exceptions_des_tables'],
117
+            'table_date' => $GLOBALS['table_date'],
118
+            'table_titre' => $GLOBALS['table_titre'],
119
+            'tables_jointures' => $GLOBALS['tables_jointures'],
120
+            'exceptions_des_jointures' => $GLOBALS['exceptions_des_jointures'],
121
+            'table_des_traitements' => $GLOBALS['table_des_traitements'],
122
+            'table_statut' => $GLOBALS['table_statut'],
123
+        ]
124
+    );
125
+    if ($interfaces) {
126
+        $GLOBALS['table_des_tables'] = $interfaces['table_des_tables'];
127
+        $GLOBALS['exceptions_des_tables'] = $interfaces['exceptions_des_tables'];
128
+        $GLOBALS['table_date'] = $interfaces['table_date'];
129
+        $GLOBALS['table_titre'] = $interfaces['table_titre'];
130
+        $GLOBALS['tables_jointures'] = $interfaces['tables_jointures'];
131
+        $GLOBALS['exceptions_des_jointures'] = $interfaces['exceptions_des_jointures'];
132
+        $GLOBALS['table_des_traitements'] = $interfaces['table_des_traitements'];
133
+        $GLOBALS['table_statut'] = $interfaces['table_statut'];
134
+    }
135 135
 }
136 136
 
137 137
 declarer_interfaces();
Please login to merge, or discard this patch.