Completed
Push — master ( 11381c...fc67b6 )
by cam
01:49
created
ecrire/lang/spip_pt.php 1 patch
Indentation   +643 added lines, -643 removed lines patch added patch discarded remove patch
@@ -5,566 +5,566 @@  discard block
 block discarded – undo
5 5
 
6 6
 return [
7 7
 
8
-	// A
9
-	'access_interface_graphique' => 'Voltar à interface gráfica completa',
10
-	'access_mode_texte' => 'Exibir a interface textual simplificada',
11
-	'admin_debug' => 'debug',
12
-	'admin_modifier_article' => 'Modificar este artigo',
13
-	'admin_modifier_auteur' => 'Modificar este autor',
14
-	'admin_modifier_breve' => 'Modificar esta notícia',
15
-	'admin_modifier_mot' => 'Modificar esta palavra-chave',
16
-	'admin_modifier_rubrique' => 'Modificar esta rubrica',
17
-	'admin_recalculer' => 'Recompor esta página',
18
-	'afficher_calendrier' => 'Exibir o calendário',
19
-	'afficher_trad' => 'exibir as traduções',
20
-	'alerte_maj_impossible' => '<b>Alerta !</b> A actualização da base de dados SQL para a versão @version@ é impossível, talvez por causa de um problema de permissão de modificação na base de dados. Por favor contacte o seu serviço de hospedagem.',
21
-	'alerte_modif_info_concourante' => 'ATTENÇÃO : Esta informação já foi modificada noutro menu. O valor actual é :',
22
-	'analyse_xml' => 'Análise XML',
23
-	'annuler' => 'Cancelar',
24
-	'antispam_champ_vide' => 'Por favor deixe este campo vazio :',
25
-	'articles_recents' => 'Artigos mais recentes',
26
-	'avis_archive_incorrect' => 'o ficheiro arquivo não é um ficheiro SPIP',
27
-	'avis_archive_invalide' => 'o ficheiro arquivo não é válido ',
28
-	'avis_attention' => ' ATENÇÂO!',
29
-	'avis_champ_incorrect_type_objet' => 'Nome de campo incorrecto @name@ para objecto de tipo @type@',
30
-	'avis_colonne_inexistante' => 'A coluna  @col@ não existe',
31
-	'avis_erreur' => 'Erro: ver mais abaixo',
32
-	'avis_erreur_connexion' => 'Erro de ligação ',
33
-	'avis_erreur_cookie' => 'problema de cookie',
34
-	'avis_erreur_fonction_contexte' => 'Erro de programação. Não se pode chamar esta função neste contexto.',
35
-	'avis_erreur_mysql' => 'Erro SQL',
36
-	'avis_erreur_sauvegarde' => 'Erro na cópia de segurança  (@type@ @id_objet@) !',
37
-	'avis_erreur_visiteur' => 'Problema de acesso à área privada',
8
+    // A
9
+    'access_interface_graphique' => 'Voltar à interface gráfica completa',
10
+    'access_mode_texte' => 'Exibir a interface textual simplificada',
11
+    'admin_debug' => 'debug',
12
+    'admin_modifier_article' => 'Modificar este artigo',
13
+    'admin_modifier_auteur' => 'Modificar este autor',
14
+    'admin_modifier_breve' => 'Modificar esta notícia',
15
+    'admin_modifier_mot' => 'Modificar esta palavra-chave',
16
+    'admin_modifier_rubrique' => 'Modificar esta rubrica',
17
+    'admin_recalculer' => 'Recompor esta página',
18
+    'afficher_calendrier' => 'Exibir o calendário',
19
+    'afficher_trad' => 'exibir as traduções',
20
+    'alerte_maj_impossible' => '<b>Alerta !</b> A actualização da base de dados SQL para a versão @version@ é impossível, talvez por causa de um problema de permissão de modificação na base de dados. Por favor contacte o seu serviço de hospedagem.',
21
+    'alerte_modif_info_concourante' => 'ATTENÇÃO : Esta informação já foi modificada noutro menu. O valor actual é :',
22
+    'analyse_xml' => 'Análise XML',
23
+    'annuler' => 'Cancelar',
24
+    'antispam_champ_vide' => 'Por favor deixe este campo vazio :',
25
+    'articles_recents' => 'Artigos mais recentes',
26
+    'avis_archive_incorrect' => 'o ficheiro arquivo não é um ficheiro SPIP',
27
+    'avis_archive_invalide' => 'o ficheiro arquivo não é válido ',
28
+    'avis_attention' => ' ATENÇÂO!',
29
+    'avis_champ_incorrect_type_objet' => 'Nome de campo incorrecto @name@ para objecto de tipo @type@',
30
+    'avis_colonne_inexistante' => 'A coluna  @col@ não existe',
31
+    'avis_erreur' => 'Erro: ver mais abaixo',
32
+    'avis_erreur_connexion' => 'Erro de ligação ',
33
+    'avis_erreur_cookie' => 'problema de cookie',
34
+    'avis_erreur_fonction_contexte' => 'Erro de programação. Não se pode chamar esta função neste contexto.',
35
+    'avis_erreur_mysql' => 'Erro SQL',
36
+    'avis_erreur_sauvegarde' => 'Erro na cópia de segurança  (@type@ @id_objet@) !',
37
+    'avis_erreur_visiteur' => 'Problema de acesso à área privada',
38 38
 
39
-	// B
40
-	'barre_a_accent_grave' => 'Inserir um A maiúsculo com acento grave',
41
-	'barre_aide' => 'Utilize as abreviaturas tipográficas para enriquecer a sua paginação.',
42
-	'barre_e_accent_aigu' => 'Inserir um E maiúsculo com acento agudo ',
43
-	'barre_eo' => 'Inserir um E no O',
44
-	'barre_eo_maj' => 'Inserir um E no O maiúsculo',
45
-	'barre_euro' => 'Inserir o símbolo €',
46
-	'barre_gras' => '  Escrever em {{negro}}',
47
-	'barre_guillemets' => 'Colocar entre "aspas" ',
48
-	'barre_guillemets_simples' => 'Colocar entre ’aspas simples’',
49
-	'barre_intertitre' => 'Transfomar em  {{{intertítulo}}} ',
50
-	'barre_italic' => 'Pôr em itálico ',
51
-	'barre_lien' => 'Transformar em [ligação hipertexto->http://...]',
52
-	'barre_lien_input' => 'Por favor indique o endereço da sua ligação (pode indicar um endereço Web sob a forma  http://www.monsite/com ou simplesmente indicar o número de um artigo deste sítio.) ',
53
-	'barre_note' => 'Transformar em  [[Nota de rodapé ]]',
54
-	'barre_paragraphe' => 'Criar um parágrafo',
55
-	'barre_quote' => '<quote>Citar uma  mensagem</quote>',
56
-	'bouton_changer' => 'Modificar',
57
-	'bouton_chercher' => 'Procurar',
58
-	'bouton_choisir' => 'Seleccionar',
59
-	'bouton_deplacer' => 'Mover',
60
-	'bouton_download' => 'Download',
61
-	'bouton_enregistrer' => 'Guardar',
62
-	'bouton_radio_desactiver_messagerie_interne' => 'Desactivar a caixa de correio interno',
63
-	'bouton_radio_envoi_annonces' => 'Enviar os anúncios editoriais',
64
-	'bouton_radio_non_envoi_annonces' => 'Não enviar anúncios',
65
-	'bouton_radio_non_envoi_liste_nouveautes' => 'Não enviar a lista das novidades',
66
-	'bouton_recharger_page' => 'recarregar esta página',
67
-	'bouton_telecharger' => 'Carregar',
68
-	'bouton_upload' => 'Carregar',
69
-	'bouton_valider' => 'Submeter',
39
+    // B
40
+    'barre_a_accent_grave' => 'Inserir um A maiúsculo com acento grave',
41
+    'barre_aide' => 'Utilize as abreviaturas tipográficas para enriquecer a sua paginação.',
42
+    'barre_e_accent_aigu' => 'Inserir um E maiúsculo com acento agudo ',
43
+    'barre_eo' => 'Inserir um E no O',
44
+    'barre_eo_maj' => 'Inserir um E no O maiúsculo',
45
+    'barre_euro' => 'Inserir o símbolo €',
46
+    'barre_gras' => '  Escrever em {{negro}}',
47
+    'barre_guillemets' => 'Colocar entre "aspas" ',
48
+    'barre_guillemets_simples' => 'Colocar entre ’aspas simples’',
49
+    'barre_intertitre' => 'Transfomar em  {{{intertítulo}}} ',
50
+    'barre_italic' => 'Pôr em itálico ',
51
+    'barre_lien' => 'Transformar em [ligação hipertexto->http://...]',
52
+    'barre_lien_input' => 'Por favor indique o endereço da sua ligação (pode indicar um endereço Web sob a forma  http://www.monsite/com ou simplesmente indicar o número de um artigo deste sítio.) ',
53
+    'barre_note' => 'Transformar em  [[Nota de rodapé ]]',
54
+    'barre_paragraphe' => 'Criar um parágrafo',
55
+    'barre_quote' => '<quote>Citar uma  mensagem</quote>',
56
+    'bouton_changer' => 'Modificar',
57
+    'bouton_chercher' => 'Procurar',
58
+    'bouton_choisir' => 'Seleccionar',
59
+    'bouton_deplacer' => 'Mover',
60
+    'bouton_download' => 'Download',
61
+    'bouton_enregistrer' => 'Guardar',
62
+    'bouton_radio_desactiver_messagerie_interne' => 'Desactivar a caixa de correio interno',
63
+    'bouton_radio_envoi_annonces' => 'Enviar os anúncios editoriais',
64
+    'bouton_radio_non_envoi_annonces' => 'Não enviar anúncios',
65
+    'bouton_radio_non_envoi_liste_nouveautes' => 'Não enviar a lista das novidades',
66
+    'bouton_recharger_page' => 'recarregar esta página',
67
+    'bouton_telecharger' => 'Carregar',
68
+    'bouton_upload' => 'Carregar',
69
+    'bouton_valider' => 'Submeter',
70 70
 
71
-	// C
72
-	'cal_apresmidi' => 'tarde',
73
-	'cal_jour_entier' => 'dia todo',
74
-	'cal_matin' => 'manhã',
75
-	'cal_par_jour' => 'calendário por dia',
76
-	'cal_par_mois' => 'calendário por mês',
77
-	'cal_par_semaine' => 'calendário por semana',
78
-	'choix_couleur_interface' => 'cor',
79
-	'choix_interface' => 'escolha da interface',
80
-	'colonne' => 'Coluna',
81
-	'confirm_changer_statut' => 'Atenção, solicitou a alteração do estatuto deste elemento. Deseja continuar?',
82
-	'correcte' => 'correcto',
71
+    // C
72
+    'cal_apresmidi' => 'tarde',
73
+    'cal_jour_entier' => 'dia todo',
74
+    'cal_matin' => 'manhã',
75
+    'cal_par_jour' => 'calendário por dia',
76
+    'cal_par_mois' => 'calendário por mês',
77
+    'cal_par_semaine' => 'calendário por semana',
78
+    'choix_couleur_interface' => 'cor',
79
+    'choix_interface' => 'escolha da interface',
80
+    'colonne' => 'Coluna',
81
+    'confirm_changer_statut' => 'Atenção, solicitou a alteração do estatuto deste elemento. Deseja continuar?',
82
+    'correcte' => 'correcto',
83 83
 
84
-	// D
85
-	'date_aujourdhui' => 'hoje',
86
-	'date_avant_jc' => 'a. J.C.',
87
-	'date_dans' => 'entre @delai@',
88
-	'date_de_mois_1' => '@j@ de @nommois@',
89
-	'date_de_mois_10' => '@j@ de @nommois@',
90
-	'date_de_mois_11' => '@j@ de @nommois@',
91
-	'date_de_mois_12' => '@j@ de @nommois@',
92
-	'date_de_mois_2' => '@j@ de @nommois@',
93
-	'date_de_mois_3' => '@j@ de @nommois@',
94
-	'date_de_mois_4' => '@j@ de @nommois@',
95
-	'date_de_mois_5' => '@j@ de @nommois@',
96
-	'date_de_mois_6' => '@j@ de @nommois@',
97
-	'date_de_mois_7' => '@j@ de @nommois@',
98
-	'date_de_mois_8' => '@j@ de @nommois@',
99
-	'date_de_mois_9' => '@j@ de @nommois@',
100
-	'date_demain' => 'amanhã',
101
-	'date_fmt_heures_minutes' => '@h@h@m@min',
102
-	'date_fmt_heures_minutes_court' => '@h@:@m@',
103
-	'date_fmt_jour' => '@nomjour@ @jour@',
104
-	'date_fmt_jour_heure' => '@jour@ a @heure@',
105
-	'date_fmt_jour_heure_debut_fin' => '@jour@ de @heure_debut@ a @heure_fin@', # MODIF
106
-	'date_fmt_jour_heure_debut_fin_abbr' => '@dtstart@@jour@ de @heure_debut@@dtabbr@ a @dtstart@@heure_fin@@dtend@', # MODIF
107
-	'date_fmt_jour_mois' => '@jour@ de @nommois@',
108
-	'date_fmt_jour_mois_annee' => '@jour@ de @nommois@ de @annee@',
109
-	'date_fmt_mois_annee' => '@nommois@ de @annee@',
110
-	'date_fmt_nomjour' => '@nomjour@ @date@',
111
-	'date_fmt_nomjour_date' => ' @nomjour@ @date@',
112
-	'date_fmt_periode' => 'De @date_debut@ a @date_fin@',
113
-	'date_fmt_periode_abbr' => 'De @dtart@@date_debut@@dtabbr@ a @dtend@@date_fin@@dtabbr@',
114
-	'date_fmt_periode_from' => 'De',
115
-	'date_fmt_periode_to' => 'a',
116
-	'date_heures' => 'horas',
117
-	'date_hier' => 'ontem',
118
-	'date_il_y_a' => 'há @delai@',
119
-	'date_jnum1' => '1',
120
-	'date_jnum10' => '10',
121
-	'date_jnum11' => '11',
122
-	'date_jnum12' => '12',
123
-	'date_jnum13' => '13',
124
-	'date_jnum14' => '14',
125
-	'date_jnum15' => '15',
126
-	'date_jnum16' => '16',
127
-	'date_jnum17' => '17',
128
-	'date_jnum18' => '18',
129
-	'date_jnum19' => '19',
130
-	'date_jnum2' => '2',
131
-	'date_jnum20' => '20',
132
-	'date_jnum21' => '21',
133
-	'date_jnum22' => '22',
134
-	'date_jnum23' => '23',
135
-	'date_jnum24' => '24',
136
-	'date_jnum25' => '25',
137
-	'date_jnum26' => '26',
138
-	'date_jnum27' => '27',
139
-	'date_jnum28' => '28',
140
-	'date_jnum29' => '29',
141
-	'date_jnum3' => '3',
142
-	'date_jnum30' => '30',
143
-	'date_jnum31' => '31',
144
-	'date_jnum4' => '4',
145
-	'date_jnum5' => '5',
146
-	'date_jnum6' => '6',
147
-	'date_jnum7' => '7',
148
-	'date_jnum8' => '8',
149
-	'date_jnum9' => '9',
150
-	'date_jour_1' => 'domingo',
151
-	'date_jour_1_abbr' => 'Dom.',
152
-	'date_jour_1_initiale' => 'D.',
153
-	'date_jour_2' => 'segunda-feira',
154
-	'date_jour_2_abbr' => 'Seg.',
155
-	'date_jour_2_initiale' => 'S.',
156
-	'date_jour_3' => 'terça-feira',
157
-	'date_jour_3_abbr' => 'Ter.',
158
-	'date_jour_3_initiale' => 'T.',
159
-	'date_jour_4' => 'quarta-feira',
160
-	'date_jour_4_abbr' => 'Qua.',
161
-	'date_jour_4_initiale' => 'Q.',
162
-	'date_jour_5' => 'quinta-feira',
163
-	'date_jour_5_abbr' => 'Qui.',
164
-	'date_jour_5_initiale' => 'Q.',
165
-	'date_jour_6' => 'sexta-feira',
166
-	'date_jour_6_abbr' => 'Sex.',
167
-	'date_jour_6_initiale' => 'S.',
168
-	'date_jour_7' => 'sábado',
169
-	'date_jour_7_abbr' => 'Sab.',
170
-	'date_jour_7_initiale' => 'S.',
171
-	'date_jours' => 'dias',
172
-	'date_minutes' => 'minutos',
173
-	'date_mois' => 'meses',
174
-	'date_mois_1' => 'Janeiro',
175
-	'date_mois_10' => 'Outubro',
176
-	'date_mois_10_abbr' => 'Out.',
177
-	'date_mois_11' => 'Novembro',
178
-	'date_mois_11_abbr' => 'Nov.',
179
-	'date_mois_12' => 'Dezembro',
180
-	'date_mois_12_abbr' => 'Dez.',
181
-	'date_mois_1_abbr' => 'Jan.',
182
-	'date_mois_2' => 'Fevereiro',
183
-	'date_mois_2_abbr' => 'Feb.',
184
-	'date_mois_3' => 'Março',
185
-	'date_mois_3_abbr' => 'Mar',
186
-	'date_mois_4' => 'Abril',
187
-	'date_mois_4_abbr' => 'Abr.',
188
-	'date_mois_5' => 'Maio',
189
-	'date_mois_5_abbr' => 'Mai',
190
-	'date_mois_6' => 'Junho',
191
-	'date_mois_6_abbr' => 'Jun',
192
-	'date_mois_7' => 'Julho',
193
-	'date_mois_7_abbr' => 'Jul',
194
-	'date_mois_8' => 'Agosto',
195
-	'date_mois_8_abbr' => 'Ago',
196
-	'date_mois_9' => 'Setembro',
197
-	'date_mois_9_abbr' => 'Set',
198
-	'date_saison_1' => 'inverno',
199
-	'date_saison_2' => 'primavera',
200
-	'date_saison_3' => 'verão',
201
-	'date_saison_4' => 'outono',
202
-	'date_secondes' => 'segundos',
203
-	'date_semaines' => 'semanas',
204
-	'date_un_mois' => 'mês',
205
-	'date_une_heure' => 'hora',
206
-	'date_une_minute' => 'minuto',
207
-	'date_une_seconde' => 'segundo',
208
-	'date_une_semaine' => 'semana',
209
-	'dirs_commencer' => 'a fim de começar realmente a instalação',
210
-	'dirs_preliminaire' => 'Preliminar : <b>Configurar os direitos de acesso</b>',
211
-	'dirs_probleme_droits' => 'Problema de direitos de acesso',
212
-	'dirs_repertoires_absents' => '<b>Os seguintes directórios não foram encontrados : <ul>@bad_dirs@.</ul> </b>
84
+    // D
85
+    'date_aujourdhui' => 'hoje',
86
+    'date_avant_jc' => 'a. J.C.',
87
+    'date_dans' => 'entre @delai@',
88
+    'date_de_mois_1' => '@j@ de @nommois@',
89
+    'date_de_mois_10' => '@j@ de @nommois@',
90
+    'date_de_mois_11' => '@j@ de @nommois@',
91
+    'date_de_mois_12' => '@j@ de @nommois@',
92
+    'date_de_mois_2' => '@j@ de @nommois@',
93
+    'date_de_mois_3' => '@j@ de @nommois@',
94
+    'date_de_mois_4' => '@j@ de @nommois@',
95
+    'date_de_mois_5' => '@j@ de @nommois@',
96
+    'date_de_mois_6' => '@j@ de @nommois@',
97
+    'date_de_mois_7' => '@j@ de @nommois@',
98
+    'date_de_mois_8' => '@j@ de @nommois@',
99
+    'date_de_mois_9' => '@j@ de @nommois@',
100
+    'date_demain' => 'amanhã',
101
+    'date_fmt_heures_minutes' => '@h@h@m@min',
102
+    'date_fmt_heures_minutes_court' => '@h@:@m@',
103
+    'date_fmt_jour' => '@nomjour@ @jour@',
104
+    'date_fmt_jour_heure' => '@jour@ a @heure@',
105
+    'date_fmt_jour_heure_debut_fin' => '@jour@ de @heure_debut@ a @heure_fin@', # MODIF
106
+    'date_fmt_jour_heure_debut_fin_abbr' => '@dtstart@@jour@ de @heure_debut@@dtabbr@ a @dtstart@@heure_fin@@dtend@', # MODIF
107
+    'date_fmt_jour_mois' => '@jour@ de @nommois@',
108
+    'date_fmt_jour_mois_annee' => '@jour@ de @nommois@ de @annee@',
109
+    'date_fmt_mois_annee' => '@nommois@ de @annee@',
110
+    'date_fmt_nomjour' => '@nomjour@ @date@',
111
+    'date_fmt_nomjour_date' => ' @nomjour@ @date@',
112
+    'date_fmt_periode' => 'De @date_debut@ a @date_fin@',
113
+    'date_fmt_periode_abbr' => 'De @dtart@@date_debut@@dtabbr@ a @dtend@@date_fin@@dtabbr@',
114
+    'date_fmt_periode_from' => 'De',
115
+    'date_fmt_periode_to' => 'a',
116
+    'date_heures' => 'horas',
117
+    'date_hier' => 'ontem',
118
+    'date_il_y_a' => 'há @delai@',
119
+    'date_jnum1' => '1',
120
+    'date_jnum10' => '10',
121
+    'date_jnum11' => '11',
122
+    'date_jnum12' => '12',
123
+    'date_jnum13' => '13',
124
+    'date_jnum14' => '14',
125
+    'date_jnum15' => '15',
126
+    'date_jnum16' => '16',
127
+    'date_jnum17' => '17',
128
+    'date_jnum18' => '18',
129
+    'date_jnum19' => '19',
130
+    'date_jnum2' => '2',
131
+    'date_jnum20' => '20',
132
+    'date_jnum21' => '21',
133
+    'date_jnum22' => '22',
134
+    'date_jnum23' => '23',
135
+    'date_jnum24' => '24',
136
+    'date_jnum25' => '25',
137
+    'date_jnum26' => '26',
138
+    'date_jnum27' => '27',
139
+    'date_jnum28' => '28',
140
+    'date_jnum29' => '29',
141
+    'date_jnum3' => '3',
142
+    'date_jnum30' => '30',
143
+    'date_jnum31' => '31',
144
+    'date_jnum4' => '4',
145
+    'date_jnum5' => '5',
146
+    'date_jnum6' => '6',
147
+    'date_jnum7' => '7',
148
+    'date_jnum8' => '8',
149
+    'date_jnum9' => '9',
150
+    'date_jour_1' => 'domingo',
151
+    'date_jour_1_abbr' => 'Dom.',
152
+    'date_jour_1_initiale' => 'D.',
153
+    'date_jour_2' => 'segunda-feira',
154
+    'date_jour_2_abbr' => 'Seg.',
155
+    'date_jour_2_initiale' => 'S.',
156
+    'date_jour_3' => 'terça-feira',
157
+    'date_jour_3_abbr' => 'Ter.',
158
+    'date_jour_3_initiale' => 'T.',
159
+    'date_jour_4' => 'quarta-feira',
160
+    'date_jour_4_abbr' => 'Qua.',
161
+    'date_jour_4_initiale' => 'Q.',
162
+    'date_jour_5' => 'quinta-feira',
163
+    'date_jour_5_abbr' => 'Qui.',
164
+    'date_jour_5_initiale' => 'Q.',
165
+    'date_jour_6' => 'sexta-feira',
166
+    'date_jour_6_abbr' => 'Sex.',
167
+    'date_jour_6_initiale' => 'S.',
168
+    'date_jour_7' => 'sábado',
169
+    'date_jour_7_abbr' => 'Sab.',
170
+    'date_jour_7_initiale' => 'S.',
171
+    'date_jours' => 'dias',
172
+    'date_minutes' => 'minutos',
173
+    'date_mois' => 'meses',
174
+    'date_mois_1' => 'Janeiro',
175
+    'date_mois_10' => 'Outubro',
176
+    'date_mois_10_abbr' => 'Out.',
177
+    'date_mois_11' => 'Novembro',
178
+    'date_mois_11_abbr' => 'Nov.',
179
+    'date_mois_12' => 'Dezembro',
180
+    'date_mois_12_abbr' => 'Dez.',
181
+    'date_mois_1_abbr' => 'Jan.',
182
+    'date_mois_2' => 'Fevereiro',
183
+    'date_mois_2_abbr' => 'Feb.',
184
+    'date_mois_3' => 'Março',
185
+    'date_mois_3_abbr' => 'Mar',
186
+    'date_mois_4' => 'Abril',
187
+    'date_mois_4_abbr' => 'Abr.',
188
+    'date_mois_5' => 'Maio',
189
+    'date_mois_5_abbr' => 'Mai',
190
+    'date_mois_6' => 'Junho',
191
+    'date_mois_6_abbr' => 'Jun',
192
+    'date_mois_7' => 'Julho',
193
+    'date_mois_7_abbr' => 'Jul',
194
+    'date_mois_8' => 'Agosto',
195
+    'date_mois_8_abbr' => 'Ago',
196
+    'date_mois_9' => 'Setembro',
197
+    'date_mois_9_abbr' => 'Set',
198
+    'date_saison_1' => 'inverno',
199
+    'date_saison_2' => 'primavera',
200
+    'date_saison_3' => 'verão',
201
+    'date_saison_4' => 'outono',
202
+    'date_secondes' => 'segundos',
203
+    'date_semaines' => 'semanas',
204
+    'date_un_mois' => 'mês',
205
+    'date_une_heure' => 'hora',
206
+    'date_une_minute' => 'minuto',
207
+    'date_une_seconde' => 'segundo',
208
+    'date_une_semaine' => 'semana',
209
+    'dirs_commencer' => 'a fim de começar realmente a instalação',
210
+    'dirs_preliminaire' => 'Preliminar : <b>Configurar os direitos de acesso</b>',
211
+    'dirs_probleme_droits' => 'Problema de direitos de acesso',
212
+    'dirs_repertoires_absents' => '<b>Os seguintes directórios não foram encontrados : <ul>@bad_dirs@.</ul> </b>
213 213
   <p>É provável que resulte de um problema de má colocação de maiúsculas ou minúsculas.
214 214
   Verifique que as minúsculas e maiúsculas destes directórios concordam com o que está exibido
215 215
  acima; se não for o caso, renomeie os repertórios com o seu software FTP de modo a corrigir o erro.
216 216
   <p>Terminada esta operação, poderá</p>',
217
-	'dirs_repertoires_suivants' => '<b>Os seguintes directórios não estão acessíveis para escrita: <ul>@bad_dirs@.</ul> </b>
217
+    'dirs_repertoires_suivants' => '<b>Os seguintes directórios não estão acessíveis para escrita: <ul>@bad_dirs@.</ul> </b>
218 218
   <p>Para corrigir, utilize o seu programa de FTP para configurar os direitos de acesso de cada um
219 219
   destes directórios. O procedimento está explicado em detalhe no manual de instalação.
220 220
   <p>Uma vez efectuada esta alteração, poderá',
221
-	'double_occurrence' => 'Dupla ocorrência de @balise@',
221
+    'double_occurrence' => 'Dupla ocorrência de @balise@',
222 222
 
223
-	// E
224
-	'en_cours' => 'em curso',
225
-	'envoi_via_le_site' => 'Envio pelo sítio',
226
-	'erreur' => 'Erro',
227
-	'erreur_balise_non_fermee' => 'última tag não fechada :',
228
-	'erreur_technique_ajaxform' => 'Ooops. Uum erro inesperado impediu o formulário de ser enviado. Por favor tente novamente.',
229
-	'erreur_technique_enregistrement_champs' => 'Um erro técnico impediu o registo correcto do campo @champs@.',
230
-	'erreur_technique_enregistrement_impossible' => 'Um erro técnico impediu o registo.',
231
-	'erreur_texte' => 'erro(s)',
232
-	'etape' => 'Etapa',
223
+    // E
224
+    'en_cours' => 'em curso',
225
+    'envoi_via_le_site' => 'Envio pelo sítio',
226
+    'erreur' => 'Erro',
227
+    'erreur_balise_non_fermee' => 'última tag não fechada :',
228
+    'erreur_technique_ajaxform' => 'Ooops. Uum erro inesperado impediu o formulário de ser enviado. Por favor tente novamente.',
229
+    'erreur_technique_enregistrement_champs' => 'Um erro técnico impediu o registo correcto do campo @champs@.',
230
+    'erreur_technique_enregistrement_impossible' => 'Um erro técnico impediu o registo.',
231
+    'erreur_texte' => 'erro(s)',
232
+    'etape' => 'Etapa',
233 233
 
234
-	// F
235
-	'fichier_introuvable' => 'Ficheiro @fichier@ não localizado', # MODIF
236
-	'form_auteur_confirmation' => 'Confirme o seu endereço e-mail',
237
-	'form_auteur_email_modifie' => 'O seu endereço e-mail foi alterado.',
238
-	'form_auteur_envoi_mail_confirmation' => 'Um e-mail de confirmação foi enviado para @email@. Para validar o seu endereço de e-mail, deve abrir o endereço Web mencionado na mensagem.',
239
-	'form_auteur_mail_confirmation' => 'Olá,
234
+    // F
235
+    'fichier_introuvable' => 'Ficheiro @fichier@ não localizado', # MODIF
236
+    'form_auteur_confirmation' => 'Confirme o seu endereço e-mail',
237
+    'form_auteur_email_modifie' => 'O seu endereço e-mail foi alterado.',
238
+    'form_auteur_envoi_mail_confirmation' => 'Um e-mail de confirmação foi enviado para @email@. Para validar o seu endereço de e-mail, deve abrir o endereço Web mencionado na mensagem.',
239
+    'form_auteur_mail_confirmation' => 'Olá,
240 240
 
241 241
 Pediu para alterar o seu endereço e-mail. Para confirmar o seu novo endereço, precisa de se conectar ao endereço abaixo (caso contrário, o seu pedido será ignorado) :
242 242
 
243 243
     @url@
244 244
 ',
245
-	'form_deja_inscrit' => 'Já está inscrito.',
246
-	'form_email_non_valide' => 'O seu endereço email não é válido',
247
-	'form_forum_access_refuse' => 'Você já não tem acesso a este sítio',
248
-	'form_forum_bonjour' => 'Bom dia @nom@,',
249
-	'form_forum_confirmer_email' => 'Para confirmar o seu endereço e-maill, abra esta ligação : @url_confirm@',
250
-	'form_forum_email_deja_enregistre' => 'Este endereço e-mail já está registado,pode portanto utilizar a sua palavra-passe habitual',
251
-	'form_forum_identifiant_mail' => 'O seu novo identificador acabou de lhe ser enviado por email.',
252
-	'form_forum_identifiants' => 'Identificadores pessoais',
253
-	'form_forum_indiquer_nom_email' => 'Indicar aqui o seu nome e o seu endereço email. O seu identificador pessoal ser-lhe-á enviado rapidamente por correio electrónico.',
254
-	'form_forum_login' => 'login:',
255
-	'form_forum_message_auto' => '(esta é uma mensagem automática)',
256
-	'form_forum_pass' => 'palavra-passe',
257
-	'form_forum_probleme_mail' => 'Problema de mail :o identificador não pôde ser enviado',
258
-	'form_forum_voici1' => 'Aqui estão os seus dados para poder aceder ao sítio Internet do  "@nom_site_spip@" (@adresse_site@):',
259
-	'form_forum_voici2' => 'Eis os seus identificadores para propor artigos no
245
+    'form_deja_inscrit' => 'Já está inscrito.',
246
+    'form_email_non_valide' => 'O seu endereço email não é válido',
247
+    'form_forum_access_refuse' => 'Você já não tem acesso a este sítio',
248
+    'form_forum_bonjour' => 'Bom dia @nom@,',
249
+    'form_forum_confirmer_email' => 'Para confirmar o seu endereço e-maill, abra esta ligação : @url_confirm@',
250
+    'form_forum_email_deja_enregistre' => 'Este endereço e-mail já está registado,pode portanto utilizar a sua palavra-passe habitual',
251
+    'form_forum_identifiant_mail' => 'O seu novo identificador acabou de lhe ser enviado por email.',
252
+    'form_forum_identifiants' => 'Identificadores pessoais',
253
+    'form_forum_indiquer_nom_email' => 'Indicar aqui o seu nome e o seu endereço email. O seu identificador pessoal ser-lhe-á enviado rapidamente por correio electrónico.',
254
+    'form_forum_login' => 'login:',
255
+    'form_forum_message_auto' => '(esta é uma mensagem automática)',
256
+    'form_forum_pass' => 'palavra-passe',
257
+    'form_forum_probleme_mail' => 'Problema de mail :o identificador não pôde ser enviado',
258
+    'form_forum_voici1' => 'Aqui estão os seus dados para poder aceder ao sítio Internet do  "@nom_site_spip@" (@adresse_site@):',
259
+    'form_forum_voici2' => 'Eis os seus identificadores para propor artigos no
260 260
  sítio "@nom_site_spip@" (@adresse_login@):',
261
-	'form_indiquer_email' => 'Por favor indique o seu endereço email.',
262
-	'form_indiquer_nom' => 'Por favor indique o seu nome.',
263
-	'form_indiquer_nom_site' => 'Por favor indique o nome do seu sítio.',
264
-	'form_pet_deja_enregistre' => 'Este sítio já está registado',
265
-	'form_pet_signature_pasprise' => 'A sua assinatura não está tomada em conta.',
266
-	'form_prop_confirmer_envoi' => 'Confirmar o envio',
267
-	'form_prop_description' => 'Descrição/comentário',
268
-	'form_prop_enregistre' => 'A sua proposta foi registada. Aparecerá online após a validação pelos responsáveis deste sítio.',
269
-	'form_prop_envoyer' => 'Enviar uma mensagem',
270
-	'form_prop_indiquer_email' => 'Por favor indique um endereço email válido',
271
-	'form_prop_indiquer_nom_site' => 'Por favor indique o nome do sítio.',
272
-	'form_prop_indiquer_sujet' => 'Por favor indique um tema',
273
-	'form_prop_message_envoye' => 'Mensagem enviada',
274
-	'form_prop_non_enregistre' => 'A sua proposta não foi registada.',
275
-	'form_prop_sujet' => 'Tema',
276
-	'form_prop_url_site' => 'Endereço (URL) do sítio',
277
-	'forum_non_inscrit' => 'Não está inscrito, ou o endereço ou a palavra-passe estão errados.',
278
-	'forum_par_auteur' => 'por @auteur@',
279
-	'forum_titre_erreur' => 'Erro...',
261
+    'form_indiquer_email' => 'Por favor indique o seu endereço email.',
262
+    'form_indiquer_nom' => 'Por favor indique o seu nome.',
263
+    'form_indiquer_nom_site' => 'Por favor indique o nome do seu sítio.',
264
+    'form_pet_deja_enregistre' => 'Este sítio já está registado',
265
+    'form_pet_signature_pasprise' => 'A sua assinatura não está tomada em conta.',
266
+    'form_prop_confirmer_envoi' => 'Confirmar o envio',
267
+    'form_prop_description' => 'Descrição/comentário',
268
+    'form_prop_enregistre' => 'A sua proposta foi registada. Aparecerá online após a validação pelos responsáveis deste sítio.',
269
+    'form_prop_envoyer' => 'Enviar uma mensagem',
270
+    'form_prop_indiquer_email' => 'Por favor indique um endereço email válido',
271
+    'form_prop_indiquer_nom_site' => 'Por favor indique o nome do sítio.',
272
+    'form_prop_indiquer_sujet' => 'Por favor indique um tema',
273
+    'form_prop_message_envoye' => 'Mensagem enviada',
274
+    'form_prop_non_enregistre' => 'A sua proposta não foi registada.',
275
+    'form_prop_sujet' => 'Tema',
276
+    'form_prop_url_site' => 'Endereço (URL) do sítio',
277
+    'forum_non_inscrit' => 'Não está inscrito, ou o endereço ou a palavra-passe estão errados.',
278
+    'forum_par_auteur' => 'por @auteur@',
279
+    'forum_titre_erreur' => 'Erro...',
280 280
 
281
-	// I
282
-	'ical_texte_rss_articles' => 'O ficheiro «backend» dos artigos deste sítio encontra-se neste endereço:',
283
-	'ical_texte_rss_articles2' => 'Pode igualmente obter os ficheiros «backend» para os artigos de cada rubrica do sítio:',
284
-	'ical_texte_rss_breves' => 'Existe também um ficheiro contendo notícias do sítio. Especificando um número de rubrica, obterá unicamente as notícias dessa rubrica.',
285
-	'icone_a_suivre' => 'Continua',
286
-	'icone_admin_site' => 'Administração do sítio',
287
-	'icone_agenda' => 'Agenda e correio',
288
-	'icone_aide_ligne' => 'Ajuda',
289
-	'icone_articles' => 'Artigos',
290
-	'icone_auteurs' => 'Autores',
291
-	'icone_brouteur' => 'Navegação rápida',
292
-	'icone_configuration_site' => 'Configuração',
293
-	'icone_configurer_site' => 'Configurar o seu sítio',
294
-	'icone_creer_nouvel_auteur' => 'Criar um novo autor',
295
-	'icone_creer_rubrique' => 'Criar uma rubrica',
296
-	'icone_creer_sous_rubrique' => 'Criar uma sub-rubrica',
297
-	'icone_deconnecter' => 'Sair',
298
-	'icone_discussions' => 'Discussões',
299
-	'icone_doc_rubrique' => 'Documentos das rubricas',
300
-	'icone_ecrire_article' => 'Escrever um novo artigo',
301
-	'icone_edition_site' => 'Edição',
302
-	'icone_gestion_langues' => 'Opções de idiomas',
303
-	'icone_informations_personnelles' => 'Informações pessoais',
304
-	'icone_interface_complet' => 'interface completa',
305
-	'icone_interface_simple' => 'Interface simplificada',
306
-	'icone_maintenance_site' => 'Manutenção do sítio',
307
-	'icone_messagerie_personnelle' => 'Mensagens privadas',
308
-	'icone_repartition_debut' => 'Exibir a distribuição desde o início',
309
-	'icone_rubriques' => 'Rubricas',
310
-	'icone_sauver_site' => 'Cópia de segurança do sítio',
311
-	'icone_site_entier' => 'Todo o sítio',
312
-	'icone_sites_references' => 'Sítios referenciados',
313
-	'icone_statistiques' => 'Estatísticas do sítio',
314
-	'icone_suivi_activite' => 'Acompanhar a actividade do sítio',
315
-	'icone_suivi_actualite' => 'Evolução do sítio',
316
-	'icone_suivi_pettions' => 'Seguir/gerir os abaixo-assinados',
317
-	'icone_suivi_revisions' => 'Modificações dos artigos',
318
-	'icone_supprimer_document' => 'Suprimir este documento',
319
-	'icone_supprimer_image' => 'Suprimir esta imagem',
320
-	'icone_tous_articles' => 'Todos os seus artigos',
321
-	'icone_tous_auteur' => 'Todos os autores',
322
-	'icone_tous_visiteur' => 'Todos os visitantes',
323
-	'icone_visiter_site' => 'Visitar o sítio público',
324
-	'icone_voir_en_ligne' => 'Ver online',
325
-	'img_indisponible' => 'imagem indisponível',
326
-	'impossible' => 'impossível',
327
-	'info_a_suivre' => 'A SEGUIR »',
328
-	'info_acces_interdit' => 'Acesso proibido',
329
-	'info_acces_refuse' => 'Acesso recusado',
330
-	'info_action' => 'Acção : @action@',
331
-	'info_administrer_rubriques' => 'Pode administrar esta rubrica e as suas sub-rubricas',
332
-	'info_adresse_non_indiquee' => 'Não indicou endereço a testar !',
333
-	'info_aide' => 'AJUDA',
334
-	'info_ajouter_mot' => 'Acrescentar esta palavra',
335
-	'info_annonce' => 'ANÚNCIO',
336
-	'info_annonces_generales' => 'Anúncios gerais :',
337
-	'info_article_propose' => 'Artigo proposto',
338
-	'info_article_publie' => 'Artigo publicado',
339
-	'info_article_redaction' => 'Artigo em curso de redacção',
340
-	'info_article_refuse' => 'Artigo recusado',
341
-	'info_article_supprime' => 'Artigo suprimido',
342
-	'info_articles' => 'Artigos',
343
-	'info_articles_a_valider' => 'Os artigos a validar',
344
-	'info_articles_nb' => '@nb@ artigos',
345
-	'info_articles_proposes' => 'Artigos propostos',
346
-	'info_articles_un' => '1 artigo',
347
-	'info_auteurs_nombre' => 'autor(es) :',
348
-	'info_authentification_ftp' => 'Autenticação (por FTP)',
349
-	'info_breves_2' => 'notícias',
350
-	'info_breves_nb' => '@nb@ notícias',
351
-	'info_breves_un' => '1 notícia',
352
-	'info_connexion_refusee' => 'Ligação recusada',
353
-	'info_contact_developpeur' => 'Por favor contacte um programador',
354
-	'info_contenance' => 'Este sítio contém:',
355
-	'info_contribution' => 'contribuições de fórum',
356
-	'info_copyright' => '@spip@ é um software livre distribuído @lien_gpl@.',
357
-	'info_copyright_doc' => 'Para mais informações, visite o sítio <a href="@spipnet@">@spipnet_affiche@</a',
358
-	'info_copyright_gpl' => 'sob licença GPL',
359
-	'info_cours_edition' => 'Os seus artigos em curso de redacção', # MODIF
360
-	'info_creer_repertoire' => 'Por favor crie um ficheiro ou um directório chamado :',
361
-	'info_creer_repertoire_2' => 'dentro do sub-directório <b>@repertoire@</b>, depois :',
362
-	'info_creer_vignette' => 'criação automática de miniatura',
363
-	'info_creerdansrubrique_non_autorise' => 'Não tem direitos suficientes para criar conteúdo nesta rubrica.',
364
-	'info_deplier' => 'Desenvolver',
365
-	'info_descriptif_nombre' => 'descritivo(s) :',
366
-	'info_description' => 'Descrição :',
367
-	'info_description_2' => 'Descrição :',
368
-	'info_dimension' => 'Dimensões :',
369
-	'info_documents_nb' => '@nb@ documentos',
370
-	'info_documents_un' => '1 documento',
371
-	'info_ecire_message_prive' => 'Escrever uma mensagem privada',
372
-	'info_email_invalide' => 'Endereço email inválido.',
373
-	'info_en_cours_validation' => 'Os seus artigos em curso de redação',
374
-	'info_en_ligne' => 'Actualmente online:',
375
-	'info_envoyer_message_prive' => 'Enviar uma mensagem privada a este autor',
376
-	'info_erreur_requete' => 'Erro no pedido :',
377
-	'info_erreur_squelette2' => 'Modelo <b>@fichier@</b> não disponível...',
378
-	'info_erreur_systeme' => 'Erro de Sistema (errno @errsys@)',
379
-	'info_erreur_systeme2' => 'O disco rígido poderá estar cheio, ou a base de dados danificada.<br />
281
+    // I
282
+    'ical_texte_rss_articles' => 'O ficheiro «backend» dos artigos deste sítio encontra-se neste endereço:',
283
+    'ical_texte_rss_articles2' => 'Pode igualmente obter os ficheiros «backend» para os artigos de cada rubrica do sítio:',
284
+    'ical_texte_rss_breves' => 'Existe também um ficheiro contendo notícias do sítio. Especificando um número de rubrica, obterá unicamente as notícias dessa rubrica.',
285
+    'icone_a_suivre' => 'Continua',
286
+    'icone_admin_site' => 'Administração do sítio',
287
+    'icone_agenda' => 'Agenda e correio',
288
+    'icone_aide_ligne' => 'Ajuda',
289
+    'icone_articles' => 'Artigos',
290
+    'icone_auteurs' => 'Autores',
291
+    'icone_brouteur' => 'Navegação rápida',
292
+    'icone_configuration_site' => 'Configuração',
293
+    'icone_configurer_site' => 'Configurar o seu sítio',
294
+    'icone_creer_nouvel_auteur' => 'Criar um novo autor',
295
+    'icone_creer_rubrique' => 'Criar uma rubrica',
296
+    'icone_creer_sous_rubrique' => 'Criar uma sub-rubrica',
297
+    'icone_deconnecter' => 'Sair',
298
+    'icone_discussions' => 'Discussões',
299
+    'icone_doc_rubrique' => 'Documentos das rubricas',
300
+    'icone_ecrire_article' => 'Escrever um novo artigo',
301
+    'icone_edition_site' => 'Edição',
302
+    'icone_gestion_langues' => 'Opções de idiomas',
303
+    'icone_informations_personnelles' => 'Informações pessoais',
304
+    'icone_interface_complet' => 'interface completa',
305
+    'icone_interface_simple' => 'Interface simplificada',
306
+    'icone_maintenance_site' => 'Manutenção do sítio',
307
+    'icone_messagerie_personnelle' => 'Mensagens privadas',
308
+    'icone_repartition_debut' => 'Exibir a distribuição desde o início',
309
+    'icone_rubriques' => 'Rubricas',
310
+    'icone_sauver_site' => 'Cópia de segurança do sítio',
311
+    'icone_site_entier' => 'Todo o sítio',
312
+    'icone_sites_references' => 'Sítios referenciados',
313
+    'icone_statistiques' => 'Estatísticas do sítio',
314
+    'icone_suivi_activite' => 'Acompanhar a actividade do sítio',
315
+    'icone_suivi_actualite' => 'Evolução do sítio',
316
+    'icone_suivi_pettions' => 'Seguir/gerir os abaixo-assinados',
317
+    'icone_suivi_revisions' => 'Modificações dos artigos',
318
+    'icone_supprimer_document' => 'Suprimir este documento',
319
+    'icone_supprimer_image' => 'Suprimir esta imagem',
320
+    'icone_tous_articles' => 'Todos os seus artigos',
321
+    'icone_tous_auteur' => 'Todos os autores',
322
+    'icone_tous_visiteur' => 'Todos os visitantes',
323
+    'icone_visiter_site' => 'Visitar o sítio público',
324
+    'icone_voir_en_ligne' => 'Ver online',
325
+    'img_indisponible' => 'imagem indisponível',
326
+    'impossible' => 'impossível',
327
+    'info_a_suivre' => 'A SEGUIR »',
328
+    'info_acces_interdit' => 'Acesso proibido',
329
+    'info_acces_refuse' => 'Acesso recusado',
330
+    'info_action' => 'Acção : @action@',
331
+    'info_administrer_rubriques' => 'Pode administrar esta rubrica e as suas sub-rubricas',
332
+    'info_adresse_non_indiquee' => 'Não indicou endereço a testar !',
333
+    'info_aide' => 'AJUDA',
334
+    'info_ajouter_mot' => 'Acrescentar esta palavra',
335
+    'info_annonce' => 'ANÚNCIO',
336
+    'info_annonces_generales' => 'Anúncios gerais :',
337
+    'info_article_propose' => 'Artigo proposto',
338
+    'info_article_publie' => 'Artigo publicado',
339
+    'info_article_redaction' => 'Artigo em curso de redacção',
340
+    'info_article_refuse' => 'Artigo recusado',
341
+    'info_article_supprime' => 'Artigo suprimido',
342
+    'info_articles' => 'Artigos',
343
+    'info_articles_a_valider' => 'Os artigos a validar',
344
+    'info_articles_nb' => '@nb@ artigos',
345
+    'info_articles_proposes' => 'Artigos propostos',
346
+    'info_articles_un' => '1 artigo',
347
+    'info_auteurs_nombre' => 'autor(es) :',
348
+    'info_authentification_ftp' => 'Autenticação (por FTP)',
349
+    'info_breves_2' => 'notícias',
350
+    'info_breves_nb' => '@nb@ notícias',
351
+    'info_breves_un' => '1 notícia',
352
+    'info_connexion_refusee' => 'Ligação recusada',
353
+    'info_contact_developpeur' => 'Por favor contacte um programador',
354
+    'info_contenance' => 'Este sítio contém:',
355
+    'info_contribution' => 'contribuições de fórum',
356
+    'info_copyright' => '@spip@ é um software livre distribuído @lien_gpl@.',
357
+    'info_copyright_doc' => 'Para mais informações, visite o sítio <a href="@spipnet@">@spipnet_affiche@</a',
358
+    'info_copyright_gpl' => 'sob licença GPL',
359
+    'info_cours_edition' => 'Os seus artigos em curso de redacção', # MODIF
360
+    'info_creer_repertoire' => 'Por favor crie um ficheiro ou um directório chamado :',
361
+    'info_creer_repertoire_2' => 'dentro do sub-directório <b>@repertoire@</b>, depois :',
362
+    'info_creer_vignette' => 'criação automática de miniatura',
363
+    'info_creerdansrubrique_non_autorise' => 'Não tem direitos suficientes para criar conteúdo nesta rubrica.',
364
+    'info_deplier' => 'Desenvolver',
365
+    'info_descriptif_nombre' => 'descritivo(s) :',
366
+    'info_description' => 'Descrição :',
367
+    'info_description_2' => 'Descrição :',
368
+    'info_dimension' => 'Dimensões :',
369
+    'info_documents_nb' => '@nb@ documentos',
370
+    'info_documents_un' => '1 documento',
371
+    'info_ecire_message_prive' => 'Escrever uma mensagem privada',
372
+    'info_email_invalide' => 'Endereço email inválido.',
373
+    'info_en_cours_validation' => 'Os seus artigos em curso de redação',
374
+    'info_en_ligne' => 'Actualmente online:',
375
+    'info_envoyer_message_prive' => 'Enviar uma mensagem privada a este autor',
376
+    'info_erreur_requete' => 'Erro no pedido :',
377
+    'info_erreur_squelette2' => 'Modelo <b>@fichier@</b> não disponível...',
378
+    'info_erreur_systeme' => 'Erro de Sistema (errno @errsys@)',
379
+    'info_erreur_systeme2' => 'O disco rígido poderá estar cheio, ou a base de dados danificada.<br />
380 380
 <span style="color:red;">Tente <a href=\'@script@\'>reparar a base de dados </a>, ou contacte o seu fornecedor de internet.</span>',
381
-	'info_fini' => 'Terminou !',
382
-	'info_format_image' => 'Formatos de imagens que podem ser utilizadas para criar vinhetas : @gd_formats@.',
383
-	'info_format_non_defini' => 'formato não definido',
384
-	'info_grand_ecran' => 'Ecrã total',
385
-	'info_image_aide' => 'AJUDA',
386
-	'info_image_process_titre' => 'Como criar miniaturas',
387
-	'info_impossible_lire_page' => '<b>Erro !</b> Impossível ler a página<tt><html>@test_proxy@</html></tt> através do proxy <tt>',
388
-	'info_installation_systeme_publication' => 'Instalação do sistema de publicação',
389
-	'info_installer_documents' => 'Pode instalar automaticamente todos os documentos contidos na pasta @upload@.',
390
-	'info_installer_ftp' => 'Como administrador, pode instalar (por FTP) ficheiros na pasta @upload@ para depois seleccioná-los directamente aqui.',
391
-	'info_installer_images' => 'Pode instalar imagens nos formatos JPEG, GIF e PNG.',
392
-	'info_installer_images_dossier' => 'Instalar imagens na pasta @upload@ para poder seleccioná-los aqui.',
393
-	'info_interface_complete' => 'Interface completa',
394
-	'info_interface_simple' => 'Interface simplificada',
395
-	'info_joindre_document_article' => 'Pode juntar a este artigo documentos de tipo',
396
-	'info_joindre_document_rubrique' => 'Pode acrescentar a esta rubrica documentos de tipo',
397
-	'info_joindre_documents_article' => 'Pode juntar ao seu artigo documentos de tipo :',
398
-	'info_l_article' => 'o artigo',
399
-	'info_la_breve' => 'a notícia',
400
-	'info_la_rubrique' => 'a rubrica',
401
-	'info_langue_principale' => 'Idioma principal do sítio',
402
-	'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ pixels',
403
-	'info_les_auteurs_1' => 'por @les_auteurs@',
404
-	'info_logo_format_interdit' => 'Apenas os ícones nos formatos @formats@ estão autorizados.',
405
-	'info_logo_max_poids' => 'Os ícones devem obrigatoriamente ter menos de @maxi@ (este arquivo tem @actuel@).',
406
-	'info_mail_fournisseur' => 'você@seucorreio.com',
407
-	'info_message_2' => 'MENSAGEM',
408
-	'info_message_supprime' => 'MENSAGEM ELIMINADA',
409
-	'info_messages_nb' => '@nb@ mensagens',
410
-	'info_messages_un' => '1 mensagem',
411
-	'info_mise_en_ligne' => 'Data de colocação online :',
412
-	'info_modification_parametres_securite' => 'modificação dos parâmetros de segurança',
413
-	'info_mois_courant' => 'Durante o mês :',
414
-	'info_mot_cle_ajoute' => 'A seguinte palavra-chave foi acrescentada a',
415
-	'info_multi_herit' => 'Idioma por defeito',
416
-	'info_multi_langues_soulignees' => 'Os <u>idiomas sublinhadas</u> beneficiam de uma tradução de todos os textos da interface. Se seleccionar esses idiomas, muitos elementos do sítio público (datas, formulários) serão automaticamente traduzidos. Para os idiomas não sublinhadas, esses elementos aparecerão no idioma principal do sítio.',
417
-	'info_multilinguisme' => 'Multilinguismo',
418
-	'info_nom_non_utilisateurs_connectes' => 'O seu nome não aparece na lista dos utilizadores ligados.',
419
-	'info_nom_utilisateurs_connectes' => 'O seu nome aparece na lista dos utilizadores ligados.',
420
-	'info_nombre_en_ligne' => 'Actualmente online :',
421
-	'info_non_resultat' => 'Nenhum resultado para "@cherche_mot@"',
422
-	'info_non_utilisation_messagerie' => 'Não utiliza o correio interno deste sítio.',
423
-	'info_nouveau_message' => 'TEM UMA NOVA MENSAGEM',
424
-	'info_nouveaux_messages' => 'TEM @total_messages@ NOVAS MENSAGENS',
425
-	'info_numero_abbreviation' => '<N° >',
426
-	'info_obligatoire' => 'Esta informação é obrigatória',
427
-	'info_pense_bete' => 'MEMORANDO',
428
-	'info_petit_ecran' => 'Ecrã Pequeno',
429
-	'info_petition_close' => 'Petição encerrada',
430
-	'info_pixels' => 'pixels',
431
-	'info_plusieurs_mots_trouves' => 'Muitas palavras-chave encontradas para "@cherche_mot@":',
432
-	'info_portfolio_automatique' => 'Portfolio automático :',
433
-	'info_premier_resultat' => '[@debut_limit@ primeiros resultados em @total@]',
434
-	'info_premier_resultat_sur' => '[@debut_limit@ primeiros resultados em @total@]',
435
-	'info_propose_1' => '[@nom_site_spip@] Proposto : @titre@',
436
-	'info_propose_2' => 'Artigos propostos
381
+    'info_fini' => 'Terminou !',
382
+    'info_format_image' => 'Formatos de imagens que podem ser utilizadas para criar vinhetas : @gd_formats@.',
383
+    'info_format_non_defini' => 'formato não definido',
384
+    'info_grand_ecran' => 'Ecrã total',
385
+    'info_image_aide' => 'AJUDA',
386
+    'info_image_process_titre' => 'Como criar miniaturas',
387
+    'info_impossible_lire_page' => '<b>Erro !</b> Impossível ler a página<tt><html>@test_proxy@</html></tt> através do proxy <tt>',
388
+    'info_installation_systeme_publication' => 'Instalação do sistema de publicação',
389
+    'info_installer_documents' => 'Pode instalar automaticamente todos os documentos contidos na pasta @upload@.',
390
+    'info_installer_ftp' => 'Como administrador, pode instalar (por FTP) ficheiros na pasta @upload@ para depois seleccioná-los directamente aqui.',
391
+    'info_installer_images' => 'Pode instalar imagens nos formatos JPEG, GIF e PNG.',
392
+    'info_installer_images_dossier' => 'Instalar imagens na pasta @upload@ para poder seleccioná-los aqui.',
393
+    'info_interface_complete' => 'Interface completa',
394
+    'info_interface_simple' => 'Interface simplificada',
395
+    'info_joindre_document_article' => 'Pode juntar a este artigo documentos de tipo',
396
+    'info_joindre_document_rubrique' => 'Pode acrescentar a esta rubrica documentos de tipo',
397
+    'info_joindre_documents_article' => 'Pode juntar ao seu artigo documentos de tipo :',
398
+    'info_l_article' => 'o artigo',
399
+    'info_la_breve' => 'a notícia',
400
+    'info_la_rubrique' => 'a rubrica',
401
+    'info_langue_principale' => 'Idioma principal do sítio',
402
+    'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ pixels',
403
+    'info_les_auteurs_1' => 'por @les_auteurs@',
404
+    'info_logo_format_interdit' => 'Apenas os ícones nos formatos @formats@ estão autorizados.',
405
+    'info_logo_max_poids' => 'Os ícones devem obrigatoriamente ter menos de @maxi@ (este arquivo tem @actuel@).',
406
+    'info_mail_fournisseur' => 'você@seucorreio.com',
407
+    'info_message_2' => 'MENSAGEM',
408
+    'info_message_supprime' => 'MENSAGEM ELIMINADA',
409
+    'info_messages_nb' => '@nb@ mensagens',
410
+    'info_messages_un' => '1 mensagem',
411
+    'info_mise_en_ligne' => 'Data de colocação online :',
412
+    'info_modification_parametres_securite' => 'modificação dos parâmetros de segurança',
413
+    'info_mois_courant' => 'Durante o mês :',
414
+    'info_mot_cle_ajoute' => 'A seguinte palavra-chave foi acrescentada a',
415
+    'info_multi_herit' => 'Idioma por defeito',
416
+    'info_multi_langues_soulignees' => 'Os <u>idiomas sublinhadas</u> beneficiam de uma tradução de todos os textos da interface. Se seleccionar esses idiomas, muitos elementos do sítio público (datas, formulários) serão automaticamente traduzidos. Para os idiomas não sublinhadas, esses elementos aparecerão no idioma principal do sítio.',
417
+    'info_multilinguisme' => 'Multilinguismo',
418
+    'info_nom_non_utilisateurs_connectes' => 'O seu nome não aparece na lista dos utilizadores ligados.',
419
+    'info_nom_utilisateurs_connectes' => 'O seu nome aparece na lista dos utilizadores ligados.',
420
+    'info_nombre_en_ligne' => 'Actualmente online :',
421
+    'info_non_resultat' => 'Nenhum resultado para "@cherche_mot@"',
422
+    'info_non_utilisation_messagerie' => 'Não utiliza o correio interno deste sítio.',
423
+    'info_nouveau_message' => 'TEM UMA NOVA MENSAGEM',
424
+    'info_nouveaux_messages' => 'TEM @total_messages@ NOVAS MENSAGENS',
425
+    'info_numero_abbreviation' => '<N° >',
426
+    'info_obligatoire' => 'Esta informação é obrigatória',
427
+    'info_pense_bete' => 'MEMORANDO',
428
+    'info_petit_ecran' => 'Ecrã Pequeno',
429
+    'info_petition_close' => 'Petição encerrada',
430
+    'info_pixels' => 'pixels',
431
+    'info_plusieurs_mots_trouves' => 'Muitas palavras-chave encontradas para "@cherche_mot@":',
432
+    'info_portfolio_automatique' => 'Portfolio automático :',
433
+    'info_premier_resultat' => '[@debut_limit@ primeiros resultados em @total@]',
434
+    'info_premier_resultat_sur' => '[@debut_limit@ primeiros resultados em @total@]',
435
+    'info_propose_1' => '[@nom_site_spip@] Proposto : @titre@',
436
+    'info_propose_2' => 'Artigos propostos
437 437
 ----------------',
438
-	'info_propose_3' => 'O artigo "@titre@" é proposto para publicação.',
439
-	'info_propose_4' => 'Está convidado a vir consultá-lo e a dar a sua opinião',
440
-	'info_propose_5' => 'no fórum que lhe está ligado. Está disponível no endereço:',
441
-	'info_publie_01' => 'O artigo "@titre@" foi validado por @connect_nom@.',
442
-	'info_publie_1' => '[@nom_site_spip@] PUBLICADO : @titre@',
443
-	'info_publie_2' => 'Artigo publicado
438
+    'info_propose_3' => 'O artigo "@titre@" é proposto para publicação.',
439
+    'info_propose_4' => 'Está convidado a vir consultá-lo e a dar a sua opinião',
440
+    'info_propose_5' => 'no fórum que lhe está ligado. Está disponível no endereço:',
441
+    'info_publie_01' => 'O artigo "@titre@" foi validado por @connect_nom@.',
442
+    'info_publie_1' => '[@nom_site_spip@] PUBLICADO : @titre@',
443
+    'info_publie_2' => 'Artigo publicado
444 444
 --------------',
445
-	'info_rechercher' => 'Procurar',
446
-	'info_rechercher_02' => 'Procurar :',
447
-	'info_remplacer_vignette' => 'Substituir a miniatura por defeito por um logotipo personalizado :',
448
-	'info_rubriques_nb' => '@nb@ rubricas',
449
-	'info_rubriques_un' => '1 rubrica',
450
-	'info_sans_titre_2' => 'sem título',
451
-	'info_selectionner_fichier' => 'Pode seleccionar um ficheiro da pasta @upload@',
452
-	'info_selectionner_fichier_2' => 'Seleccionar um ficheiro :',
453
-	'info_sites_nb' => '@nb@ sítios',
454
-	'info_sites_un' => '1 sítio',
455
-	'info_supprimer_vignette' => 'suprimir a miniatura',
456
-	'info_symbole_bleu' => 'O símbolo <b>azul</b> indica um<b>memorando </b>: isto é uma mensagem para o seu uso pessoal.',
457
-	'info_symbole_jaune' => 'O símbolo<b>amarelo</b> indica um <b>anúncio a todos os redactores</b> : modificável por todos os administradores, e visível por todos os redactores.',
458
-	'info_symbole_vert' => 'O símbolo<b>verde</b> indica as <b>mensagens trocadas com outros utilizadores</b> do sítio.',
459
-	'info_telecharger_nouveau_logo' => 'Telecarregar um novo logotipo :',
460
-	'info_telecharger_ordinateur' => 'Telecarregar do seu computador :',
461
-	'info_tous_resultats_enregistres' => '[todos os  resultados estão registados]',
462
-	'info_tout_afficher' => 'Exibir tudo',
463
-	'info_travaux_texte' => 'Este sítio ainda não está configurado. Volte mais tarde...',
464
-	'info_travaux_titre' => 'Sítio em construção',
465
-	'info_trop_resultat' => 'Demasiado resultados para "@cherche_mot@". Por favor afine a pesquisa.',
466
-	'info_utilisation_messagerie_interne' => 'Você utiliza o correio interno deste sítio.',
467
-	'info_valider_lien' => 'validar esta ligação',
468
-	'info_verifier_image' => ', Por favor verifique se as suas imagens foram transferidas correctamente.',
469
-	'info_vignette_defaut' => 'Miniatura por defeito',
470
-	'info_vignette_personnalisee' => 'Miniatura personalizada',
471
-	'info_visite' => 'visita :',
472
-	'info_vos_rendez_vous' => 'Os seus futuros encontros',
473
-	'infos_vos_pense_bete' => 'Os seus memorandos',
445
+    'info_rechercher' => 'Procurar',
446
+    'info_rechercher_02' => 'Procurar :',
447
+    'info_remplacer_vignette' => 'Substituir a miniatura por defeito por um logotipo personalizado :',
448
+    'info_rubriques_nb' => '@nb@ rubricas',
449
+    'info_rubriques_un' => '1 rubrica',
450
+    'info_sans_titre_2' => 'sem título',
451
+    'info_selectionner_fichier' => 'Pode seleccionar um ficheiro da pasta @upload@',
452
+    'info_selectionner_fichier_2' => 'Seleccionar um ficheiro :',
453
+    'info_sites_nb' => '@nb@ sítios',
454
+    'info_sites_un' => '1 sítio',
455
+    'info_supprimer_vignette' => 'suprimir a miniatura',
456
+    'info_symbole_bleu' => 'O símbolo <b>azul</b> indica um<b>memorando </b>: isto é uma mensagem para o seu uso pessoal.',
457
+    'info_symbole_jaune' => 'O símbolo<b>amarelo</b> indica um <b>anúncio a todos os redactores</b> : modificável por todos os administradores, e visível por todos os redactores.',
458
+    'info_symbole_vert' => 'O símbolo<b>verde</b> indica as <b>mensagens trocadas com outros utilizadores</b> do sítio.',
459
+    'info_telecharger_nouveau_logo' => 'Telecarregar um novo logotipo :',
460
+    'info_telecharger_ordinateur' => 'Telecarregar do seu computador :',
461
+    'info_tous_resultats_enregistres' => '[todos os  resultados estão registados]',
462
+    'info_tout_afficher' => 'Exibir tudo',
463
+    'info_travaux_texte' => 'Este sítio ainda não está configurado. Volte mais tarde...',
464
+    'info_travaux_titre' => 'Sítio em construção',
465
+    'info_trop_resultat' => 'Demasiado resultados para "@cherche_mot@". Por favor afine a pesquisa.',
466
+    'info_utilisation_messagerie_interne' => 'Você utiliza o correio interno deste sítio.',
467
+    'info_valider_lien' => 'validar esta ligação',
468
+    'info_verifier_image' => ', Por favor verifique se as suas imagens foram transferidas correctamente.',
469
+    'info_vignette_defaut' => 'Miniatura por defeito',
470
+    'info_vignette_personnalisee' => 'Miniatura personalizada',
471
+    'info_visite' => 'visita :',
472
+    'info_vos_rendez_vous' => 'Os seus futuros encontros',
473
+    'infos_vos_pense_bete' => 'Os seus memorandos',
474 474
 
475
-	// L
476
-	'label_ajout_id_rapide' => 'Adição rápida',
477
-	'label_poids_fichier' => 'Dimensões',
478
-	'lien_afficher_icones_seuls' => 'Exibir apenas os ícones',
479
-	'lien_afficher_texte_icones' => 'Exibir ícones e o texto',
480
-	'lien_afficher_texte_seul' => 'Exibir apenas o texto',
481
-	'lien_liberer' => 'desbloquear',
482
-	'lien_liberer_tous' => 'desbloquear estes artigos',
483
-	'lien_nouvea_pense_bete' => 'NOVO MEMORANDO',
484
-	'lien_nouveau_message' => 'NOVA MENSAGEM',
485
-	'lien_nouvelle_annonce' => 'NOVO ANÚNCIO',
486
-	'lien_petitions' => 'PETIÇÃO',
487
-	'lien_popularite' => 'popularidade : @popularite@%',
488
-	'lien_racine_site' => 'RAIZ DO SÍTIO',
489
-	'lien_reessayer' => 'tentar de novo',
490
-	'lien_repondre_message' => 'Responder a esta mensagem',
491
-	'lien_supprimer' => 'eliminar',
492
-	'lien_tout_afficher' => 'Exibir tudo',
493
-	'lien_visite_site' => 'visitar este sítio',
494
-	'lien_visites' => '@visites@ visitas',
495
-	'lien_voir_auteur' => 'Ver este autor',
496
-	'ligne' => 'Linha',
497
-	'login' => 'Ligação',
498
-	'login_acces_prive' => 'acesso ao espaço privado',
499
-	'login_autre_identifiant' => 'ligar-se sob um outro identificador',
500
-	'login_cookie_accepte' => 'Por favor configure o seu navegador para que os aceite (pelo menos para este sítio).',
501
-	'login_cookie_oblige' => 'Para se identificar de maneira segura neste sítio, deve aceitar os cookies.',
502
-	'login_deconnexion_ok' => 'Ligação terminada.',
503
-	'login_erreur_pass' => 'Erro de palavra-passe',
504
-	'login_espace_prive' => 'área privada',
505
-	'login_identifiant_inconnu' => 'O identificador « @login@ » é desconhecido.',
506
-	'login_login' => 'Login :',
507
-	'login_login2' => 'Login ou endereço de e-mail :',
508
-	'login_login_pass_incorrect' => '(Login ou palavra-passe incorrecta.)',
509
-	'login_motpasseoublie' => 'palavra - passe esquecida ?',
510
-	'login_non_securise' => 'Atenção, este formulário não é seguro.
475
+    // L
476
+    'label_ajout_id_rapide' => 'Adição rápida',
477
+    'label_poids_fichier' => 'Dimensões',
478
+    'lien_afficher_icones_seuls' => 'Exibir apenas os ícones',
479
+    'lien_afficher_texte_icones' => 'Exibir ícones e o texto',
480
+    'lien_afficher_texte_seul' => 'Exibir apenas o texto',
481
+    'lien_liberer' => 'desbloquear',
482
+    'lien_liberer_tous' => 'desbloquear estes artigos',
483
+    'lien_nouvea_pense_bete' => 'NOVO MEMORANDO',
484
+    'lien_nouveau_message' => 'NOVA MENSAGEM',
485
+    'lien_nouvelle_annonce' => 'NOVO ANÚNCIO',
486
+    'lien_petitions' => 'PETIÇÃO',
487
+    'lien_popularite' => 'popularidade : @popularite@%',
488
+    'lien_racine_site' => 'RAIZ DO SÍTIO',
489
+    'lien_reessayer' => 'tentar de novo',
490
+    'lien_repondre_message' => 'Responder a esta mensagem',
491
+    'lien_supprimer' => 'eliminar',
492
+    'lien_tout_afficher' => 'Exibir tudo',
493
+    'lien_visite_site' => 'visitar este sítio',
494
+    'lien_visites' => '@visites@ visitas',
495
+    'lien_voir_auteur' => 'Ver este autor',
496
+    'ligne' => 'Linha',
497
+    'login' => 'Ligação',
498
+    'login_acces_prive' => 'acesso ao espaço privado',
499
+    'login_autre_identifiant' => 'ligar-se sob um outro identificador',
500
+    'login_cookie_accepte' => 'Por favor configure o seu navegador para que os aceite (pelo menos para este sítio).',
501
+    'login_cookie_oblige' => 'Para se identificar de maneira segura neste sítio, deve aceitar os cookies.',
502
+    'login_deconnexion_ok' => 'Ligação terminada.',
503
+    'login_erreur_pass' => 'Erro de palavra-passe',
504
+    'login_espace_prive' => 'área privada',
505
+    'login_identifiant_inconnu' => 'O identificador « @login@ » é desconhecido.',
506
+    'login_login' => 'Login :',
507
+    'login_login2' => 'Login ou endereço de e-mail :',
508
+    'login_login_pass_incorrect' => '(Login ou palavra-passe incorrecta.)',
509
+    'login_motpasseoublie' => 'palavra - passe esquecida ?',
510
+    'login_non_securise' => 'Atenção, este formulário não é seguro.
511 511
  Se não quiser que a sua palavra-passe seja
512 512
  interceptada na rede, por favor active Javascript
513 513
  no seu navegador e',
514
-	'login_nouvelle_tentative' => 'Nova tentativa',
515
-	'login_par_ici' => 'Você está registado... por aqui....',
516
-	'login_pass2' => 'Palavra-passe :',
517
-	'login_preferez_refuser' => '<b>Se prefere recusar os cookies</b>, um outro método de ligação (menos seguro) está à sua disposição',
518
-	'login_recharger' => 'carregar de novo esta página ',
519
-	'login_rester_identifie' => 'Permanecer identificado durante alguns dias ', # MODIF
520
-	'login_retour_public' => 'Regresso ao sítio público',
521
-	'login_retour_site' => 'Regresso ao sítio público',
522
-	'login_retoursitepublic' => 'Regresso ao sítio público',
523
-	'login_securise' => 'Login seguro',
524
-	'login_sinscrire' => 'inscrever-se', # MODIF
525
-	'login_test_navigateur' => 'teste navegação/nova ligação',
526
-	'login_verifiez_navigateur' => '(Verifique, porém, que o seu navegador não memorizou a sua palavra-passe...)',
514
+    'login_nouvelle_tentative' => 'Nova tentativa',
515
+    'login_par_ici' => 'Você está registado... por aqui....',
516
+    'login_pass2' => 'Palavra-passe :',
517
+    'login_preferez_refuser' => '<b>Se prefere recusar os cookies</b>, um outro método de ligação (menos seguro) está à sua disposição',
518
+    'login_recharger' => 'carregar de novo esta página ',
519
+    'login_rester_identifie' => 'Permanecer identificado durante alguns dias ', # MODIF
520
+    'login_retour_public' => 'Regresso ao sítio público',
521
+    'login_retour_site' => 'Regresso ao sítio público',
522
+    'login_retoursitepublic' => 'Regresso ao sítio público',
523
+    'login_securise' => 'Login seguro',
524
+    'login_sinscrire' => 'inscrever-se', # MODIF
525
+    'login_test_navigateur' => 'teste navegação/nova ligação',
526
+    'login_verifiez_navigateur' => '(Verifique, porém, que o seu navegador não memorizou a sua palavra-passe...)',
527 527
 
528
-	// M
529
-	'masquer_colonne' => 'Ocultar esta coluna',
530
-	'masquer_trad' => 'ocultar as traduções',
531
-	'module_fichiers_langues' => 'Ficheiros de idioma',
528
+    // M
529
+    'masquer_colonne' => 'Ocultar esta coluna',
530
+    'masquer_trad' => 'ocultar as traduções',
531
+    'module_fichiers_langues' => 'Ficheiros de idioma',
532 532
 
533
-	// N
534
-	'navigateur_pas_redirige' => 'Se o seu navegador não está redireccionado, clique aqui para continuar.',
535
-	'numero' => 'Número',
533
+    // N
534
+    'navigateur_pas_redirige' => 'Se o seu navegador não está redireccionado, clique aqui para continuar.',
535
+    'numero' => 'Número',
536 536
 
537
-	// O
538
-	'occurence' => 'Ocorrência',
539
-	'onglet_affacer_base' => 'Apagar a base de dados',
540
-	'onglet_auteur' => 'O autor',
541
-	'onglet_contenu_site' => 'Conteúdo do sítio',
542
-	'onglet_evolution_visite_mod' => 'Evolução',
543
-	'onglet_fonctions_avances' => 'Funções avançadas',
544
-	'onglet_informations_personnelles' => 'Informações pessoais',
545
-	'onglet_interactivite' => 'Interactividade',
546
-	'onglet_messagerie' => 'Correio',
547
-	'onglet_repartition_rubrique' => 'Distribuição das rubricas',
548
-	'onglet_save_restaur_base' => 'Guardar uma cópia/restaurar a base',
549
-	'onglet_vider_cache' => 'Esvaziar a cache',
537
+    // O
538
+    'occurence' => 'Ocorrência',
539
+    'onglet_affacer_base' => 'Apagar a base de dados',
540
+    'onglet_auteur' => 'O autor',
541
+    'onglet_contenu_site' => 'Conteúdo do sítio',
542
+    'onglet_evolution_visite_mod' => 'Evolução',
543
+    'onglet_fonctions_avances' => 'Funções avançadas',
544
+    'onglet_informations_personnelles' => 'Informações pessoais',
545
+    'onglet_interactivite' => 'Interactividade',
546
+    'onglet_messagerie' => 'Correio',
547
+    'onglet_repartition_rubrique' => 'Distribuição das rubricas',
548
+    'onglet_save_restaur_base' => 'Guardar uma cópia/restaurar a base',
549
+    'onglet_vider_cache' => 'Esvaziar a cache',
550 550
 
551
-	// P
552
-	'pass_choix_pass' => 'Por favor escolha a sua nova palavra-passe',
553
-	'pass_erreur' => 'Erro',
554
-	'pass_erreur_acces_refuse' => '<b>Erro :</b> já não tem acesso a este sítio.',
555
-	'pass_erreur_code_inconnu' => '<b>Erro :</b> este código não corresponde a nenhum dos visitantes com acesso a este sítio.',
556
-	'pass_erreur_non_enregistre' => '<b>Erro :</b> o endereço <tt>@email_oubli@</tt> não está registado neste sítio. ',
557
-	'pass_erreur_non_valide' => '<b>Erro :</b> este email <tt>@email_oubli@</tt> não é válido !  ',
558
-	'pass_erreur_probleme_technique' => '<b>Erro :</b> por causa de um problema técnico, o email não pôde ser enviado.',
559
-	'pass_espace_prive_bla' => 'O espaço privado deste sítio está aberto aos
551
+    // P
552
+    'pass_choix_pass' => 'Por favor escolha a sua nova palavra-passe',
553
+    'pass_erreur' => 'Erro',
554
+    'pass_erreur_acces_refuse' => '<b>Erro :</b> já não tem acesso a este sítio.',
555
+    'pass_erreur_code_inconnu' => '<b>Erro :</b> este código não corresponde a nenhum dos visitantes com acesso a este sítio.',
556
+    'pass_erreur_non_enregistre' => '<b>Erro :</b> o endereço <tt>@email_oubli@</tt> não está registado neste sítio. ',
557
+    'pass_erreur_non_valide' => '<b>Erro :</b> este email <tt>@email_oubli@</tt> não é válido !  ',
558
+    'pass_erreur_probleme_technique' => '<b>Erro :</b> por causa de um problema técnico, o email não pôde ser enviado.',
559
+    'pass_espace_prive_bla' => 'O espaço privado deste sítio está aberto aos
560 560
  visitantes, após inscrição. Uma vez registado poderá consultar os artigos em curso de redacção,
561 561
 propor artigos e participar em todos os fóruns.',
562
-	'pass_forum_bla' => 'Pediu para intervir num fórum
562
+    'pass_forum_bla' => 'Pediu para intervir num fórum
563 563
  reservado aos visitadores registados.',
564
-	'pass_indiquez_cidessous' => 'Indique abaixo o endereço email sob o qual se registou. Receberá
564
+    'pass_indiquez_cidessous' => 'Indique abaixo o endereço email sob o qual se registou. Receberá
565 565
  um mail que indicará o procedimento a seguir para
566 566
         recuperar o seu acesso.',
567
-	'pass_mail_passcookie' => '(esta é uma mensagem automática)
567
+    'pass_mail_passcookie' => '(esta é uma mensagem automática)
568 568
 Para recuperar o seu acesso ao sítio
569 569
 @nom_site_spip@ (@adresse_site@)
570 570
 
@@ -574,137 +574,137 @@  discard block
 block discarded – undo
574 574
 
575 575
 Poderá então introduzir uma nova palavra-passe e reconectar-se ao sítio.
576 576
 ',
577
-	'pass_mot_oublie' => 'Palavra-passe esquecida',
578
-	'pass_nouveau_enregistre' => 'A sua nova palavra-passe foi registada',
579
-	'pass_nouveau_pass' => 'Nova palavra-passe',
580
-	'pass_ok' => 'OK',
581
-	'pass_oubli_mot' => 'Palavra-passe esquecida',
582
-	'pass_procedure_changer' => 'Para alterar a sua palavra-passe, temos primeiro de verificar a sua identidade. Por favor escreva o endereço e-mail associado a esta conta.', # MODIF
583
-	'pass_quitter_fenetre' => 'Fechar esta janela',
584
-	'pass_rappel_login' => 'Recorde : o seu identificador (login) é « @login@ ».',
585
-	'pass_recevoir_mail' => 'Vai receber um email que indica como recuperar o seu acesso ao sítio.', # MODIF
586
-	'pass_retour_public' => 'Regresso ao sítio público',
587
-	'pass_rien_a_faire_ici' => 'Nada a fazer aqui.',
588
-	'pass_vousinscrire' => 'Inscrever-se neste sítio',
589
-	'precedent' => 'anterior',
590
-	'previsualisation' => 'Visualização',
591
-	'previsualiser' => 'Pré-visualizar',
577
+    'pass_mot_oublie' => 'Palavra-passe esquecida',
578
+    'pass_nouveau_enregistre' => 'A sua nova palavra-passe foi registada',
579
+    'pass_nouveau_pass' => 'Nova palavra-passe',
580
+    'pass_ok' => 'OK',
581
+    'pass_oubli_mot' => 'Palavra-passe esquecida',
582
+    'pass_procedure_changer' => 'Para alterar a sua palavra-passe, temos primeiro de verificar a sua identidade. Por favor escreva o endereço e-mail associado a esta conta.', # MODIF
583
+    'pass_quitter_fenetre' => 'Fechar esta janela',
584
+    'pass_rappel_login' => 'Recorde : o seu identificador (login) é « @login@ ».',
585
+    'pass_recevoir_mail' => 'Vai receber um email que indica como recuperar o seu acesso ao sítio.', # MODIF
586
+    'pass_retour_public' => 'Regresso ao sítio público',
587
+    'pass_rien_a_faire_ici' => 'Nada a fazer aqui.',
588
+    'pass_vousinscrire' => 'Inscrever-se neste sítio',
589
+    'precedent' => 'anterior',
590
+    'previsualisation' => 'Visualização',
591
+    'previsualiser' => 'Pré-visualizar',
592 592
 
593
-	// R
594
-	'retour' => 'Retroceder',
593
+    // R
594
+    'retour' => 'Retroceder',
595 595
 
596
-	// S
597
-	'spip_conforme_dtd' => 'SPIP considera esta página em conforme com o seu DOCTYPE :',
598
-	'squelette' => 'modelo',
599
-	'squelette_inclus_ligne' => 'modelo incluído, linha',
600
-	'squelette_ligne' => 'modelo, linha',
601
-	'stats_visites_et_popularite' => '@visites@ visitas ; popularidade : @popularite@',
602
-	'suivant' => 'seguinte',
596
+    // S
597
+    'spip_conforme_dtd' => 'SPIP considera esta página em conforme com o seu DOCTYPE :',
598
+    'squelette' => 'modelo',
599
+    'squelette_inclus_ligne' => 'modelo incluído, linha',
600
+    'squelette_ligne' => 'modelo, linha',
601
+    'stats_visites_et_popularite' => '@visites@ visitas ; popularidade : @popularite@',
602
+    'suivant' => 'seguinte',
603 603
 
604
-	// T
605
-	'taille_go' => '@taille@ Gb',
606
-	'taille_ko' => '@taille@ kb',
607
-	'taille_mo' => '@taille@ Mb',
608
-	'taille_octets' => ' @taille@ bytes',
609
-	'taille_octets_bi' => ' @taille@ bytes',
610
-	'texte_actualite_site_1' => 'Quando estiver familiarizado(a) com a interface, poderá clicar em «',
611
-	'texte_actualite_site_2' => 'interface completa',
612
-	'texte_actualite_site_3' => '» para abrir mais possibilidades.',
613
-	'texte_creation_automatique_vignette' => 'A criação automática de miniaturas de pré-visualização está activada neste sítio. Se instalar a partir deste formulário imagens de formato(s) @gd_formats@, serão acompanhadas de uma miniatura de um tamanho máximo de @taille_preview@ pixels.',
614
-	'texte_documents_associes' => 'Os documentos seguintes estão associados ao artigo,
604
+    // T
605
+    'taille_go' => '@taille@ Gb',
606
+    'taille_ko' => '@taille@ kb',
607
+    'taille_mo' => '@taille@ Mb',
608
+    'taille_octets' => ' @taille@ bytes',
609
+    'taille_octets_bi' => ' @taille@ bytes',
610
+    'texte_actualite_site_1' => 'Quando estiver familiarizado(a) com a interface, poderá clicar em «',
611
+    'texte_actualite_site_2' => 'interface completa',
612
+    'texte_actualite_site_3' => '» para abrir mais possibilidades.',
613
+    'texte_creation_automatique_vignette' => 'A criação automática de miniaturas de pré-visualização está activada neste sítio. Se instalar a partir deste formulário imagens de formato(s) @gd_formats@, serão acompanhadas de uma miniatura de um tamanho máximo de @taille_preview@ pixels.',
614
+    'texte_documents_associes' => 'Os documentos seguintes estão associados ao artigo,
615 615
   mas não foram directamente
616 616
  inseridos nele. Conforme a paginação do sítio público,
617 617
   poderão aparecer sob forma de documentos anexados.',
618
-	'texte_erreur_mise_niveau_base' => 'Erro de base de dados por ocasião do nivelamento.
618
+    'texte_erreur_mise_niveau_base' => 'Erro de base de dados por ocasião do nivelamento.
619 619
    A imagem <b>@fichier@</b> não passou (artigo @id_article@).
620 620
   Note bem esta referência, volte a tentar o nivelamento, e verifique se as imagens aparecem sempre nos artigos.',
621
-	'texte_erreur_visiteur' => 'Tentou aceder à área privada usando um login não autorizado.',
622
-	'texte_inc_auth_1' => 'Você está identificado sob o
621
+    'texte_erreur_visiteur' => 'Tentou aceder à área privada usando um login não autorizado.',
622
+    'texte_inc_auth_1' => 'Você está identificado sob o
623 623
    login <b>@auth_login@</b>, mas este já/ não existe na base de dados.
624 624
  Tente',
625
-	'texte_inc_auth_2' => 'refazer a ligação',
626
-	'texte_inc_auth_3' => ', depois de eventualmente ter fechado e
625
+    'texte_inc_auth_2' => 'refazer a ligação',
626
+    'texte_inc_auth_3' => ', depois de eventualmente ter fechado e
627 627
  voltado a abrir o seu navegador.',
628
-	'texte_inc_config' => 'As modificações efectuadas nestas páginas influenciam muito o
628
+    'texte_inc_config' => 'As modificações efectuadas nestas páginas influenciam muito o
629 629
  funcionamento do seu sítio. Recomendamos que não intervenha enquanto não estiver familiarizado com o funcionamento do sistema SPIP. <br /><br /><b> Em
630 630
  geral, é fortemente recomendado
631 631
  deixar a responsabilidade dessas páginas ao webmaster principal do seu sítio. <b>',
632
-	'texte_inc_meta_1' => 'O sistema encontrou um erro durante a escrita do arquivo <code>@fichier@</code>. Como administrador do sítio, por favor,',
633
-	'texte_inc_meta_2' => 'verificar as permissões de escrita',
634
-	'texte_inc_meta_3' => 'no directório <code>@repertoire@</code>.',
635
-	'texte_statut_en_cours_redaction' => 'em curso de redacção',
636
-	'texte_statut_poubelle' => 'para o caixote de lixo',
637
-	'texte_statut_propose_evaluation' => 'proposto para avaliação',
638
-	'texte_statut_publie' => 'publicado online',
639
-	'texte_statut_refuse' => 'recusado',
640
-	'titre_ajouter_mot_cle' => 'ACRESCENTAR UMA PALAVRA-CHAVE',
641
-	'titre_cadre_raccourcis' => 'ATALHOS :',
642
-	'titre_changer_couleur_interface' => 'Mudar a cor da interface',
643
-	'titre_image_admin_article' => 'Pode administrar este artigo',
644
-	'titre_image_administrateur' => 'Administrador',
645
-	'titre_image_aide' => 'Ajuda sobre este elemento',
646
-	'titre_image_auteur_supprime' => 'Autor eliminado',
647
-	'titre_image_redacteur' => 'Redactor sem acesso',
648
-	'titre_image_redacteur_02' => 'Redactor',
649
-	'titre_image_selecteur' => 'Exibir a lista',
650
-	'titre_image_visiteur' => 'Visitante',
651
-	'titre_joindre_document' => 'ANEXAR UM DOCUMENTO',
652
-	'titre_mots_cles' => 'PALAVRAS-CHAVE',
653
-	'titre_probleme_technique' => 'Atenção : um problema técnico (servidor SQL) impede o acesso a esta parte do sítio. Obrigado pela sua compreensão.',
654
-	'titre_publier_document' => 'PUBLICAR UM DOCUMENTO NESTA RUBRICA',
655
-	'titre_signatures_attente' => 'Assinaturas aguardando validação',
656
-	'titre_signatures_confirmees' => 'Assinaturas confirmadas',
657
-	'titre_statistiques' => 'Estatísticas do sítio',
658
-	'titre_titre_document' => 'Título do documento :',
659
-	'todo' => 'a caminho',
660
-	'trad_reference' => '(referência para as traduções)',
632
+    'texte_inc_meta_1' => 'O sistema encontrou um erro durante a escrita do arquivo <code>@fichier@</code>. Como administrador do sítio, por favor,',
633
+    'texte_inc_meta_2' => 'verificar as permissões de escrita',
634
+    'texte_inc_meta_3' => 'no directório <code>@repertoire@</code>.',
635
+    'texte_statut_en_cours_redaction' => 'em curso de redacção',
636
+    'texte_statut_poubelle' => 'para o caixote de lixo',
637
+    'texte_statut_propose_evaluation' => 'proposto para avaliação',
638
+    'texte_statut_publie' => 'publicado online',
639
+    'texte_statut_refuse' => 'recusado',
640
+    'titre_ajouter_mot_cle' => 'ACRESCENTAR UMA PALAVRA-CHAVE',
641
+    'titre_cadre_raccourcis' => 'ATALHOS :',
642
+    'titre_changer_couleur_interface' => 'Mudar a cor da interface',
643
+    'titre_image_admin_article' => 'Pode administrar este artigo',
644
+    'titre_image_administrateur' => 'Administrador',
645
+    'titre_image_aide' => 'Ajuda sobre este elemento',
646
+    'titre_image_auteur_supprime' => 'Autor eliminado',
647
+    'titre_image_redacteur' => 'Redactor sem acesso',
648
+    'titre_image_redacteur_02' => 'Redactor',
649
+    'titre_image_selecteur' => 'Exibir a lista',
650
+    'titre_image_visiteur' => 'Visitante',
651
+    'titre_joindre_document' => 'ANEXAR UM DOCUMENTO',
652
+    'titre_mots_cles' => 'PALAVRAS-CHAVE',
653
+    'titre_probleme_technique' => 'Atenção : um problema técnico (servidor SQL) impede o acesso a esta parte do sítio. Obrigado pela sua compreensão.',
654
+    'titre_publier_document' => 'PUBLICAR UM DOCUMENTO NESTA RUBRICA',
655
+    'titre_signatures_attente' => 'Assinaturas aguardando validação',
656
+    'titre_signatures_confirmees' => 'Assinaturas confirmadas',
657
+    'titre_statistiques' => 'Estatísticas do sítio',
658
+    'titre_titre_document' => 'Título do documento :',
659
+    'todo' => 'a caminho',
660
+    'trad_reference' => '(referência para as traduções)',
661 661
 
662
-	// Z
663
-	'zbug_balise_b_aval' => ': tag B colocada demasiado tarde no laço infinito',
664
-	'zbug_balise_inexistante' => 'Tag @balise@ mal declarada para @from@',
665
-	'zbug_balise_sans_argument' => 'Argumento em falta na tag @balise@',
666
-	'zbug_boucle' => 'laço infinito',
667
-	'zbug_boucle_recursive_undef' => 'laço recursivo não definido @nom@',
668
-	'zbug_calcul' => 'cálculo',
669
-	'zbug_champ_hors_boucle' => 'Campo @champ@ fora do laço infinito',
670
-	'zbug_champ_hors_motif' => 'Campo @champ@ fora de contexto @motif@',
671
-	'zbug_code' => 'código',
672
-	'zbug_critere_inconnu' => 'critério desconhecido @critere@ ',
673
-	'zbug_distant_interdit' => 'Dados externos interditos',
674
-	'zbug_doublon_table_sans_cle_primaire' => 'Entradas duplas numa tabela que não tem uma chave primária simples',
675
-	'zbug_doublon_table_sans_index' => 'Entradas duplas numa tabela sem índice',
676
-	'zbug_erreur_boucle_double' => 'laço @id@: Dupla definição ',
677
-	'zbug_erreur_boucle_fermant' => 'laço @id@: tag final em falta   ',
678
-	'zbug_erreur_boucle_syntaxe' => 'Laço com sintaxe incorrecta @id@',
679
-	'zbug_erreur_compilation' => 'Erro de compilação',
680
-	'zbug_erreur_execution_page' => 'erro de execução da página',
681
-	'zbug_erreur_filtre' => 'Erro : filtro indefinido @filtre@ ',
682
-	'zbug_erreur_meme_parent' => '{meme_parent} aplica-se exclusivamente aos laços (FORUMS) ou (RUBRIQUES)',
683
-	'zbug_erreur_squelette' => 'Erro(s) no modelo',
684
-	'zbug_hors_compilation' => 'Não compilado',
685
-	'zbug_info_erreur_squelette' => 'Erro no sítio',
686
-	'zbug_inversion_ordre_inexistant' => 'inversão de uma ordem inexistente',
687
-	'zbug_pagination_sans_critere' => '#PAGINAÇÃO sem critério {paginação} ou usada num laço recursivo',
688
-	'zbug_parametres_inclus_incorrects' => 'Parâmetros de inclusão incorrectos: @param@',
689
-	'zbug_profile' => 'Cálculo de tempo : @time@',
690
-	'zbug_resultat' => 'resultado',
691
-	'zbug_serveur_indefini' => 'Sevidor SQL não definido',
692
-	'zbug_statistiques' => 'Estatísticas das consulta SQL classificadas por duração',
693
-	'zbug_table_inconnue' => 'Tabela SQL «@table@» desconhecida',
694
-	'zxml_connus_attributs' => 'attributos conhecidos',
695
-	'zxml_de' => 'de',
696
-	'zxml_inconnu_attribut' => 'atributo desconhecido',
697
-	'zxml_inconnu_balise' => 'tag desconhecida',
698
-	'zxml_inconnu_entite' => 'entidade desconhecida',
699
-	'zxml_inconnu_id' => 'ID desconhecido',
700
-	'zxml_mais_de' => 'mas de',
701
-	'zxml_non_conforme' => 'não está de acordo com o princípio',
702
-	'zxml_non_fils' => 'não é um filho de ',
703
-	'zxml_nonvide_balise' => 'a tag não está vazia',
704
-	'zxml_obligatoire_attribut' => 'atributo obrigatório está em falta',
705
-	'zxml_succession_fils_incorrecte' => 'sucessão de filhos incorrecta',
706
-	'zxml_survoler' => 'para visualizar os correctos, mover o rato por cima',
707
-	'zxml_valeur_attribut' => 'valor do atributo',
708
-	'zxml_vide_balise' => 'tag vazia',
709
-	'zxml_vu' => 'visualizado antes',
662
+    // Z
663
+    'zbug_balise_b_aval' => ': tag B colocada demasiado tarde no laço infinito',
664
+    'zbug_balise_inexistante' => 'Tag @balise@ mal declarada para @from@',
665
+    'zbug_balise_sans_argument' => 'Argumento em falta na tag @balise@',
666
+    'zbug_boucle' => 'laço infinito',
667
+    'zbug_boucle_recursive_undef' => 'laço recursivo não definido @nom@',
668
+    'zbug_calcul' => 'cálculo',
669
+    'zbug_champ_hors_boucle' => 'Campo @champ@ fora do laço infinito',
670
+    'zbug_champ_hors_motif' => 'Campo @champ@ fora de contexto @motif@',
671
+    'zbug_code' => 'código',
672
+    'zbug_critere_inconnu' => 'critério desconhecido @critere@ ',
673
+    'zbug_distant_interdit' => 'Dados externos interditos',
674
+    'zbug_doublon_table_sans_cle_primaire' => 'Entradas duplas numa tabela que não tem uma chave primária simples',
675
+    'zbug_doublon_table_sans_index' => 'Entradas duplas numa tabela sem índice',
676
+    'zbug_erreur_boucle_double' => 'laço @id@: Dupla definição ',
677
+    'zbug_erreur_boucle_fermant' => 'laço @id@: tag final em falta   ',
678
+    'zbug_erreur_boucle_syntaxe' => 'Laço com sintaxe incorrecta @id@',
679
+    'zbug_erreur_compilation' => 'Erro de compilação',
680
+    'zbug_erreur_execution_page' => 'erro de execução da página',
681
+    'zbug_erreur_filtre' => 'Erro : filtro indefinido @filtre@ ',
682
+    'zbug_erreur_meme_parent' => '{meme_parent} aplica-se exclusivamente aos laços (FORUMS) ou (RUBRIQUES)',
683
+    'zbug_erreur_squelette' => 'Erro(s) no modelo',
684
+    'zbug_hors_compilation' => 'Não compilado',
685
+    'zbug_info_erreur_squelette' => 'Erro no sítio',
686
+    'zbug_inversion_ordre_inexistant' => 'inversão de uma ordem inexistente',
687
+    'zbug_pagination_sans_critere' => '#PAGINAÇÃO sem critério {paginação} ou usada num laço recursivo',
688
+    'zbug_parametres_inclus_incorrects' => 'Parâmetros de inclusão incorrectos: @param@',
689
+    'zbug_profile' => 'Cálculo de tempo : @time@',
690
+    'zbug_resultat' => 'resultado',
691
+    'zbug_serveur_indefini' => 'Sevidor SQL não definido',
692
+    'zbug_statistiques' => 'Estatísticas das consulta SQL classificadas por duração',
693
+    'zbug_table_inconnue' => 'Tabela SQL «@table@» desconhecida',
694
+    'zxml_connus_attributs' => 'attributos conhecidos',
695
+    'zxml_de' => 'de',
696
+    'zxml_inconnu_attribut' => 'atributo desconhecido',
697
+    'zxml_inconnu_balise' => 'tag desconhecida',
698
+    'zxml_inconnu_entite' => 'entidade desconhecida',
699
+    'zxml_inconnu_id' => 'ID desconhecido',
700
+    'zxml_mais_de' => 'mas de',
701
+    'zxml_non_conforme' => 'não está de acordo com o princípio',
702
+    'zxml_non_fils' => 'não é um filho de ',
703
+    'zxml_nonvide_balise' => 'a tag não está vazia',
704
+    'zxml_obligatoire_attribut' => 'atributo obrigatório está em falta',
705
+    'zxml_succession_fils_incorrecte' => 'sucessão de filhos incorrecta',
706
+    'zxml_survoler' => 'para visualizar os correctos, mover o rato por cima',
707
+    'zxml_valeur_attribut' => 'valor do atributo',
708
+    'zxml_vide_balise' => 'tag vazia',
709
+    'zxml_vu' => 'visualizado antes',
710 710
 ];
Please login to merge, or discard this patch.
ecrire/lang/public_fr.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -4,118 +4,118 @@
 block discarded – undo
4 4
 
5 5
 return [
6 6
 
7
-	// A
8
-	'accueil_site' => 'Accueil',
9
-	'article' => 'Article',
10
-	'articles' => 'Articles',
11
-	'articles_auteur' => 'Articles de cet auteur',
12
-	'articles_populaires' => 'Articles les plus populaires',
13
-	'articles_rubrique' => 'Articles de cette rubrique',
14
-	'aucun_article' => 'Il n’y a pas d’article à cette adresse',
15
-	'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse',
16
-	'aucun_site' => 'Il n’y a pas de site à cette adresse',
17
-	'aucune_breve' => 'Il n’y a pas de brève à cette adresse',
18
-	'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse',
19
-	'auteur' => 'Auteur',
20
-	'autres' => 'Autres',
21
-	'autres_breves' => 'Autres brèves',
22
-	'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés',
23
-	'autres_sites' => 'Autres sites',
24
-
25
-	// B
26
-	'bonjour' => 'Bonjour',
27
-
28
-	// C
29
-	'commenter_site' => 'Commenter ce site',
30
-	'contact' => 'Contact',
31
-	'copie_document_impossible' => 'Impossible de copier le document',
32
-
33
-	// D
34
-	'date' => 'Date',
35
-	'dernier_ajout' => 'Dernier ajout',
36
-	'dernieres_breves' => 'Dernières brèves',
37
-	'derniers_articles' => 'Derniers articles',
38
-	'derniers_commentaires' => 'Derniers commentaires',
39
-	'derniers_messages_forum' => 'Derniers messages publiés dans les forums',
40
-
41
-	// E
42
-	'edition_mode_texte' => 'Édition en mode texte de',
43
-	'en_reponse' => 'En réponse à :',
44
-	'en_resume' => 'En résumé',
45
-	'envoyer_message' => 'Envoyer un message',
46
-	'espace_prive' => 'Espace privé',
47
-
48
-	// F
49
-	'formats_acceptes' => 'Formats acceptés : @formats@.',
50
-
51
-	// H
52
-	'hierarchie_site' => 'Hiérarchie du site',
53
-
54
-	// J
55
-	'jours' => 'jours',
56
-
57
-	// L
58
-	'lien_connecter' => 'Se connecter',
59
-
60
-	// M
61
-	'meme_auteur' => 'Du même auteur',
62
-	'meme_rubrique' => 'Dans la même rubrique',
63
-	'memes_auteurs' => 'Des mêmes auteurs',
64
-	'message' => 'Message',
65
-	'messages_forum' => 'Messages',
66
-	'messages_recents' => 'Messages de forums les plus récents',
67
-	'mots_clef' => 'Mot-clé',
68
-	'mots_clefs' => 'Mots-clés',
69
-	'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe',
70
-
71
-	// N
72
-	'navigation' => 'Navigation',
73
-	'nom' => 'Nom',
74
-	'nouveautes' => 'Les nouveautés',
75
-	'nouveautes_web' => 'Nouveautés sur le Web',
76
-	'nouveaux_articles' => 'Nouveaux articles',
77
-	'nouvelles_breves' => 'Nouvelles brèves',
78
-
79
-	// P
80
-	'page_precedente' => 'page précédente',
81
-	'page_suivante' => 'page suivante',
82
-	'par_auteur' => 'par ',
83
-	'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.',
84
-	'plan_site' => 'Plan du site',
85
-	'popularite' => 'Popularité',
86
-	'poster_message' => 'Poster un message',
87
-	'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :',
88
-
89
-	// R
90
-	'repondre_article' => 'Répondre à cet article',
91
-	'repondre_breve' => 'Répondre à cette brève',
92
-	'resultats_recherche' => 'Résultats de la recherche',
93
-	'retour_debut_forums' => 'Retour au début des forums',
94
-	'rss_abonnement' => 'Copiez l’URL suivante dans votre agrégateur :',
95
-	'rss_abonnement_titre' => 'S’abonner',
96
-	'rss_abonnement_titre_page' => 'S’abonner à',
97
-	'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.',
98
-	'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?',
99
-	'rubrique' => 'Rubrique',
100
-	'rubriques' => 'Rubriques',
101
-
102
-	// S
103
-	'signatures_petition' => 'Signatures',
104
-	'site_realise_avec_spip' => 'Site réalisé avec SPIP',
105
-	'sites_web' => 'Sites Web',
106
-	'sous_rubriques' => 'Sous-rubriques',
107
-	'spam' => 'Spam',
108
-	'suite' => 'suite',
109
-	'sur_web' => 'Sur le Web',
110
-	'syndiquer_rubrique' => 'Syndiquer cette rubrique',
111
-	'syndiquer_site' => 'Syndiquer tout le site',
112
-
113
-	// T
114
-	'texte_lettre_information' => 'Voici la lettre d’information du site',
115
-	'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis',
116
-
117
-	// V
118
-	'ver_imprimer' => 'Version à imprimer',
119
-	'voir_en_ligne' => 'Voir en ligne',
120
-	'voir_squelette' => 'voir le squelette de cette page',
7
+    // A
8
+    'accueil_site' => 'Accueil',
9
+    'article' => 'Article',
10
+    'articles' => 'Articles',
11
+    'articles_auteur' => 'Articles de cet auteur',
12
+    'articles_populaires' => 'Articles les plus populaires',
13
+    'articles_rubrique' => 'Articles de cette rubrique',
14
+    'aucun_article' => 'Il n’y a pas d’article à cette adresse',
15
+    'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse',
16
+    'aucun_site' => 'Il n’y a pas de site à cette adresse',
17
+    'aucune_breve' => 'Il n’y a pas de brève à cette adresse',
18
+    'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse',
19
+    'auteur' => 'Auteur',
20
+    'autres' => 'Autres',
21
+    'autres_breves' => 'Autres brèves',
22
+    'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés',
23
+    'autres_sites' => 'Autres sites',
24
+
25
+    // B
26
+    'bonjour' => 'Bonjour',
27
+
28
+    // C
29
+    'commenter_site' => 'Commenter ce site',
30
+    'contact' => 'Contact',
31
+    'copie_document_impossible' => 'Impossible de copier le document',
32
+
33
+    // D
34
+    'date' => 'Date',
35
+    'dernier_ajout' => 'Dernier ajout',
36
+    'dernieres_breves' => 'Dernières brèves',
37
+    'derniers_articles' => 'Derniers articles',
38
+    'derniers_commentaires' => 'Derniers commentaires',
39
+    'derniers_messages_forum' => 'Derniers messages publiés dans les forums',
40
+
41
+    // E
42
+    'edition_mode_texte' => 'Édition en mode texte de',
43
+    'en_reponse' => 'En réponse à :',
44
+    'en_resume' => 'En résumé',
45
+    'envoyer_message' => 'Envoyer un message',
46
+    'espace_prive' => 'Espace privé',
47
+
48
+    // F
49
+    'formats_acceptes' => 'Formats acceptés : @formats@.',
50
+
51
+    // H
52
+    'hierarchie_site' => 'Hiérarchie du site',
53
+
54
+    // J
55
+    'jours' => 'jours',
56
+
57
+    // L
58
+    'lien_connecter' => 'Se connecter',
59
+
60
+    // M
61
+    'meme_auteur' => 'Du même auteur',
62
+    'meme_rubrique' => 'Dans la même rubrique',
63
+    'memes_auteurs' => 'Des mêmes auteurs',
64
+    'message' => 'Message',
65
+    'messages_forum' => 'Messages',
66
+    'messages_recents' => 'Messages de forums les plus récents',
67
+    'mots_clef' => 'Mot-clé',
68
+    'mots_clefs' => 'Mots-clés',
69
+    'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe',
70
+
71
+    // N
72
+    'navigation' => 'Navigation',
73
+    'nom' => 'Nom',
74
+    'nouveautes' => 'Les nouveautés',
75
+    'nouveautes_web' => 'Nouveautés sur le Web',
76
+    'nouveaux_articles' => 'Nouveaux articles',
77
+    'nouvelles_breves' => 'Nouvelles brèves',
78
+
79
+    // P
80
+    'page_precedente' => 'page précédente',
81
+    'page_suivante' => 'page suivante',
82
+    'par_auteur' => 'par ',
83
+    'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.',
84
+    'plan_site' => 'Plan du site',
85
+    'popularite' => 'Popularité',
86
+    'poster_message' => 'Poster un message',
87
+    'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :',
88
+
89
+    // R
90
+    'repondre_article' => 'Répondre à cet article',
91
+    'repondre_breve' => 'Répondre à cette brève',
92
+    'resultats_recherche' => 'Résultats de la recherche',
93
+    'retour_debut_forums' => 'Retour au début des forums',
94
+    'rss_abonnement' => 'Copiez l’URL suivante dans votre agrégateur :',
95
+    'rss_abonnement_titre' => 'S’abonner',
96
+    'rss_abonnement_titre_page' => 'S’abonner à',
97
+    'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.',
98
+    'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?',
99
+    'rubrique' => 'Rubrique',
100
+    'rubriques' => 'Rubriques',
101
+
102
+    // S
103
+    'signatures_petition' => 'Signatures',
104
+    'site_realise_avec_spip' => 'Site réalisé avec SPIP',
105
+    'sites_web' => 'Sites Web',
106
+    'sous_rubriques' => 'Sous-rubriques',
107
+    'spam' => 'Spam',
108
+    'suite' => 'suite',
109
+    'sur_web' => 'Sur le Web',
110
+    'syndiquer_rubrique' => 'Syndiquer cette rubrique',
111
+    'syndiquer_site' => 'Syndiquer tout le site',
112
+
113
+    // T
114
+    'texte_lettre_information' => 'Voici la lettre d’information du site',
115
+    'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis',
116
+
117
+    // V
118
+    'ver_imprimer' => 'Version à imprimer',
119
+    'voir_en_ligne' => 'Voir en ligne',
120
+    'voir_squelette' => 'voir le squelette de cette page',
121 121
 ];
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 3 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -562,11 +562,9 @@  discard block
 block discarded – undo
562 562
 		if (!isset($msg[$p])) {
563 563
 			if (isset($resume['erreur']) && $resume['erreur']) {
564 564
 				$msg[$p] = [$resume['erreur']];
565
-			}
566
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
565
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
567 566
 				$msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
568
-			}
569
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
567
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
570 568
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
571 569
 			}
572 570
 		} else {
@@ -954,8 +952,7 @@  discard block
 block discarded – undo
954 952
 					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
955 953
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956 954
 					}
957
-				}
958
-				else {
955
+				} else {
959 956
 					foreach ($info['chemin'] as $chemin) {
960 957
 						if (
961 958
 							!isset($chemin['version'])
@@ -1424,8 +1421,7 @@  discard block
 block discarded – undo
1424 1421
 						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1425 1422
 						  $trace,
1426 1423
 						  "\n";
1427
-					}
1428
-					else {
1424
+					} else {
1429 1425
 						include_spip('inc/filtres_boites');
1430 1426
 						echo "<div class='install-plugins svp_retour'>"
1431 1427
 							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
@@ -1462,8 +1458,7 @@  discard block
 block discarded – undo
1462 1458
 	if (file_exists($nom)) {
1463 1459
 		if (str_ends_with($nom, '.php')) {
1464 1460
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1465
-		}
1466
-		else {
1461
+		} else {
1467 1462
 			$fichier_tmp = $nom . '.tmp';
1468 1463
 		}
1469 1464
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.
Indentation   +976 added lines, -976 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
23 23
 if (!defined('_DIR_PLUGINS_AUTO')) {
24
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
24
+    define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
25 25
 }
26 26
 
27 27
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -46,27 +46,27 @@  discard block
 block discarded – undo
46 46
  * @return array
47 47
 **/
48 48
 function liste_plugin_files($dir_plugins = null) {
49
-	static $plugin_files = [];
50
-	if (is_null($dir_plugins)) {
51
-		$dir_plugins = _DIR_PLUGINS;
52
-	}
53
-	if (
54
-		!isset($plugin_files[$dir_plugins])
55
-		|| (is_countable($plugin_files[$dir_plugins]) ? count($plugin_files[$dir_plugins]) : 0) == 0
56
-	) {
57
-		$plugin_files[$dir_plugins] = [];
58
-		foreach (fast_find_plugin_dirs($dir_plugins) as $plugin) {
59
-			$plugin_files[$dir_plugins][] = substr($plugin, strlen($dir_plugins));
60
-		}
61
-
62
-		sort($plugin_files[$dir_plugins]);
63
-		// et on lit le XML de tous les plugins pour le mettre en cache
64
-		// et en profiter pour nettoyer ceux qui n'existent plus du cache
65
-		$get_infos = charger_fonction('get_infos', 'plugins');
66
-		$get_infos($plugin_files[$dir_plugins], false, $dir_plugins, true);
67
-	}
68
-
69
-	return $plugin_files[$dir_plugins];
49
+    static $plugin_files = [];
50
+    if (is_null($dir_plugins)) {
51
+        $dir_plugins = _DIR_PLUGINS;
52
+    }
53
+    if (
54
+        !isset($plugin_files[$dir_plugins])
55
+        || (is_countable($plugin_files[$dir_plugins]) ? count($plugin_files[$dir_plugins]) : 0) == 0
56
+    ) {
57
+        $plugin_files[$dir_plugins] = [];
58
+        foreach (fast_find_plugin_dirs($dir_plugins) as $plugin) {
59
+            $plugin_files[$dir_plugins][] = substr($plugin, strlen($dir_plugins));
60
+        }
61
+
62
+        sort($plugin_files[$dir_plugins]);
63
+        // et on lit le XML de tous les plugins pour le mettre en cache
64
+        // et en profiter pour nettoyer ceux qui n'existent plus du cache
65
+        $get_infos = charger_fonction('get_infos', 'plugins');
66
+        $get_infos($plugin_files[$dir_plugins], false, $dir_plugins, true);
67
+    }
68
+
69
+    return $plugin_files[$dir_plugins];
70 70
 }
71 71
 
72 72
 /**
@@ -82,44 +82,44 @@  discard block
 block discarded – undo
82 82
  *     Liste complète des répeertoires
83 83
 **/
84 84
 function fast_find_plugin_dirs($dir, $max_prof = 100) {
85
-	$fichiers = [];
86
-	// revenir au repertoire racine si on a recu dossier/truc
87
-	// pour regarder dossier/truc/ ne pas oublier le / final
88
-	$dir = preg_replace(',/[^/]*$,', '', $dir);
89
-	if ($dir == '') {
90
-		$dir = '.';
91
-	}
92
-
93
-	if (!is_dir($dir)) {
94
-		return $fichiers;
95
-	}
96
-	if (is_plugin_dir($dir, '')) {
97
-		$fichiers[] = $dir;
98
-
99
-		return $fichiers;
100
-	}
101
-	if ($max_prof <= 0) {
102
-		return $fichiers;
103
-	}
104
-
105
-	$subdirs = [];
106
-	if (@is_dir($dir) && is_readable($dir) && ($d = opendir($dir))) {
107
-		while (($f = readdir($d)) !== false) {
108
-			if (
109
-				$f[0] != '.'
110
-				&& is_dir($f = "$dir/$f")
111
-			) {
112
-				$subdirs[] = $f;
113
-			}
114
-		}
115
-		closedir($d);
116
-	}
117
-
118
-	foreach ($subdirs as $d) {
119
-		$fichiers = array_merge($fichiers, fast_find_plugin_dirs("$d/", $max_prof - 1));
120
-	}
121
-
122
-	return $fichiers;
85
+    $fichiers = [];
86
+    // revenir au repertoire racine si on a recu dossier/truc
87
+    // pour regarder dossier/truc/ ne pas oublier le / final
88
+    $dir = preg_replace(',/[^/]*$,', '', $dir);
89
+    if ($dir == '') {
90
+        $dir = '.';
91
+    }
92
+
93
+    if (!is_dir($dir)) {
94
+        return $fichiers;
95
+    }
96
+    if (is_plugin_dir($dir, '')) {
97
+        $fichiers[] = $dir;
98
+
99
+        return $fichiers;
100
+    }
101
+    if ($max_prof <= 0) {
102
+        return $fichiers;
103
+    }
104
+
105
+    $subdirs = [];
106
+    if (@is_dir($dir) && is_readable($dir) && ($d = opendir($dir))) {
107
+        while (($f = readdir($d)) !== false) {
108
+            if (
109
+                $f[0] != '.'
110
+                && is_dir($f = "$dir/$f")
111
+            ) {
112
+                $subdirs[] = $f;
113
+            }
114
+        }
115
+        closedir($d);
116
+    }
117
+
118
+    foreach ($subdirs as $d) {
119
+        $fichiers = array_merge($fichiers, fast_find_plugin_dirs("$d/", $max_prof - 1));
120
+    }
121
+
122
+    return $fichiers;
123 123
 }
124 124
 
125 125
 /**
@@ -140,27 +140,27 @@  discard block
 block discarded – undo
140 140
 **/
141 141
 function is_plugin_dir($dir, $dir_plugins = null) {
142 142
 
143
-	if (is_array($dir)) {
144
-		foreach ($dir as $k => $d) {
145
-			if (!is_plugin_dir($d, $dir_plugins)) {
146
-				unset($dir[$k]);
147
-			}
148
-		}
149
-
150
-		return $dir;
151
-	}
152
-	if (is_null($dir_plugins)) {
153
-		$dir_plugins = _DIR_PLUGINS;
154
-	}
155
-	$search = ["$dir_plugins$dir/paquet.xml"];
156
-
157
-	foreach ($search as $s) {
158
-		if (file_exists($s)) {
159
-			return $dir;
160
-		}
161
-	}
162
-
163
-	return '';
143
+    if (is_array($dir)) {
144
+        foreach ($dir as $k => $d) {
145
+            if (!is_plugin_dir($d, $dir_plugins)) {
146
+                unset($dir[$k]);
147
+            }
148
+        }
149
+
150
+        return $dir;
151
+    }
152
+    if (is_null($dir_plugins)) {
153
+        $dir_plugins = _DIR_PLUGINS;
154
+    }
155
+    $search = ["$dir_plugins$dir/paquet.xml"];
156
+
157
+    foreach ($search as $s) {
158
+        if (file_exists($s)) {
159
+            return $dir;
160
+        }
161
+    }
162
+
163
+    return '';
164 164
 }
165 165
 
166 166
 /** Regexp d'extraction des informations d'un intervalle de compatibilité */
@@ -187,51 +187,51 @@  discard block
 block discarded – undo
187 187
  **/
188 188
 function plugin_version_compatible($intervalle, $version, $avec_quoi = '') {
189 189
 
190
-	if (!strlen($intervalle)) {
191
-		return true;
192
-	}
193
-	if (!preg_match(_EXTRAIRE_INTERVALLE, $intervalle, $regs)) {
194
-		return false;
195
-	}
196
-	// Extraction des bornes et traitement de * pour la borne sup :
197
-	// -- on autorise uniquement les ecritures 3.0.*, 3.*
198
-	$minimum = $regs[1];
199
-	$maximum = $regs[2];
200
-
201
-	//  si une version SPIP de compatibilité a été définie (dans
202
-	//  mes_options.php, sous la forme : define('_DEV_VERSION_SPIP_COMPAT', '3.1.0');
203
-	//  on l'utilise (phase de dev, de test...) mais *que* en cas de comparaison
204
-	//  avec la version de SPIP (ne nuit donc pas aux tests de necessite
205
-	//  entre plugins)
206
-	if (defined('_DEV_VERSION_SPIP_COMPAT') && $avec_quoi == 'spip' && $version !== _DEV_VERSION_SPIP_COMPAT) {
207
-		if (plugin_version_compatible($intervalle, _DEV_VERSION_SPIP_COMPAT, $avec_quoi)) {
208
-			return true;
209
-		}
210
-		// si pas de compatibilite avec _DEV_VERSION_SPIP_COMPAT, on essaye quand meme avec la vrai version
211
-		// cas du plugin qui n'est compatible qu'avec cette nouvelle version
212
-	}
213
-
214
-	$minimum_inc = $intervalle[0] == '[';
215
-	$maximum_inc = str_ends_with($intervalle, ']');
216
-
217
-	if (strlen($minimum)) {
218
-		if ($minimum_inc && spip_version_compare($version, $minimum, '<')) {
219
-			return false;
220
-		}
221
-		if (!$minimum_inc && spip_version_compare($version, $minimum, '<=')) {
222
-			return false;
223
-		}
224
-	}
225
-	if (strlen($maximum)) {
226
-		if ($maximum_inc && spip_version_compare($version, $maximum, '>')) {
227
-			return false;
228
-		}
229
-		if (!$maximum_inc && spip_version_compare($version, $maximum, '>=')) {
230
-			return false;
231
-		}
232
-	}
233
-
234
-	return true;
190
+    if (!strlen($intervalle)) {
191
+        return true;
192
+    }
193
+    if (!preg_match(_EXTRAIRE_INTERVALLE, $intervalle, $regs)) {
194
+        return false;
195
+    }
196
+    // Extraction des bornes et traitement de * pour la borne sup :
197
+    // -- on autorise uniquement les ecritures 3.0.*, 3.*
198
+    $minimum = $regs[1];
199
+    $maximum = $regs[2];
200
+
201
+    //  si une version SPIP de compatibilité a été définie (dans
202
+    //  mes_options.php, sous la forme : define('_DEV_VERSION_SPIP_COMPAT', '3.1.0');
203
+    //  on l'utilise (phase de dev, de test...) mais *que* en cas de comparaison
204
+    //  avec la version de SPIP (ne nuit donc pas aux tests de necessite
205
+    //  entre plugins)
206
+    if (defined('_DEV_VERSION_SPIP_COMPAT') && $avec_quoi == 'spip' && $version !== _DEV_VERSION_SPIP_COMPAT) {
207
+        if (plugin_version_compatible($intervalle, _DEV_VERSION_SPIP_COMPAT, $avec_quoi)) {
208
+            return true;
209
+        }
210
+        // si pas de compatibilite avec _DEV_VERSION_SPIP_COMPAT, on essaye quand meme avec la vrai version
211
+        // cas du plugin qui n'est compatible qu'avec cette nouvelle version
212
+    }
213
+
214
+    $minimum_inc = $intervalle[0] == '[';
215
+    $maximum_inc = str_ends_with($intervalle, ']');
216
+
217
+    if (strlen($minimum)) {
218
+        if ($minimum_inc && spip_version_compare($version, $minimum, '<')) {
219
+            return false;
220
+        }
221
+        if (!$minimum_inc && spip_version_compare($version, $minimum, '<=')) {
222
+            return false;
223
+        }
224
+    }
225
+    if (strlen($maximum)) {
226
+        if ($maximum_inc && spip_version_compare($version, $maximum, '>')) {
227
+            return false;
228
+        }
229
+        if (!$maximum_inc && spip_version_compare($version, $maximum, '>=')) {
230
+            return false;
231
+        }
232
+    }
233
+
234
+    return true;
235 235
 }
236 236
 
237 237
 /**
@@ -248,62 +248,62 @@  discard block
 block discarded – undo
248 248
  * @return array
249 249
  */
250 250
 function liste_plugin_valides($liste_plug, $force = false) {
251
-	$liste_ext = liste_plugin_files(_DIR_PLUGINS_DIST);
252
-	$get_infos = charger_fonction('get_infos', 'plugins');
253
-	$infos = [
254
-		// lister les extensions qui sont automatiquement actives
255
-		'_DIR_PLUGINS_DIST' => $get_infos($liste_ext, $force, _DIR_PLUGINS_DIST),
256
-		'_DIR_PLUGINS' => $get_infos($liste_plug, $force, _DIR_PLUGINS)
257
-	];
258
-
259
-	// creer une premiere liste non ordonnee mais qui ne retient
260
-	// que les plugins valides, et dans leur derniere version en cas de doublon
261
-	$infos['_DIR_RESTREINT'][''] = $get_infos('./', $force, _DIR_RESTREINT);
262
-	$infos['_DIR_RESTREINT']['SPIP']['version'] = $GLOBALS['spip_version_branche'];
263
-	$infos['_DIR_RESTREINT']['SPIP']['chemin'] = [];
264
-	$liste_non_classee = [
265
-		'SPIP' => [
266
-			'nom' => 'SPIP',
267
-			'etat' => 'stable',
268
-			'version' => $GLOBALS['spip_version_branche'],
269
-			'dir_type' => '_DIR_RESTREINT',
270
-			'dir' => '',
271
-		]
272
-	];
273
-
274
-	$invalides = [];
275
-	foreach ($liste_ext as $plug) {
276
-		if (isset($infos['_DIR_PLUGINS_DIST'][$plug])) {
277
-			plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS_DIST');
278
-		}
279
-	}
280
-	foreach ($liste_plug as $plug) {
281
-		if (isset($infos['_DIR_PLUGINS'][$plug])) {
282
-			$r = plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS');
283
-			if (is_array($r)) {
284
-				$invalides = array_merge($invalides, $r);
285
-			}
286
-		}
287
-	}
288
-
289
-	if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
290
-		$infos['_DIR_PLUGINS_SUPPL'] = $get_infos($liste_plug, false, _DIR_PLUGINS_SUPPL);
291
-		foreach ($liste_plug as $plug) {
292
-			if (isset($infos['_DIR_PLUGINS_SUPPL'][$plug])) {
293
-				$r = plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS_SUPPL');
294
-				if (is_array($r)) {
295
-					$invalides = array_merge($invalides, $r);
296
-				}
297
-			}
298
-		}
299
-	}
300
-
301
-	plugin_fixer_procure($liste_non_classee, $infos);
302
-
303
-	// les plugins qui sont dans $liste_non_classee ne sont pas invalides (on a trouve un autre version valide)
304
-	$invalides = array_diff_key($invalides, $liste_non_classee);
305
-
306
-	return [$infos, $liste_non_classee, $invalides];
251
+    $liste_ext = liste_plugin_files(_DIR_PLUGINS_DIST);
252
+    $get_infos = charger_fonction('get_infos', 'plugins');
253
+    $infos = [
254
+        // lister les extensions qui sont automatiquement actives
255
+        '_DIR_PLUGINS_DIST' => $get_infos($liste_ext, $force, _DIR_PLUGINS_DIST),
256
+        '_DIR_PLUGINS' => $get_infos($liste_plug, $force, _DIR_PLUGINS)
257
+    ];
258
+
259
+    // creer une premiere liste non ordonnee mais qui ne retient
260
+    // que les plugins valides, et dans leur derniere version en cas de doublon
261
+    $infos['_DIR_RESTREINT'][''] = $get_infos('./', $force, _DIR_RESTREINT);
262
+    $infos['_DIR_RESTREINT']['SPIP']['version'] = $GLOBALS['spip_version_branche'];
263
+    $infos['_DIR_RESTREINT']['SPIP']['chemin'] = [];
264
+    $liste_non_classee = [
265
+        'SPIP' => [
266
+            'nom' => 'SPIP',
267
+            'etat' => 'stable',
268
+            'version' => $GLOBALS['spip_version_branche'],
269
+            'dir_type' => '_DIR_RESTREINT',
270
+            'dir' => '',
271
+        ]
272
+    ];
273
+
274
+    $invalides = [];
275
+    foreach ($liste_ext as $plug) {
276
+        if (isset($infos['_DIR_PLUGINS_DIST'][$plug])) {
277
+            plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS_DIST');
278
+        }
279
+    }
280
+    foreach ($liste_plug as $plug) {
281
+        if (isset($infos['_DIR_PLUGINS'][$plug])) {
282
+            $r = plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS');
283
+            if (is_array($r)) {
284
+                $invalides = array_merge($invalides, $r);
285
+            }
286
+        }
287
+    }
288
+
289
+    if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
290
+        $infos['_DIR_PLUGINS_SUPPL'] = $get_infos($liste_plug, false, _DIR_PLUGINS_SUPPL);
291
+        foreach ($liste_plug as $plug) {
292
+            if (isset($infos['_DIR_PLUGINS_SUPPL'][$plug])) {
293
+                $r = plugin_valide_resume($liste_non_classee, $plug, $infos, '_DIR_PLUGINS_SUPPL');
294
+                if (is_array($r)) {
295
+                    $invalides = array_merge($invalides, $r);
296
+                }
297
+            }
298
+        }
299
+    }
300
+
301
+    plugin_fixer_procure($liste_non_classee, $infos);
302
+
303
+    // les plugins qui sont dans $liste_non_classee ne sont pas invalides (on a trouve un autre version valide)
304
+    $invalides = array_diff_key($invalides, $liste_non_classee);
305
+
306
+    return [$infos, $liste_non_classee, $invalides];
307 307
 }
308 308
 
309 309
 /**
@@ -323,37 +323,37 @@  discard block
 block discarded – undo
323 323
  *   array description short si on ne le retient pas (pour memorisation dans une table des erreurs)
324 324
  */
325 325
 function plugin_valide_resume(&$liste, $plug, $infos, $dir_type) {
326
-	$i = $infos[$dir_type][$plug];
327
-	// minimum syndical pour afficher si le xml avait des erreurs éventuelles
328
-	$short_desc = [
329
-		'dir' => $plug,
330
-		'dir_type' => $dir_type
331
-	];
332
-	if (empty($i['prefix'])) {
333
-		// erreur xml ? mais sans connaissance du prefix, on retourne le chemin…
334
-		$short_desc['erreur'] = $i['erreur'] ?? ['?'];
335
-		return [$plug => $short_desc];
336
-	}
337
-
338
-	$p = strtoupper($i['prefix']);
339
-	$short_desc['nom'] = $i['nom'];
340
-	$short_desc['etat'] = $i['etat'];
341
-	$short_desc['version'] = $i['version'];
342
-
343
-	if (isset($i['erreur']) && $i['erreur']) {
344
-		$short_desc['erreur'] = $i['erreur'];
345
-		return [$p => $short_desc];
346
-	}
347
-	if (!plugin_version_compatible($i['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
348
-		return [$p => $short_desc];
349
-	}
350
-	if (
351
-		!isset($liste[$p]) || spip_version_compare($i['version'], $liste[$p]['version'], '>')
352
-	) {
353
-		$liste[$p] = $short_desc;
354
-	}
355
-	// ok le plugin etait deja dans la liste ou on a choisi une version plus recente
356
-	return $p;
326
+    $i = $infos[$dir_type][$plug];
327
+    // minimum syndical pour afficher si le xml avait des erreurs éventuelles
328
+    $short_desc = [
329
+        'dir' => $plug,
330
+        'dir_type' => $dir_type
331
+    ];
332
+    if (empty($i['prefix'])) {
333
+        // erreur xml ? mais sans connaissance du prefix, on retourne le chemin…
334
+        $short_desc['erreur'] = $i['erreur'] ?? ['?'];
335
+        return [$plug => $short_desc];
336
+    }
337
+
338
+    $p = strtoupper($i['prefix']);
339
+    $short_desc['nom'] = $i['nom'];
340
+    $short_desc['etat'] = $i['etat'];
341
+    $short_desc['version'] = $i['version'];
342
+
343
+    if (isset($i['erreur']) && $i['erreur']) {
344
+        $short_desc['erreur'] = $i['erreur'];
345
+        return [$p => $short_desc];
346
+    }
347
+    if (!plugin_version_compatible($i['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
348
+        return [$p => $short_desc];
349
+    }
350
+    if (
351
+        !isset($liste[$p]) || spip_version_compare($i['version'], $liste[$p]['version'], '>')
352
+    ) {
353
+        $liste[$p] = $short_desc;
354
+    }
355
+    // ok le plugin etait deja dans la liste ou on a choisi une version plus recente
356
+    return $p;
357 357
 }
358 358
 
359 359
 /**
@@ -369,47 +369,47 @@  discard block
 block discarded – undo
369 369
  * @param array $infos
370 370
  */
371 371
 function plugin_fixer_procure(&$liste, &$infos) {
372
-	foreach ($liste as $p => $resume) {
373
-		$i = $infos[$resume['dir_type']][$resume['dir']];
374
-		if (isset($i['procure']) && $i['procure']) {
375
-			foreach ($i['procure'] as $procure) {
376
-				$p = strtoupper($procure['nom']);
377
-				$dir = $resume['dir'];
378
-				if ($dir) {
379
-					$dir .= '/';
380
-				}
381
-				$dir .= 'procure:' . $procure['nom'];
382
-
383
-				$procure['etat'] = '?';
384
-				$procure['dir_type'] = $resume['dir_type'];
385
-				$procure['dir'] = $dir;
386
-
387
-				// si ce plugin n'est pas deja procure, ou dans une version plus ancienne
388
-				// on ajoute cette version a la liste
389
-				if (
390
-					!isset($liste[$p])
391
-					|| spip_version_compare($procure['version'], $liste[$p]['version'], '>')
392
-				) {
393
-					$liste[$p] = $procure;
394
-
395
-					// on fournit une information minimale pour ne pas perturber la compilation
396
-					$infos[$resume['dir_type']][$dir] = [
397
-						'prefix' => $procure['nom'],
398
-						'nom' => $procure['nom'],
399
-						'etat' => $procure['etat'],
400
-						'version' => $procure['version'],
401
-						'chemin' => [],
402
-						'necessite' => [],
403
-						'utilise' => [],
404
-						'lib' => [],
405
-						'menu' => [],
406
-						'onglet' => [],
407
-						'procure' => [],
408
-					];
409
-				}
410
-			}
411
-		}
412
-	}
372
+    foreach ($liste as $p => $resume) {
373
+        $i = $infos[$resume['dir_type']][$resume['dir']];
374
+        if (isset($i['procure']) && $i['procure']) {
375
+            foreach ($i['procure'] as $procure) {
376
+                $p = strtoupper($procure['nom']);
377
+                $dir = $resume['dir'];
378
+                if ($dir) {
379
+                    $dir .= '/';
380
+                }
381
+                $dir .= 'procure:' . $procure['nom'];
382
+
383
+                $procure['etat'] = '?';
384
+                $procure['dir_type'] = $resume['dir_type'];
385
+                $procure['dir'] = $dir;
386
+
387
+                // si ce plugin n'est pas deja procure, ou dans une version plus ancienne
388
+                // on ajoute cette version a la liste
389
+                if (
390
+                    !isset($liste[$p])
391
+                    || spip_version_compare($procure['version'], $liste[$p]['version'], '>')
392
+                ) {
393
+                    $liste[$p] = $procure;
394
+
395
+                    // on fournit une information minimale pour ne pas perturber la compilation
396
+                    $infos[$resume['dir_type']][$dir] = [
397
+                        'prefix' => $procure['nom'],
398
+                        'nom' => $procure['nom'],
399
+                        'etat' => $procure['etat'],
400
+                        'version' => $procure['version'],
401
+                        'chemin' => [],
402
+                        'necessite' => [],
403
+                        'utilise' => [],
404
+                        'lib' => [],
405
+                        'menu' => [],
406
+                        'onglet' => [],
407
+                        'procure' => [],
408
+                    ];
409
+                }
410
+            }
411
+        }
412
+    }
413 413
 }
414 414
 
415 415
 /**
@@ -423,17 +423,17 @@  discard block
 block discarded – undo
423 423
  * @return array
424 424
  */
425 425
 function liste_chemin_plugin($liste, $dir_plugins = _DIR_PLUGINS) {
426
-	foreach ($liste as $prefix => $infos) {
427
-		if (
428
-			!$dir_plugins || defined($infos['dir_type']) && constant($infos['dir_type']) == $dir_plugins
429
-		) {
430
-			$liste[$prefix] = $infos['dir'];
431
-		} else {
432
-			unset($liste[$prefix]);
433
-		}
434
-	}
435
-
436
-	return $liste;
426
+    foreach ($liste as $prefix => $infos) {
427
+        if (
428
+            !$dir_plugins || defined($infos['dir_type']) && constant($infos['dir_type']) == $dir_plugins
429
+        ) {
430
+            $liste[$prefix] = $infos['dir'];
431
+        } else {
432
+            unset($liste[$prefix]);
433
+        }
434
+    }
435
+
436
+    return $liste;
437 437
 }
438 438
 
439 439
 /**
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
  * @return array
449 449
  */
450 450
 function liste_chemin_plugin_actifs($dir_plugins = _DIR_PLUGINS) {
451
-	include_spip('plugins/installer');
451
+    include_spip('plugins/installer');
452 452
 
453
-	return liste_chemin_plugin(liste_plugin_actifs(), $dir_plugins);
453
+    return liste_chemin_plugin(liste_plugin_actifs(), $dir_plugins);
454 454
 }
455 455
 
456 456
 /**
@@ -481,53 +481,53 @@  discard block
 block discarded – undo
481 481
  *                qui n'ont pas satisfait leurs dépendances
482 482
 **/
483 483
 function plugin_trier($infos, $liste_non_classee) {
484
-	$toute_la_liste = $liste_non_classee;
485
-	$liste = $ordre = [];
486
-	$count = 0;
487
-
488
-	while (($c = count($liste_non_classee)) && $c != $count) { // tant qu'il reste des plugins a classer, et qu'on ne stagne pas
489
-		#echo "tour::";var_dump($liste_non_classee);
490
-		$count = $c;
491
-		foreach ($liste_non_classee as $p => $resume) {
492
-			$plug = $resume['dir'];
493
-			$dir_type = $resume['dir_type'];
494
-			$info1 = $infos[$dir_type][$plug];
495
-			// si des plugins sont necessaires,
496
-			// on ne peut inserer qu'apres eux
497
-			foreach ($info1['necessite'] as $need) {
498
-				$nom = strtoupper($need['nom']);
499
-				$compat = $need['compatibilite'] ?? '';
500
-				if (!isset($liste[$nom]) || !plugin_version_compatible($compat, $liste[$nom]['version'])) {
501
-					$info1 = false;
502
-					break;
503
-				}
504
-			}
505
-			if (!$info1) {
506
-				continue;
507
-			}
508
-			// idem si des plugins sont utiles,
509
-			// sauf si ils sont de toute facon absents de la liste
510
-			foreach ($info1['utilise'] as $need) {
511
-				$nom = strtoupper($need['nom']);
512
-				$compat = $need['compatibilite'] ?? '';
513
-				if (isset($toute_la_liste[$nom])) {
514
-					if (
515
-						!isset($liste[$nom]) || !plugin_version_compatible($compat, $liste[$nom]['version'])
516
-					) {
517
-						$info1 = false;
518
-						break;
519
-					}
520
-				}
521
-			}
522
-			if ($info1) {
523
-				$ordre[$p] = $info1;
524
-				$liste[$p] = $liste_non_classee[$p];
525
-				unset($liste_non_classee[$p]);
526
-			}
527
-		}
528
-	}
529
-
530
-	return [$liste, $ordre, $liste_non_classee];
484
+    $toute_la_liste = $liste_non_classee;
485
+    $liste = $ordre = [];
486
+    $count = 0;
487
+
488
+    while (($c = count($liste_non_classee)) && $c != $count) { // tant qu'il reste des plugins a classer, et qu'on ne stagne pas
489
+        #echo "tour::";var_dump($liste_non_classee);
490
+        $count = $c;
491
+        foreach ($liste_non_classee as $p => $resume) {
492
+            $plug = $resume['dir'];
493
+            $dir_type = $resume['dir_type'];
494
+            $info1 = $infos[$dir_type][$plug];
495
+            // si des plugins sont necessaires,
496
+            // on ne peut inserer qu'apres eux
497
+            foreach ($info1['necessite'] as $need) {
498
+                $nom = strtoupper($need['nom']);
499
+                $compat = $need['compatibilite'] ?? '';
500
+                if (!isset($liste[$nom]) || !plugin_version_compatible($compat, $liste[$nom]['version'])) {
501
+                    $info1 = false;
502
+                    break;
503
+                }
504
+            }
505
+            if (!$info1) {
506
+                continue;
507
+            }
508
+            // idem si des plugins sont utiles,
509
+            // sauf si ils sont de toute facon absents de la liste
510
+            foreach ($info1['utilise'] as $need) {
511
+                $nom = strtoupper($need['nom']);
512
+                $compat = $need['compatibilite'] ?? '';
513
+                if (isset($toute_la_liste[$nom])) {
514
+                    if (
515
+                        !isset($liste[$nom]) || !plugin_version_compatible($compat, $liste[$nom]['version'])
516
+                    ) {
517
+                        $info1 = false;
518
+                        break;
519
+                    }
520
+                }
521
+            }
522
+            if ($info1) {
523
+                $ordre[$p] = $info1;
524
+                $liste[$p] = $liste_non_classee[$p];
525
+                unset($liste_non_classee[$p]);
526
+            }
527
+        }
528
+    }
529
+
530
+    return [$liste, $ordre, $liste_non_classee];
531 531
 }
532 532
 
533 533
 /**
@@ -544,40 +544,40 @@  discard block
 block discarded – undo
544 544
  *     Répertoire (plugins, plugins-dist, ...) => Couples (prefixes => infos completes) des plugins qu'ils contiennent
545 545
 **/
546 546
 function plugins_erreurs($liste_non_classee, $liste, $infos, $msg = []) {
547
-	static $erreurs = [];
548
-
549
-	if (!is_array($liste)) {
550
-		$liste = [];
551
-	}
552
-
553
-	// les plugins en erreur ne sont pas actifs ; ils ne doivent pas être dans la liste
554
-	$liste = array_diff_key($liste, $liste_non_classee);
555
-
556
-	foreach ($liste_non_classee as $p => $resume) {
557
-		$dir_type = $resume['dir_type'];
558
-		$plug = $resume['dir'];
559
-		$k = $infos[$dir_type][$plug];
560
-
561
-		$plug = constant($dir_type) . $plug;
562
-		if (!isset($msg[$p])) {
563
-			if (isset($resume['erreur']) && $resume['erreur']) {
564
-				$msg[$p] = [$resume['erreur']];
565
-			}
566
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
567
-				$msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
568
-			}
569
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
570
-				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
571
-			}
572
-		} else {
573
-			foreach ($msg[$p] as $c => $l) {
574
-				$msg[$p][$c] = plugin_controler_lib($l['nom'], $l['lien']);
575
-			}
576
-		}
577
-		$erreurs[$plug] = $msg[$p];
578
-	}
579
-
580
-	ecrire_meta('plugin_erreur_activation', serialize($erreurs));
547
+    static $erreurs = [];
548
+
549
+    if (!is_array($liste)) {
550
+        $liste = [];
551
+    }
552
+
553
+    // les plugins en erreur ne sont pas actifs ; ils ne doivent pas être dans la liste
554
+    $liste = array_diff_key($liste, $liste_non_classee);
555
+
556
+    foreach ($liste_non_classee as $p => $resume) {
557
+        $dir_type = $resume['dir_type'];
558
+        $plug = $resume['dir'];
559
+        $k = $infos[$dir_type][$plug];
560
+
561
+        $plug = constant($dir_type) . $plug;
562
+        if (!isset($msg[$p])) {
563
+            if (isset($resume['erreur']) && $resume['erreur']) {
564
+                $msg[$p] = [$resume['erreur']];
565
+            }
566
+            elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
567
+                $msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
568
+            }
569
+            elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
570
+                $msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
571
+            }
572
+        } else {
573
+            foreach ($msg[$p] as $c => $l) {
574
+                $msg[$p][$c] = plugin_controler_lib($l['nom'], $l['lien']);
575
+            }
576
+        }
577
+        $erreurs[$plug] = $msg[$p];
578
+    }
579
+
580
+    ecrire_meta('plugin_erreur_activation', serialize($erreurs));
581 581
 }
582 582
 
583 583
 /**
@@ -592,25 +592,25 @@  discard block
 block discarded – undo
592 592
  *     - Liste des erreurs ou code HTML des erreurs
593 593
 **/
594 594
 function plugin_donne_erreurs($raw = false, $raz = true) {
595
-	if (!isset($GLOBALS['meta']['plugin_erreur_activation'])) {
596
-		return $raw ? [] : '';
597
-	}
598
-	$list = @unserialize($GLOBALS['meta']['plugin_erreur_activation']);
599
-	// Compat ancienne version
600
-	if (!$list) {
601
-		$list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation'];
602
-	} elseif (!$raw) {
603
-		foreach ($list as $plug => $msg) {
604
-			$list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug])
605
-				. '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>';
606
-		}
607
-		$list = '<ul>' . join("\n", $list) . '</ul>';
608
-	}
609
-	if ($raz) {
610
-		effacer_meta('plugin_erreur_activation');
611
-	}
612
-
613
-	return $list;
595
+    if (!isset($GLOBALS['meta']['plugin_erreur_activation'])) {
596
+        return $raw ? [] : '';
597
+    }
598
+    $list = @unserialize($GLOBALS['meta']['plugin_erreur_activation']);
599
+    // Compat ancienne version
600
+    if (!$list) {
601
+        $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation'];
602
+    } elseif (!$raw) {
603
+        foreach ($list as $plug => $msg) {
604
+            $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug])
605
+                . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>';
606
+        }
607
+        $list = '<ul>' . join("\n", $list) . '</ul>';
608
+    }
609
+    if ($raz) {
610
+        effacer_meta('plugin_erreur_activation');
611
+    }
612
+
613
+    return $list;
614 614
 }
615 615
 
616 616
 /**
@@ -630,21 +630,21 @@  discard block
 block discarded – undo
630 630
  *
631 631
  **/
632 632
 function plugin_necessite($n, $liste, $balise = 'necessite') {
633
-	$msg = [];
634
-	foreach ($n as $need) {
635
-		$id = strtoupper($need['nom']);
636
-		$r = plugin_controler_necessite(
637
-			$liste,
638
-			$id,
639
-			$need['compatibilite'] ?? '',
640
-			$balise
641
-		);
642
-		if ($r) {
643
-			$msg[] = $r;
644
-		}
645
-	}
646
-
647
-	return $msg;
633
+    $msg = [];
634
+    foreach ($n as $need) {
635
+        $id = strtoupper($need['nom']);
636
+        $r = plugin_controler_necessite(
637
+            $liste,
638
+            $id,
639
+            $need['compatibilite'] ?? '',
640
+            $balise
641
+        );
642
+        if ($r) {
643
+            $msg[] = $r;
644
+        }
645
+    }
646
+
647
+    return $msg;
648 648
 }
649 649
 
650 650
 /**
@@ -666,19 +666,19 @@  discard block
 block discarded – undo
666 666
  *    Message d'erreur lorsque la dépendance est absente.
667 667
  **/
668 668
 function plugin_controler_necessite($liste, $nom, $intervalle, $balise) {
669
-	if (isset($liste[$nom]) && plugin_version_compatible($intervalle, $liste[$nom]['version'])) {
670
-		return '';
671
-	}
672
-	// Si l'on a un <utilise="plugin non actif" />, ne pas renvoyer d'erreur
673
-	if ($balise === 'utilise' && !isset($liste[$nom])) {
674
-		return '';
675
-	}
676
-	return plugin_message_incompatibilite(
677
-		$intervalle,
678
-		(isset($liste[$nom]) ? $liste[$nom]['version'] : ''),
679
-		$nom,
680
-		$balise
681
-	);
669
+    if (isset($liste[$nom]) && plugin_version_compatible($intervalle, $liste[$nom]['version'])) {
670
+        return '';
671
+    }
672
+    // Si l'on a un <utilise="plugin non actif" />, ne pas renvoyer d'erreur
673
+    if ($balise === 'utilise' && !isset($liste[$nom])) {
674
+        return '';
675
+    }
676
+    return plugin_message_incompatibilite(
677
+        $intervalle,
678
+        (isset($liste[$nom]) ? $liste[$nom]['version'] : ''),
679
+        $nom,
680
+        $balise
681
+    );
682 682
 }
683 683
 
684 684
 /**
@@ -695,70 +695,70 @@  discard block
 block discarded – undo
695 695
  */
696 696
 function plugin_message_incompatibilite($intervalle, $version, $nom, $balise) {
697 697
 
698
-	// prendre en compte les erreurs de dépendances à PHP
699
-	// ou à une extension PHP avec des messages d'erreurs dédiés.
700
-	$type = 'plugin';
701
-	if ($nom === 'SPIP') {
702
-		$type = 'spip';
703
-	} elseif ($nom === 'PHP') {
704
-		$type = 'php';
705
-	} elseif (str_starts_with($nom, 'PHP:')) {
706
-		$type = 'extension_php';
707
-		[, $nom] = explode(':', $nom, 2);
708
-	}
709
-
710
-	if (preg_match(_EXTRAIRE_INTERVALLE, $intervalle, $regs)) {
711
-		$minimum = $regs[1];
712
-		$maximum = $regs[2];
713
-
714
-		$minimum_inclus = $intervalle[0] == '[';
715
-		$maximum_inclus = str_ends_with($intervalle, ']');
716
-
717
-		if (strlen($minimum)) {
718
-			if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) {
719
-				return _T("plugin_{$balise}_{$type}", [
720
-					'plugin' => $nom,
721
-					'version' => ' &ge; ' . $minimum
722
-				]);
723
-			}
724
-			if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) {
725
-				return _T("plugin_{$balise}_{$type}", [
726
-					'plugin' => $nom,
727
-					'version' => ' &gt; ' . $minimum
728
-				]);
729
-			}
730
-		}
731
-
732
-		if (strlen($maximum)) {
733
-			if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) {
734
-				return _T("plugin_{$balise}_{$type}", [
735
-					'plugin' => $nom,
736
-					'version' => ' &le; ' . $maximum
737
-				]);
738
-			}
739
-			if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) {
740
-				return _T("plugin_{$balise}_plugin", [
741
-					'plugin' => $nom,
742
-					'version' => ' &lt; ' . $maximum
743
-				]);
744
-			}
745
-		}
746
-	}
747
-
748
-	// note : il ne peut pas y avoir d'erreur sur
749
-	// - un 'utilise' sans version.
750
-	// - un 'php' sans version.
751
-	return _T("plugin_necessite_{$type}_sans_version", ['plugin' => $nom]);
698
+    // prendre en compte les erreurs de dépendances à PHP
699
+    // ou à une extension PHP avec des messages d'erreurs dédiés.
700
+    $type = 'plugin';
701
+    if ($nom === 'SPIP') {
702
+        $type = 'spip';
703
+    } elseif ($nom === 'PHP') {
704
+        $type = 'php';
705
+    } elseif (str_starts_with($nom, 'PHP:')) {
706
+        $type = 'extension_php';
707
+        [, $nom] = explode(':', $nom, 2);
708
+    }
709
+
710
+    if (preg_match(_EXTRAIRE_INTERVALLE, $intervalle, $regs)) {
711
+        $minimum = $regs[1];
712
+        $maximum = $regs[2];
713
+
714
+        $minimum_inclus = $intervalle[0] == '[';
715
+        $maximum_inclus = str_ends_with($intervalle, ']');
716
+
717
+        if (strlen($minimum)) {
718
+            if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) {
719
+                return _T("plugin_{$balise}_{$type}", [
720
+                    'plugin' => $nom,
721
+                    'version' => ' &ge; ' . $minimum
722
+                ]);
723
+            }
724
+            if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) {
725
+                return _T("plugin_{$balise}_{$type}", [
726
+                    'plugin' => $nom,
727
+                    'version' => ' &gt; ' . $minimum
728
+                ]);
729
+            }
730
+        }
731
+
732
+        if (strlen($maximum)) {
733
+            if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) {
734
+                return _T("plugin_{$balise}_{$type}", [
735
+                    'plugin' => $nom,
736
+                    'version' => ' &le; ' . $maximum
737
+                ]);
738
+            }
739
+            if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) {
740
+                return _T("plugin_{$balise}_plugin", [
741
+                    'plugin' => $nom,
742
+                    'version' => ' &lt; ' . $maximum
743
+                ]);
744
+            }
745
+        }
746
+    }
747
+
748
+    // note : il ne peut pas y avoir d'erreur sur
749
+    // - un 'utilise' sans version.
750
+    // - un 'php' sans version.
751
+    return _T("plugin_necessite_{$type}_sans_version", ['plugin' => $nom]);
752 752
 }
753 753
 
754 754
 
755 755
 function plugin_controler_lib($lib, $url) {
756
-	/* Feature sortie du core, voir STP
756
+    /* Feature sortie du core, voir STP
757 757
 	 * if ($url) {
758 758
 		include_spip('inc/charger_plugin');
759 759
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
760 760
 	}*/
761
-	return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>";
761
+    return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>";
762 762
 }
763 763
 
764 764
 
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
  *     true si il y a eu des modifications sur la liste des plugins actifs, false sinon
774 774
  **/
775 775
 function actualise_plugins_actifs($pipe_recherche = false) {
776
-	return ecrire_plugin_actifs('', $pipe_recherche, 'force');
776
+    return ecrire_plugin_actifs('', $pipe_recherche, 'force');
777 777
 }
778 778
 
779 779
 
@@ -800,115 +800,115 @@  discard block
 block discarded – undo
800 800
  **/
801 801
 function ecrire_plugin_actifs($plugin, $pipe_recherche = false, $operation = 'raz') {
802 802
 
803
-	// creer le repertoire cache/ si necessaire ! (installation notamment)
804
-	$cache = sous_repertoire(_DIR_CACHE, '', false, true);
805
-
806
-	// Si on n'a ni cache accessible, ni connexion SQL, on ne peut pas faire grand chose encore.
807
-	if (!$cache && !spip_connect()) {
808
-		return false;
809
-	}
810
-
811
-	if ($operation != 'raz') {
812
-		$plugin_valides = liste_chemin_plugin_actifs();
813
-		$plugin_valides = is_plugin_dir($plugin_valides);
814
-		if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
815
-			$plugin_valides_supp = liste_chemin_plugin_actifs(_DIR_PLUGINS_SUPPL);
816
-			$plugin_valides_supp = is_plugin_dir($plugin_valides_supp, _DIR_PLUGINS_SUPPL);
817
-			$plugin_valides = array_merge($plugin_valides, $plugin_valides_supp);
818
-		}
819
-		// si des plugins sont en attentes (coches mais impossible a activer)
820
-		// on les reinjecte ici
821
-		if (
822
-			isset($GLOBALS['meta']['plugin_attente']) && ($a = unserialize($GLOBALS['meta']['plugin_attente']))
823
-		) {
824
-			$plugin_valides = $plugin_valides + liste_chemin_plugin($a);
825
-		}
826
-
827
-		if ($operation == 'ajoute') {
828
-			$plugin = array_merge($plugin_valides, $plugin);
829
-		} elseif ($operation == 'enleve') {
830
-			$plugin = array_diff($plugin_valides, $plugin);
831
-		} else {
832
-			$plugin = $plugin_valides;
833
-		}
834
-	}
835
-	$actifs_avant = $GLOBALS['meta']['plugin'] ?? '';
836
-
837
-	// si une fonction de gestion de dependances existe, l'appeler ici
838
-	if ($ajouter_dependances = charger_fonction('ajouter_dependances', 'plugins', true)) {
839
-		$plugin = $ajouter_dependances($plugin);
840
-	}
841
-
842
-	// recharger le xml des plugins a activer
843
-	// on force le reload ici, meme si le fichier xml n'a pas change
844
-	// pour ne pas rater l'ajout ou la suppression d'un fichier fonctions/options/administrations
845
-	// pourra etre evite quand on ne supportera plus les plugin.xml
846
-	// en deplacant la detection de ces fichiers dans la compilation ci dessous
847
-	[$infos, $liste, $invalides] = liste_plugin_valides($plugin, true);
848
-	// trouver l'ordre d'activation
849
-	[$plugin_valides, $ordre, $reste] = plugin_trier($infos, $liste);
850
-	if ($invalides || $reste) {
851
-		plugins_erreurs(array_merge($invalides, $reste), $liste, $infos);
852
-	}
853
-
854
-	// Ignorer les plugins necessitant une lib absente
855
-	// et preparer la meta d'entete Http
856
-	$err = $msg = $header = [];
857
-	foreach ($plugin_valides as $p => $resume) {
858
-		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
859
-		if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') {
860
-			$header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : '');
861
-		}
862
-		if ($resume['dir']) {
863
-			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
864
-				if (!find_in_path($l['nom'], 'lib/')) {
865
-					$err[$p] = $resume;
866
-					$msg[$p][] = $l;
867
-					unset($plugin_valides[$p]);
868
-				}
869
-			}
870
-		}
871
-	}
872
-	if ($err) {
873
-		plugins_erreurs($err, '', $infos, $msg);
874
-	}
875
-
876
-	if (isset($GLOBALS['meta']['message_crash_plugins'])) {
877
-		effacer_meta('message_crash_plugins');
878
-	}
879
-	ecrire_meta('plugin', serialize($plugin_valides));
880
-	$liste = array_diff_key($liste, $plugin_valides);
881
-	ecrire_meta('plugin_attente', serialize($liste));
882
-	$header = strtolower(implode(',', $header));
883
-	if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) {
884
-		ecrire_fichier(
885
-			_DIR_VAR . 'config.txt',
886
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header
887
-		);
888
-	} else {
889
-		@unlink(_DIR_VAR . 'config.txt');
890
-	}
891
-	// generer charger_plugins_chemin.php
892
-	plugins_precompile_chemin($plugin_valides, $ordre);
893
-	// generer les fichiers
894
-	// - charger_plugins_options.php
895
-	// - charger_plugins_fonctions.php
896
-	plugins_precompile_xxxtions($plugin_valides, $ordre);
897
-	// charger les chemins des plugins et les fichiers d'options
898
-	// (qui peuvent déclarer / utiliser des pipelines, ajouter d'autres chemins)
899
-	plugins_amorcer_plugins_actifs();
900
-	// mise a jour de la matrice des pipelines
901
-	$prepend_code = pipeline_matrice_precompile($plugin_valides, $ordre, $pipe_recherche);
902
-	// generer le fichier _CACHE_PIPELINE
903
-	pipeline_precompile($prepend_code);
904
-
905
-	if (spip_connect()) {
906
-		// lancer et initialiser les nouveaux crons !
907
-		include_spip('inc/genie');
908
-		genie_queue_watch_dist();
909
-	}
910
-
911
-	return ($GLOBALS['meta']['plugin'] != $actifs_avant);
803
+    // creer le repertoire cache/ si necessaire ! (installation notamment)
804
+    $cache = sous_repertoire(_DIR_CACHE, '', false, true);
805
+
806
+    // Si on n'a ni cache accessible, ni connexion SQL, on ne peut pas faire grand chose encore.
807
+    if (!$cache && !spip_connect()) {
808
+        return false;
809
+    }
810
+
811
+    if ($operation != 'raz') {
812
+        $plugin_valides = liste_chemin_plugin_actifs();
813
+        $plugin_valides = is_plugin_dir($plugin_valides);
814
+        if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
815
+            $plugin_valides_supp = liste_chemin_plugin_actifs(_DIR_PLUGINS_SUPPL);
816
+            $plugin_valides_supp = is_plugin_dir($plugin_valides_supp, _DIR_PLUGINS_SUPPL);
817
+            $plugin_valides = array_merge($plugin_valides, $plugin_valides_supp);
818
+        }
819
+        // si des plugins sont en attentes (coches mais impossible a activer)
820
+        // on les reinjecte ici
821
+        if (
822
+            isset($GLOBALS['meta']['plugin_attente']) && ($a = unserialize($GLOBALS['meta']['plugin_attente']))
823
+        ) {
824
+            $plugin_valides = $plugin_valides + liste_chemin_plugin($a);
825
+        }
826
+
827
+        if ($operation == 'ajoute') {
828
+            $plugin = array_merge($plugin_valides, $plugin);
829
+        } elseif ($operation == 'enleve') {
830
+            $plugin = array_diff($plugin_valides, $plugin);
831
+        } else {
832
+            $plugin = $plugin_valides;
833
+        }
834
+    }
835
+    $actifs_avant = $GLOBALS['meta']['plugin'] ?? '';
836
+
837
+    // si une fonction de gestion de dependances existe, l'appeler ici
838
+    if ($ajouter_dependances = charger_fonction('ajouter_dependances', 'plugins', true)) {
839
+        $plugin = $ajouter_dependances($plugin);
840
+    }
841
+
842
+    // recharger le xml des plugins a activer
843
+    // on force le reload ici, meme si le fichier xml n'a pas change
844
+    // pour ne pas rater l'ajout ou la suppression d'un fichier fonctions/options/administrations
845
+    // pourra etre evite quand on ne supportera plus les plugin.xml
846
+    // en deplacant la detection de ces fichiers dans la compilation ci dessous
847
+    [$infos, $liste, $invalides] = liste_plugin_valides($plugin, true);
848
+    // trouver l'ordre d'activation
849
+    [$plugin_valides, $ordre, $reste] = plugin_trier($infos, $liste);
850
+    if ($invalides || $reste) {
851
+        plugins_erreurs(array_merge($invalides, $reste), $liste, $infos);
852
+    }
853
+
854
+    // Ignorer les plugins necessitant une lib absente
855
+    // et preparer la meta d'entete Http
856
+    $err = $msg = $header = [];
857
+    foreach ($plugin_valides as $p => $resume) {
858
+        // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
859
+        if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') {
860
+            $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : '');
861
+        }
862
+        if ($resume['dir']) {
863
+            foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
864
+                if (!find_in_path($l['nom'], 'lib/')) {
865
+                    $err[$p] = $resume;
866
+                    $msg[$p][] = $l;
867
+                    unset($plugin_valides[$p]);
868
+                }
869
+            }
870
+        }
871
+    }
872
+    if ($err) {
873
+        plugins_erreurs($err, '', $infos, $msg);
874
+    }
875
+
876
+    if (isset($GLOBALS['meta']['message_crash_plugins'])) {
877
+        effacer_meta('message_crash_plugins');
878
+    }
879
+    ecrire_meta('plugin', serialize($plugin_valides));
880
+    $liste = array_diff_key($liste, $plugin_valides);
881
+    ecrire_meta('plugin_attente', serialize($liste));
882
+    $header = strtolower(implode(',', $header));
883
+    if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) {
884
+        ecrire_fichier(
885
+            _DIR_VAR . 'config.txt',
886
+            (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header
887
+        );
888
+    } else {
889
+        @unlink(_DIR_VAR . 'config.txt');
890
+    }
891
+    // generer charger_plugins_chemin.php
892
+    plugins_precompile_chemin($plugin_valides, $ordre);
893
+    // generer les fichiers
894
+    // - charger_plugins_options.php
895
+    // - charger_plugins_fonctions.php
896
+    plugins_precompile_xxxtions($plugin_valides, $ordre);
897
+    // charger les chemins des plugins et les fichiers d'options
898
+    // (qui peuvent déclarer / utiliser des pipelines, ajouter d'autres chemins)
899
+    plugins_amorcer_plugins_actifs();
900
+    // mise a jour de la matrice des pipelines
901
+    $prepend_code = pipeline_matrice_precompile($plugin_valides, $ordre, $pipe_recherche);
902
+    // generer le fichier _CACHE_PIPELINE
903
+    pipeline_precompile($prepend_code);
904
+
905
+    if (spip_connect()) {
906
+        // lancer et initialiser les nouveaux crons !
907
+        include_spip('inc/genie');
908
+        genie_queue_watch_dist();
909
+    }
910
+
911
+    return ($GLOBALS['meta']['plugin'] != $actifs_avant);
912 912
 }
913 913
 
914 914
 /**
@@ -927,75 +927,75 @@  discard block
 block discarded – undo
927 927
  *     Couples (prefixe => infos complètes) des plugins qui seront actifs, dans l'ordre de leurs dépendances
928 928
 **/
929 929
 function plugins_precompile_chemin($plugin_valides, $ordre) {
930
-	$chemins = [
931
-		'public' => [],
932
-		'prive' => []
933
-	];
934
-	$contenu = '';
935
-	foreach ($ordre as $p => $info) {
936
-		// $ordre peur contenir des plugins en attente et non valides pour ce hit
937
-		if (isset($plugin_valides[$p])) {
938
-			$dir_type = $plugin_valides[$p]['dir_type'];
939
-			$plug = $plugin_valides[$p]['dir'];
940
-			// definir le plugin, donc le path avant l'include du fichier options
941
-			// permet de faire des include_spip pour attraper un inc_ du plugin
942
-
943
-			$dir = $dir_type . ".'" . $plug . "/'";
944
-
945
-			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
946
-			if (
947
-				$prefix !== 'SPIP'
948
-				&& !str_contains($dir, ':') // exclure le cas des procure:
949
-			) {
950
-				$contenu .= "define('_DIR_PLUGIN_$prefix',$dir);\n";
951
-				if (!$info['chemin']) {
952
-					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
953
-					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
954
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
955
-						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956
-					}
957
-				}
958
-				else {
959
-					foreach ($info['chemin'] as $chemin) {
960
-						if (
961
-							!isset($chemin['version'])
962
-							|| plugin_version_compatible(
963
-								$chemin['version'],
964
-								$GLOBALS['spip_version_branche'],
965
-								'spip'
966
-							)
967
-						) {
968
-							$dir = $chemin['path'];
969
-							if (strlen($dir) && $dir[0] == '/') {
970
-								$dir = substr($dir, 1);
971
-							}
972
-							if (strlen($dir) && $dir == './') {
973
-								$dir = '';
974
-							}
975
-							if (strlen($dir)) {
976
-								$dir = rtrim($dir, '/') . '/';
977
-							}
978
-							if (!isset($chemin['type']) || $chemin['type'] == 'public') {
979
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
980
-							}
981
-							if (!isset($chemin['type']) || $chemin['type'] == 'prive') {
982
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
983
-							}
984
-						}
985
-					}
986
-				}
987
-			}
988
-		}
989
-	}
990
-	if (count($chemins['public']) || count($chemins['prive'])) {
991
-		$contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode(
992
-			',',
993
-			array_reverse($chemins['public'])
994
-		) . "]);\n"
995
-			. 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n";
996
-	}
997
-
998
-	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
930
+    $chemins = [
931
+        'public' => [],
932
+        'prive' => []
933
+    ];
934
+    $contenu = '';
935
+    foreach ($ordre as $p => $info) {
936
+        // $ordre peur contenir des plugins en attente et non valides pour ce hit
937
+        if (isset($plugin_valides[$p])) {
938
+            $dir_type = $plugin_valides[$p]['dir_type'];
939
+            $plug = $plugin_valides[$p]['dir'];
940
+            // definir le plugin, donc le path avant l'include du fichier options
941
+            // permet de faire des include_spip pour attraper un inc_ du plugin
942
+
943
+            $dir = $dir_type . ".'" . $plug . "/'";
944
+
945
+            $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
946
+            if (
947
+                $prefix !== 'SPIP'
948
+                && !str_contains($dir, ':') // exclure le cas des procure:
949
+            ) {
950
+                $contenu .= "define('_DIR_PLUGIN_$prefix',$dir);\n";
951
+                if (!$info['chemin']) {
952
+                    $chemins['public'][] = "_DIR_PLUGIN_$prefix";
953
+                    $chemins['prive'][] = "_DIR_PLUGIN_$prefix";
954
+                    if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
955
+                        $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956
+                    }
957
+                }
958
+                else {
959
+                    foreach ($info['chemin'] as $chemin) {
960
+                        if (
961
+                            !isset($chemin['version'])
962
+                            || plugin_version_compatible(
963
+                                $chemin['version'],
964
+                                $GLOBALS['spip_version_branche'],
965
+                                'spip'
966
+                            )
967
+                        ) {
968
+                            $dir = $chemin['path'];
969
+                            if (strlen($dir) && $dir[0] == '/') {
970
+                                $dir = substr($dir, 1);
971
+                            }
972
+                            if (strlen($dir) && $dir == './') {
973
+                                $dir = '';
974
+                            }
975
+                            if (strlen($dir)) {
976
+                                $dir = rtrim($dir, '/') . '/';
977
+                            }
978
+                            if (!isset($chemin['type']) || $chemin['type'] == 'public') {
979
+                                $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
980
+                            }
981
+                            if (!isset($chemin['type']) || $chemin['type'] == 'prive') {
982
+                                $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
983
+                            }
984
+                        }
985
+                    }
986
+                }
987
+            }
988
+        }
989
+    }
990
+    if (count($chemins['public']) || count($chemins['prive'])) {
991
+        $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode(
992
+            ',',
993
+            array_reverse($chemins['public'])
994
+        ) . "]);\n"
995
+            . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n";
996
+    }
997
+
998
+    ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
999 999
 }
1000 1000
 
1001 1001
 /**
@@ -1013,65 +1013,65 @@  discard block
 block discarded – undo
1013 1013
  *     Couples (prefixe => infos complètes) des plugins qui seront actifs, dans l'ordre de leurs dépendances
1014 1014
 **/
1015 1015
 function plugins_precompile_xxxtions($plugin_valides, $ordre) {
1016
-	$contenu = ['options' => '', 'fonctions' => ''];
1017
-	$boutons = [];
1018
-	$onglets = [];
1019
-	$sign = '';
1020
-
1021
-	foreach ($ordre as $p => $info) {
1022
-		// $ordre peur contenir des plugins en attente et non valides pour ce hit
1023
-		if (isset($plugin_valides[$p])) {
1024
-			$dir_type = $plugin_valides[$p]['dir_type'];
1025
-			$plug = $plugin_valides[$p]['dir'];
1026
-			$dir = constant($dir_type);
1027
-			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1028
-			if ($info['menu']) {
1029
-				$boutons = array_merge($boutons, $info['menu']);
1030
-			}
1031
-			if ($info['onglet']) {
1032
-				$onglets = array_merge($onglets, $info['onglet']);
1033
-			}
1034
-			foreach ($contenu as $charge => $v) {
1035
-				// si pas declare/detecte a la lecture du paquet.xml,
1036
-				// detecer a nouveau ici puisque son ajout ne provoque pas une modif du paquet.xml
1037
-				// donc ni sa relecture, ni sa detection
1038
-				if (
1039
-					!isset($info[$charge])
1040
-					&& $dir
1041
-					&& !str_contains($dir, ':')
1042
-					&& file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1043
-				) {
1044
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) {
1045
-						$info[$charge] = [$file];
1046
-					}
1047
-				}
1048
-				if (isset($info[$charge])) {
1049
-					$files = $info[$charge];
1050
-					foreach ($files as $k => $file) {
1051
-						// on genere un if file_exists devant chaque include
1052
-						// pour pouvoir garder le meme niveau d'erreur general
1053
-						$file = trim($file);
1054
-						if (
1055
-							!is_readable("$dir$plug/$file") && file_exists("$dir$plug/paquet.xml")
1056
-						) {
1057
-							unset($info[$charge][$k]);
1058
-						} else {
1059
-							$_file = $root_dir_type . ".'$plug/$file'";
1060
-							$contenu[$charge] .= "include_once_check($_file);\n";
1061
-						}
1062
-					}
1063
-				}
1064
-			}
1065
-			$sign .= md5(serialize($info));
1066
-		}
1067
-	}
1068
-
1069
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1070
-	$contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons)
1071
-		. plugin_ongletbouton('onglets_plugins', $onglets);
1072
-
1073
-	ecrire_fichier_php(_CACHE_PLUGINS_OPT, $contenu['options']);
1074
-	ecrire_fichier_php(_CACHE_PLUGINS_FCT, $contenu['fonctions']);
1016
+    $contenu = ['options' => '', 'fonctions' => ''];
1017
+    $boutons = [];
1018
+    $onglets = [];
1019
+    $sign = '';
1020
+
1021
+    foreach ($ordre as $p => $info) {
1022
+        // $ordre peur contenir des plugins en attente et non valides pour ce hit
1023
+        if (isset($plugin_valides[$p])) {
1024
+            $dir_type = $plugin_valides[$p]['dir_type'];
1025
+            $plug = $plugin_valides[$p]['dir'];
1026
+            $dir = constant($dir_type);
1027
+            $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1028
+            if ($info['menu']) {
1029
+                $boutons = array_merge($boutons, $info['menu']);
1030
+            }
1031
+            if ($info['onglet']) {
1032
+                $onglets = array_merge($onglets, $info['onglet']);
1033
+            }
1034
+            foreach ($contenu as $charge => $v) {
1035
+                // si pas declare/detecte a la lecture du paquet.xml,
1036
+                // detecer a nouveau ici puisque son ajout ne provoque pas une modif du paquet.xml
1037
+                // donc ni sa relecture, ni sa detection
1038
+                if (
1039
+                    !isset($info[$charge])
1040
+                    && $dir
1041
+                    && !str_contains($dir, ':')
1042
+                    && file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1043
+                ) {
1044
+                    if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) {
1045
+                        $info[$charge] = [$file];
1046
+                    }
1047
+                }
1048
+                if (isset($info[$charge])) {
1049
+                    $files = $info[$charge];
1050
+                    foreach ($files as $k => $file) {
1051
+                        // on genere un if file_exists devant chaque include
1052
+                        // pour pouvoir garder le meme niveau d'erreur general
1053
+                        $file = trim($file);
1054
+                        if (
1055
+                            !is_readable("$dir$plug/$file") && file_exists("$dir$plug/paquet.xml")
1056
+                        ) {
1057
+                            unset($info[$charge][$k]);
1058
+                        } else {
1059
+                            $_file = $root_dir_type . ".'$plug/$file'";
1060
+                            $contenu[$charge] .= "include_once_check($_file);\n";
1061
+                        }
1062
+                    }
1063
+                }
1064
+            }
1065
+            $sign .= md5(serialize($info));
1066
+        }
1067
+    }
1068
+
1069
+    $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1070
+    $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons)
1071
+        . plugin_ongletbouton('onglets_plugins', $onglets);
1072
+
1073
+    ecrire_fichier_php(_CACHE_PLUGINS_OPT, $contenu['options']);
1074
+    ecrire_fichier_php(_CACHE_PLUGINS_FCT, $contenu['fonctions']);
1075 1075
 }
1076 1076
 
1077 1077
 /**
@@ -1090,24 +1090,24 @@  discard block
 block discarded – undo
1090 1090
  * @return string Code php
1091 1091
  */
1092 1092
 function plugin_ongletbouton($nom, $val) {
1093
-	if (!$val) {
1094
-		$val = [];
1095
-	}
1096
-
1097
-	$val = serialize($val);
1098
-	$md5 = md5($val);
1099
-
1100
-	if (!defined("_UPDATED_$nom")) {
1101
-		define("_UPDATED_$nom", $val);
1102
-		define("_UPDATED_md5_$nom", $md5);
1103
-	}
1104
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1105
-
1106
-	return
1107
-		"if (!function_exists('$nom')) {\n"
1108
-		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1109
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1110
-		. "}\n";
1093
+    if (!$val) {
1094
+        $val = [];
1095
+    }
1096
+
1097
+    $val = serialize($val);
1098
+    $md5 = md5($val);
1099
+
1100
+    if (!defined("_UPDATED_$nom")) {
1101
+        define("_UPDATED_$nom", $val);
1102
+        define("_UPDATED_md5_$nom", $md5);
1103
+    }
1104
+    $val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1105
+
1106
+    return
1107
+        "if (!function_exists('$nom')) {\n"
1108
+        . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1109
+        . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1110
+        . "}\n";
1111 1111
 }
1112 1112
 
1113 1113
 /**
@@ -1122,15 +1122,15 @@  discard block
 block discarded – undo
1122 1122
 **/
1123 1123
 function plugins_amorcer_plugins_actifs() {
1124 1124
 
1125
-	if (@is_readable(_CACHE_PLUGINS_PATH)) {
1126
-		include_once(_CACHE_PLUGINS_PATH);
1127
-	}
1125
+    if (@is_readable(_CACHE_PLUGINS_PATH)) {
1126
+        include_once(_CACHE_PLUGINS_PATH);
1127
+    }
1128 1128
 
1129
-	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1130
-		include_once(_CACHE_PLUGINS_OPT);
1131
-	} else {
1132
-		spip_logger()->info('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT);
1133
-	}
1129
+    if (@is_readable(_CACHE_PLUGINS_OPT)) {
1130
+        include_once(_CACHE_PLUGINS_OPT);
1131
+    } else {
1132
+        spip_logger()->info('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT);
1133
+    }
1134 1134
 }
1135 1135
 
1136 1136
 /**
@@ -1153,140 +1153,140 @@  discard block
 block discarded – undo
1153 1153
  *     Couples (nom du pipeline => Code PHP à insérer au début du pipeline)
1154 1154
 **/
1155 1155
 function pipeline_matrice_precompile($plugin_valides, $ordre, $pipe_recherche) {
1156
-	static $liste_pipe_manquants = [];
1157
-	if (($pipe_recherche) && (!in_array($pipe_recherche, $liste_pipe_manquants))) {
1158
-		$liste_pipe_manquants[] = $pipe_recherche;
1159
-	}
1160
-
1161
-	$prepend_code = [];
1162
-
1163
-	foreach ($ordre as $p => $info) {
1164
-		// $ordre peur contenir des plugins en attente et non valides pour ce hit
1165
-		if (isset($plugin_valides[$p])) {
1166
-			$dir_type = $plugin_valides[$p]['dir_type'];
1167
-			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1168
-			$plug = $plugin_valides[$p]['dir'];
1169
-			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_');
1170
-			if (isset($info['pipeline']) && is_array($info['pipeline'])) {
1171
-				foreach ($info['pipeline'] as $pipe) {
1172
-					$nom = $pipe['nom'];
1173
-					if (isset($pipe['action'])) {
1174
-						$action = $pipe['action'];
1175
-					} else {
1176
-						$action = $nom;
1177
-					}
1178
-					$nomlower = strtolower($nom);
1179
-					if (
1180
-						$nomlower != $nom
1181
-						&& isset($GLOBALS['spip_pipeline'][$nom])
1182
-						&& !isset($GLOBALS['spip_pipeline'][$nomlower])
1183
-					) {
1184
-						$GLOBALS['spip_pipeline'][$nomlower] = $GLOBALS['spip_pipeline'][$nom];
1185
-						unset($GLOBALS['spip_pipeline'][$nom]);
1186
-					}
1187
-					$nom = $nomlower;
1188
-					// une action vide est une declaration qui ne doit pas etre compilee !
1189
-					if (!isset($GLOBALS['spip_pipeline'][$nom])) { // creer le pipeline eventuel
1190
-					$GLOBALS['spip_pipeline'][$nom] = '';
1191
-					}
1192
-					if ($action) {
1193
-						if (!str_contains($GLOBALS['spip_pipeline'][$nom], (string) "|$prefix$action")) {
1194
-							$GLOBALS['spip_pipeline'][$nom] = preg_replace(
1195
-								',(\|\||$),',
1196
-								"|$prefix$action\\1",
1197
-								$GLOBALS['spip_pipeline'][$nom],
1198
-								1
1199
-							);
1200
-						}
1201
-						if (isset($pipe['inclure'])) {
1202
-							$GLOBALS['spip_matrice']["$prefix$action"] =
1203
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1204
-						}
1205
-					}
1206
-				}
1207
-			}
1208
-			if (isset($info['genie']) && (is_countable($info['genie']) ? count($info['genie']) : 0)) {
1209
-				if (!isset($prepend_code['taches_generales_cron'])) {
1210
-					$prepend_code['taches_generales_cron'] = '';
1211
-				}
1212
-				foreach ($info['genie'] as $genie) {
1213
-					$nom = $prefix . $genie['nom'];
1214
-					$periode = max(60, intval($genie['periode']));
1215
-					if (charger_fonction($nom, 'genie', true)) {
1216
-						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
1217
-					} else {
1218
-						spip_logger()->error("Fonction genie_$nom introuvable");
1219
-					}
1220
-				}
1221
-			}
1222
-			if (isset($info['style']) && (is_countable($info['style']) ? count($info['style']) : 0)) {
1223
-				if (!isset($prepend_code['insert_head_css'])) {
1224
-					$prepend_code['insert_head_css'] = '';
1225
-				}
1226
-				if (!isset($prepend_code['header_prive_css'])) {
1227
-					$prepend_code['header_prive_css'] = '';
1228
-				}
1229
-				foreach ($info['style'] as $style) {
1230
-					if (isset($style['path']) && $style['path']) {
1231
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1232
-					} else {
1233
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1234
-					}
1235
-					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1236
-					if (isset($style['media']) && strlen($style['media'])) {
1237
-						$code .= ' media="' . addslashes($style['media']) . '"';
1238
-					}
1239
-					$code .= "/>';\n";
1240
-					if ($style['type'] != 'prive') {
1241
-						$prepend_code['insert_head_css'] .= $code;
1242
-					}
1243
-					if ($style['type'] != 'public') {
1244
-						$prepend_code['header_prive_css'] .= $code;
1245
-					}
1246
-				}
1247
-			}
1248
-			if (!isset($prepend_code['insert_head'])) {
1249
-				$prepend_code['insert_head'] = '';
1250
-			}
1251
-			if (!isset($prepend_code['header_prive'])) {
1252
-				$prepend_code['header_prive'] = '';
1253
-			}
1254
-			if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) {
1255
-				foreach ($info['script'] as $script) {
1256
-					if (isset($script['path']) && $script['path']) {
1257
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1258
-					} else {
1259
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1260
-					}
1261
-					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1262
-					if ($script['type'] != 'prive') {
1263
-						$prepend_code['insert_head'] .= $code;
1264
-					}
1265
-					if ($script['type'] != 'public') {
1266
-						$prepend_code['header_prive'] .= $code;
1267
-					}
1268
-				}
1269
-			}
1270
-		}
1271
-	}
1272
-
1273
-	$prepend_code['insert_head'] =
1274
-		"include_once_check(_DIR_RESTREINT . 'inc/pipelines.php');\n"
1275
-		. "\$val = minipipe('f_jQuery', \$val);\n"
1276
-		. $prepend_code['insert_head'];
1277
-	$prepend_code['header_prive'] =
1278
-		"include_once_check(_DIR_RESTREINT . 'inc/pipelines_ecrire.php');\n"
1279
-		. "\$val = minipipe('f_jQuery_prive', \$val);\n"
1280
-		. $prepend_code['header_prive'];
1281
-
1282
-	// on ajoute les pipe qui ont ete recenses manquants
1283
-	foreach ($liste_pipe_manquants as $add_pipe) {
1284
-		if (!isset($GLOBALS['spip_pipeline'][$add_pipe])) {
1285
-			$GLOBALS['spip_pipeline'][$add_pipe] = '';
1286
-		}
1287
-	}
1288
-
1289
-	return $prepend_code;
1156
+    static $liste_pipe_manquants = [];
1157
+    if (($pipe_recherche) && (!in_array($pipe_recherche, $liste_pipe_manquants))) {
1158
+        $liste_pipe_manquants[] = $pipe_recherche;
1159
+    }
1160
+
1161
+    $prepend_code = [];
1162
+
1163
+    foreach ($ordre as $p => $info) {
1164
+        // $ordre peur contenir des plugins en attente et non valides pour ce hit
1165
+        if (isset($plugin_valides[$p])) {
1166
+            $dir_type = $plugin_valides[$p]['dir_type'];
1167
+            $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1168
+            $plug = $plugin_valides[$p]['dir'];
1169
+            $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_');
1170
+            if (isset($info['pipeline']) && is_array($info['pipeline'])) {
1171
+                foreach ($info['pipeline'] as $pipe) {
1172
+                    $nom = $pipe['nom'];
1173
+                    if (isset($pipe['action'])) {
1174
+                        $action = $pipe['action'];
1175
+                    } else {
1176
+                        $action = $nom;
1177
+                    }
1178
+                    $nomlower = strtolower($nom);
1179
+                    if (
1180
+                        $nomlower != $nom
1181
+                        && isset($GLOBALS['spip_pipeline'][$nom])
1182
+                        && !isset($GLOBALS['spip_pipeline'][$nomlower])
1183
+                    ) {
1184
+                        $GLOBALS['spip_pipeline'][$nomlower] = $GLOBALS['spip_pipeline'][$nom];
1185
+                        unset($GLOBALS['spip_pipeline'][$nom]);
1186
+                    }
1187
+                    $nom = $nomlower;
1188
+                    // une action vide est une declaration qui ne doit pas etre compilee !
1189
+                    if (!isset($GLOBALS['spip_pipeline'][$nom])) { // creer le pipeline eventuel
1190
+                    $GLOBALS['spip_pipeline'][$nom] = '';
1191
+                    }
1192
+                    if ($action) {
1193
+                        if (!str_contains($GLOBALS['spip_pipeline'][$nom], (string) "|$prefix$action")) {
1194
+                            $GLOBALS['spip_pipeline'][$nom] = preg_replace(
1195
+                                ',(\|\||$),',
1196
+                                "|$prefix$action\\1",
1197
+                                $GLOBALS['spip_pipeline'][$nom],
1198
+                                1
1199
+                            );
1200
+                        }
1201
+                        if (isset($pipe['inclure'])) {
1202
+                            $GLOBALS['spip_matrice']["$prefix$action"] =
1203
+                                "$root_dir_type:$plug/" . $pipe['inclure'];
1204
+                        }
1205
+                    }
1206
+                }
1207
+            }
1208
+            if (isset($info['genie']) && (is_countable($info['genie']) ? count($info['genie']) : 0)) {
1209
+                if (!isset($prepend_code['taches_generales_cron'])) {
1210
+                    $prepend_code['taches_generales_cron'] = '';
1211
+                }
1212
+                foreach ($info['genie'] as $genie) {
1213
+                    $nom = $prefix . $genie['nom'];
1214
+                    $periode = max(60, intval($genie['periode']));
1215
+                    if (charger_fonction($nom, 'genie', true)) {
1216
+                        $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
1217
+                    } else {
1218
+                        spip_logger()->error("Fonction genie_$nom introuvable");
1219
+                    }
1220
+                }
1221
+            }
1222
+            if (isset($info['style']) && (is_countable($info['style']) ? count($info['style']) : 0)) {
1223
+                if (!isset($prepend_code['insert_head_css'])) {
1224
+                    $prepend_code['insert_head_css'] = '';
1225
+                }
1226
+                if (!isset($prepend_code['header_prive_css'])) {
1227
+                    $prepend_code['header_prive_css'] = '';
1228
+                }
1229
+                foreach ($info['style'] as $style) {
1230
+                    if (isset($style['path']) && $style['path']) {
1231
+                        $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1232
+                    } else {
1233
+                        $code = "if (\$f='" . addslashes($style['url']) . "') ";
1234
+                    }
1235
+                    $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1236
+                    if (isset($style['media']) && strlen($style['media'])) {
1237
+                        $code .= ' media="' . addslashes($style['media']) . '"';
1238
+                    }
1239
+                    $code .= "/>';\n";
1240
+                    if ($style['type'] != 'prive') {
1241
+                        $prepend_code['insert_head_css'] .= $code;
1242
+                    }
1243
+                    if ($style['type'] != 'public') {
1244
+                        $prepend_code['header_prive_css'] .= $code;
1245
+                    }
1246
+                }
1247
+            }
1248
+            if (!isset($prepend_code['insert_head'])) {
1249
+                $prepend_code['insert_head'] = '';
1250
+            }
1251
+            if (!isset($prepend_code['header_prive'])) {
1252
+                $prepend_code['header_prive'] = '';
1253
+            }
1254
+            if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) {
1255
+                foreach ($info['script'] as $script) {
1256
+                    if (isset($script['path']) && $script['path']) {
1257
+                        $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1258
+                    } else {
1259
+                        $code = "if (\$f='" . addslashes($script['url']) . "') ";
1260
+                    }
1261
+                    $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1262
+                    if ($script['type'] != 'prive') {
1263
+                        $prepend_code['insert_head'] .= $code;
1264
+                    }
1265
+                    if ($script['type'] != 'public') {
1266
+                        $prepend_code['header_prive'] .= $code;
1267
+                    }
1268
+                }
1269
+            }
1270
+        }
1271
+    }
1272
+
1273
+    $prepend_code['insert_head'] =
1274
+        "include_once_check(_DIR_RESTREINT . 'inc/pipelines.php');\n"
1275
+        . "\$val = minipipe('f_jQuery', \$val);\n"
1276
+        . $prepend_code['insert_head'];
1277
+    $prepend_code['header_prive'] =
1278
+        "include_once_check(_DIR_RESTREINT . 'inc/pipelines_ecrire.php');\n"
1279
+        . "\$val = minipipe('f_jQuery_prive', \$val);\n"
1280
+        . $prepend_code['header_prive'];
1281
+
1282
+    // on ajoute les pipe qui ont ete recenses manquants
1283
+    foreach ($liste_pipe_manquants as $add_pipe) {
1284
+        if (!isset($GLOBALS['spip_pipeline'][$add_pipe])) {
1285
+            $GLOBALS['spip_pipeline'][$add_pipe] = '';
1286
+        }
1287
+    }
1288
+
1289
+    return $prepend_code;
1290 1290
 }
1291 1291
 
1292 1292
 /**
@@ -1313,62 +1313,62 @@  discard block
 block discarded – undo
1313 1313
 **/
1314 1314
 function pipeline_precompile($prepend_code = []) {
1315 1315
 
1316
-	$all_pipes = $all_pipes_end = '';
1317
-	if (!empty($GLOBALS['spip_pipeline']['all'])) {
1318
-		$a = explode('||', $GLOBALS['spip_pipeline']['all'], 2);
1319
-		unset($GLOBALS['spip_pipeline']['all']);
1320
-		$all_pipes = trim(array_shift($a));
1321
-		if ($all_pipes) {
1322
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1323
-		}
1324
-		if (count($a)) {
1325
-			$all_pipes_end = '||' . array_shift($a);
1326
-		}
1327
-	}
1328
-	$content = '';
1329
-	foreach ($GLOBALS['spip_pipeline'] as $action => $pipeline) {
1330
-		$s_inc = '';
1331
-		$s_call = '';
1332
-		if ($all_pipes) {
1333
-			$pipeline = preg_replace(',(\|\||$),', "$all_pipes\\1", $pipeline, 1);
1334
-		}
1335
-		if ($all_pipes_end) {
1336
-			$pipeline .= $all_pipes_end;
1337
-		}
1338
-		$pipe = array_filter(explode('|', $pipeline));
1339
-		// Eclater le pipeline en filtres et appliquer chaque filtre
1340
-		foreach ($pipe as $fonc) {
1341
-			$fonc = trim($fonc);
1342
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1343
-			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1344
-				$file = $GLOBALS['spip_matrice'][$fonc];
1345
-				$file = "'$file'";
1346
-				// si un _DIR_XXX: est dans la chaine, on extrait la constante
1347
-				if (preg_match(',(_(DIR|ROOT)_[A-Z_]+):,Ums', $file, $regs)) {
1348
-					$dir = $regs[1];
1349
-					$root_dir = str_replace('_DIR_', '_ROOT_', $dir);
1350
-					if (defined($root_dir)) {
1351
-						$dir = $root_dir;
1352
-					}
1353
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1354
-					$file = str_replace("''.", '', $file);
1355
-					$file = str_replace(constant($dir), '', $file);
1356
-				}
1357
-				$s_inc .= "include_once_check($file);\n";
1358
-			}
1359
-		}
1360
-		if (strlen($s_inc)) {
1361
-			$s_inc = "static \$inc=null;\nif (!\$inc){\n$s_inc\$inc=true;\n}\n";
1362
-		}
1363
-		$content .= "// Pipeline $action \n"
1364
-			. "function execute_pipeline_$action(&\$val){\n"
1365
-			. $s_inc
1366
-			. ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1367
-			. $s_call
1368
-			. "return \$val;\n}\n";
1369
-	}
1370
-	ecrire_fichier_php(_CACHE_PIPELINES, $content);
1371
-	clear_path_cache();
1316
+    $all_pipes = $all_pipes_end = '';
1317
+    if (!empty($GLOBALS['spip_pipeline']['all'])) {
1318
+        $a = explode('||', $GLOBALS['spip_pipeline']['all'], 2);
1319
+        unset($GLOBALS['spip_pipeline']['all']);
1320
+        $all_pipes = trim(array_shift($a));
1321
+        if ($all_pipes) {
1322
+            $all_pipes = '|' . ltrim($all_pipes, '|');
1323
+        }
1324
+        if (count($a)) {
1325
+            $all_pipes_end = '||' . array_shift($a);
1326
+        }
1327
+    }
1328
+    $content = '';
1329
+    foreach ($GLOBALS['spip_pipeline'] as $action => $pipeline) {
1330
+        $s_inc = '';
1331
+        $s_call = '';
1332
+        if ($all_pipes) {
1333
+            $pipeline = preg_replace(',(\|\||$),', "$all_pipes\\1", $pipeline, 1);
1334
+        }
1335
+        if ($all_pipes_end) {
1336
+            $pipeline .= $all_pipes_end;
1337
+        }
1338
+        $pipe = array_filter(explode('|', $pipeline));
1339
+        // Eclater le pipeline en filtres et appliquer chaque filtre
1340
+        foreach ($pipe as $fonc) {
1341
+            $fonc = trim($fonc);
1342
+            $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1343
+            if (isset($GLOBALS['spip_matrice'][$fonc])) {
1344
+                $file = $GLOBALS['spip_matrice'][$fonc];
1345
+                $file = "'$file'";
1346
+                // si un _DIR_XXX: est dans la chaine, on extrait la constante
1347
+                if (preg_match(',(_(DIR|ROOT)_[A-Z_]+):,Ums', $file, $regs)) {
1348
+                    $dir = $regs[1];
1349
+                    $root_dir = str_replace('_DIR_', '_ROOT_', $dir);
1350
+                    if (defined($root_dir)) {
1351
+                        $dir = $root_dir;
1352
+                    }
1353
+                    $file = str_replace($regs[0], "'." . $dir . ".'", $file);
1354
+                    $file = str_replace("''.", '', $file);
1355
+                    $file = str_replace(constant($dir), '', $file);
1356
+                }
1357
+                $s_inc .= "include_once_check($file);\n";
1358
+            }
1359
+        }
1360
+        if (strlen($s_inc)) {
1361
+            $s_inc = "static \$inc=null;\nif (!\$inc){\n$s_inc\$inc=true;\n}\n";
1362
+        }
1363
+        $content .= "// Pipeline $action \n"
1364
+            . "function execute_pipeline_$action(&\$val){\n"
1365
+            . $s_inc
1366
+            . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1367
+            . $s_call
1368
+            . "return \$val;\n}\n";
1369
+    }
1370
+    ecrire_fichier_php(_CACHE_PIPELINES, $content);
1371
+    clear_path_cache();
1372 1372
 }
1373 1373
 
1374 1374
 
@@ -1381,12 +1381,12 @@  discard block
 block discarded – undo
1381 1381
  *     true si le plugin est actif, false sinon
1382 1382
 **/
1383 1383
 function plugin_est_installe($plug_path) {
1384
-	$plugin_installes = isset($GLOBALS['meta']['plugin_installes']) ? unserialize($GLOBALS['meta']['plugin_installes']) : [];
1385
-	if (!$plugin_installes) {
1386
-		return false;
1387
-	}
1384
+    $plugin_installes = isset($GLOBALS['meta']['plugin_installes']) ? unserialize($GLOBALS['meta']['plugin_installes']) : [];
1385
+    if (!$plugin_installes) {
1386
+        return false;
1387
+    }
1388 1388
 
1389
-	return in_array($plug_path, $plugin_installes);
1389
+    return in_array($plug_path, $plugin_installes);
1390 1390
 }
1391 1391
 
1392 1392
 
@@ -1399,46 +1399,46 @@  discard block
 block discarded – undo
1399 1399
  * @uses plugins_installer_dist()
1400 1400
  **/
1401 1401
 function plugin_installes_meta() {
1402
-	if (isset($GLOBALS['fichier_php_compile_recent'])) {
1403
-		// attendre eventuellement l'invalidation du cache opcode
1404
-		spip_attend_invalidation_opcode_cache($GLOBALS['fichier_php_compile_recent']);
1405
-	}
1406
-
1407
-	$installer_plugins = charger_fonction('installer', 'plugins');
1408
-	$meta_plug_installes = [];
1409
-	foreach (unserialize($GLOBALS['meta']['plugin']) as $prefix => $resume) {
1410
-		if ($plug = $resume['dir']) {
1411
-			$infos = $installer_plugins($plug, 'install', $resume['dir_type']);
1412
-			if ($infos) {
1413
-				if (!is_array($infos) || $infos['install_test'][0]) {
1414
-					$meta_plug_installes[] = $plug;
1415
-				}
1416
-				if (is_array($infos)) {
1417
-					[$ok, $trace] = $infos['install_test'];
1418
-					$titre = _T('plugin_titre_installation', ['plugin' => typo($infos['nom'])]);
1419
-					$result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec'));
1420
-					if (_IS_CLI) {
1421
-						include_spip('inc/filtres');
1422
-						$trace = ltrim(textebrut($trace) . "\n" . $result);
1423
-						$trace = '    ' . str_replace("\n", "\n    ", $trace);
1424
-						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1425
-						  $trace,
1426
-						  "\n";
1427
-					}
1428
-					else {
1429
-						include_spip('inc/filtres_boites');
1430
-						echo "<div class='install-plugins svp_retour'>"
1431
-							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
1432
-							. $trace
1433
-							. "<div class='result'>$result</div>"
1434
-							. boite_fermer()
1435
-							. '</div>';
1436
-					}
1437
-				}
1438
-			}
1439
-		}
1440
-	}
1441
-	ecrire_meta('plugin_installes', serialize($meta_plug_installes), 'non');
1402
+    if (isset($GLOBALS['fichier_php_compile_recent'])) {
1403
+        // attendre eventuellement l'invalidation du cache opcode
1404
+        spip_attend_invalidation_opcode_cache($GLOBALS['fichier_php_compile_recent']);
1405
+    }
1406
+
1407
+    $installer_plugins = charger_fonction('installer', 'plugins');
1408
+    $meta_plug_installes = [];
1409
+    foreach (unserialize($GLOBALS['meta']['plugin']) as $prefix => $resume) {
1410
+        if ($plug = $resume['dir']) {
1411
+            $infos = $installer_plugins($plug, 'install', $resume['dir_type']);
1412
+            if ($infos) {
1413
+                if (!is_array($infos) || $infos['install_test'][0]) {
1414
+                    $meta_plug_installes[] = $plug;
1415
+                }
1416
+                if (is_array($infos)) {
1417
+                    [$ok, $trace] = $infos['install_test'];
1418
+                    $titre = _T('plugin_titre_installation', ['plugin' => typo($infos['nom'])]);
1419
+                    $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec'));
1420
+                    if (_IS_CLI) {
1421
+                        include_spip('inc/filtres');
1422
+                        $trace = ltrim(textebrut($trace) . "\n" . $result);
1423
+                        $trace = '    ' . str_replace("\n", "\n    ", $trace);
1424
+                        echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1425
+                            $trace,
1426
+                            "\n";
1427
+                    }
1428
+                    else {
1429
+                        include_spip('inc/filtres_boites');
1430
+                        echo "<div class='install-plugins svp_retour'>"
1431
+                            . boite_ouvrir($titre, ($ok ? 'success' : 'error'))
1432
+                            . $trace
1433
+                            . "<div class='result'>$result</div>"
1434
+                            . boite_fermer()
1435
+                            . '</div>';
1436
+                    }
1437
+                }
1438
+            }
1439
+        }
1440
+    }
1441
+    ecrire_meta('plugin_installes', serialize($meta_plug_installes), 'non');
1442 1442
 }
1443 1443
 
1444 1444
 /**
@@ -1452,29 +1452,29 @@  discard block
 block discarded – undo
1452 1452
  *     Commentaire : code écrit en tout début de fichier, après la balise PHP ouvrante
1453 1453
 **/
1454 1454
 function ecrire_fichier_php($nom, $contenu, $comment = '') {
1455
-	if (!isset($GLOBALS['fichier_php_compile_recent'])) {
1456
-		$GLOBALS['fichier_php_compile_recent'] = 0;
1457
-	}
1458
-
1459
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1460
-	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1461
-	// si pas de modif on ne touche pas au fichier initial
1462
-	if (file_exists($nom)) {
1463
-		if (str_ends_with($nom, '.php')) {
1464
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1465
-		}
1466
-		else {
1467
-			$fichier_tmp = $nom . '.tmp';
1468
-		}
1469
-		file_put_contents($fichier_tmp, $contenu);
1470
-		if (md5_file($nom) == md5_file($fichier_tmp)) {
1471
-			$GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1472
-			@unlink($fichier_tmp);
1473
-			return;
1474
-		}
1475
-		@unlink($fichier_tmp);
1476
-	}
1477
-	ecrire_fichier($nom, $contenu);
1478
-	$GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1479
-	spip_clear_opcode_cache(realpath($nom));
1455
+    if (!isset($GLOBALS['fichier_php_compile_recent'])) {
1456
+        $GLOBALS['fichier_php_compile_recent'] = 0;
1457
+    }
1458
+
1459
+    $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1460
+    // si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1461
+    // si pas de modif on ne touche pas au fichier initial
1462
+    if (file_exists($nom)) {
1463
+        if (str_ends_with($nom, '.php')) {
1464
+            $fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1465
+        }
1466
+        else {
1467
+            $fichier_tmp = $nom . '.tmp';
1468
+        }
1469
+        file_put_contents($fichier_tmp, $contenu);
1470
+        if (md5_file($nom) == md5_file($fichier_tmp)) {
1471
+            $GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1472
+            @unlink($fichier_tmp);
1473
+            return;
1474
+        }
1475
+        @unlink($fichier_tmp);
1476
+    }
1477
+    ecrire_fichier($nom, $contenu);
1478
+    $GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1479
+    spip_clear_opcode_cache(realpath($nom));
1480 1480
 }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
23 23
 if (!defined('_DIR_PLUGINS_AUTO')) {
24
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
24
+	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/');
25 25
 }
26 26
 
27 27
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 				if ($dir) {
379 379
 					$dir .= '/';
380 380
 				}
381
-				$dir .= 'procure:' . $procure['nom'];
381
+				$dir .= 'procure:'.$procure['nom'];
382 382
 
383 383
 				$procure['etat'] = '?';
384 384
 				$procure['dir_type'] = $resume['dir_type'];
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		$plug = $resume['dir'];
559 559
 		$k = $infos[$dir_type][$plug];
560 560
 
561
-		$plug = constant($dir_type) . $plug;
561
+		$plug = constant($dir_type).$plug;
562 562
 		if (!isset($msg[$p])) {
563 563
 			if (isset($resume['erreur']) && $resume['erreur']) {
564 564
 				$msg[$p] = [$resume['erreur']];
@@ -601,10 +601,10 @@  discard block
 block discarded – undo
601 601
 		$list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation'];
602 602
 	} elseif (!$raw) {
603 603
 		foreach ($list as $plug => $msg) {
604
-			$list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug])
605
-				. '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>';
604
+			$list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug])
605
+				. '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>';
606 606
 		}
607
-		$list = '<ul>' . join("\n", $list) . '</ul>';
607
+		$list = '<ul>'.join("\n", $list).'</ul>';
608 608
 	}
609 609
 	if ($raz) {
610 610
 		effacer_meta('plugin_erreur_activation');
@@ -718,13 +718,13 @@  discard block
 block discarded – undo
718 718
 			if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) {
719 719
 				return _T("plugin_{$balise}_{$type}", [
720 720
 					'plugin' => $nom,
721
-					'version' => ' &ge; ' . $minimum
721
+					'version' => ' &ge; '.$minimum
722 722
 				]);
723 723
 			}
724 724
 			if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) {
725 725
 				return _T("plugin_{$balise}_{$type}", [
726 726
 					'plugin' => $nom,
727
-					'version' => ' &gt; ' . $minimum
727
+					'version' => ' &gt; '.$minimum
728 728
 				]);
729 729
 			}
730 730
 		}
@@ -733,13 +733,13 @@  discard block
 block discarded – undo
733 733
 			if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) {
734 734
 				return _T("plugin_{$balise}_{$type}", [
735 735
 					'plugin' => $nom,
736
-					'version' => ' &le; ' . $maximum
736
+					'version' => ' &le; '.$maximum
737 737
 				]);
738 738
 			}
739 739
 			if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) {
740 740
 				return _T("plugin_{$balise}_plugin", [
741 741
 					'plugin' => $nom,
742
-					'version' => ' &lt; ' . $maximum
742
+					'version' => ' &lt; '.$maximum
743 743
 				]);
744 744
 			}
745 745
 		}
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 		include_spip('inc/charger_plugin');
759 759
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
760 760
 	}*/
761
-	return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>";
761
+	return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>";
762 762
 }
763 763
 
764 764
 
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	foreach ($plugin_valides as $p => $resume) {
858 858
 		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
859 859
 		if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') {
860
-			$header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : '');
860
+			$header[] = $p.($resume['version'] ? '('.$resume['version'].')' : '');
861 861
 		}
862 862
 		if ($resume['dir']) {
863 863
 			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
@@ -882,11 +882,11 @@  discard block
 block discarded – undo
882 882
 	$header = strtolower(implode(',', $header));
883 883
 	if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) {
884 884
 		ecrire_fichier(
885
-			_DIR_VAR . 'config.txt',
886
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header
885
+			_DIR_VAR.'config.txt',
886
+			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header
887 887
 		);
888 888
 	} else {
889
-		@unlink(_DIR_VAR . 'config.txt');
889
+		@unlink(_DIR_VAR.'config.txt');
890 890
 	}
891 891
 	// generer charger_plugins_chemin.php
892 892
 	plugins_precompile_chemin($plugin_valides, $ordre);
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 			// definir le plugin, donc le path avant l'include du fichier options
941 941
 			// permet de faire des include_spip pour attraper un inc_ du plugin
942 942
 
943
-			$dir = $dir_type . ".'" . $plug . "/'";
943
+			$dir = $dir_type.".'".$plug."/'";
944 944
 
945 945
 			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
946 946
 			if (
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 				if (!$info['chemin']) {
952 952
 					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
953 953
 					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
954
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
954
+					if (is_dir(constant($dir_type).$plug.'/squelettes/')) {
955 955
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956 956
 					}
957 957
 				}
@@ -973,13 +973,13 @@  discard block
 block discarded – undo
973 973
 								$dir = '';
974 974
 							}
975 975
 							if (strlen($dir)) {
976
-								$dir = rtrim($dir, '/') . '/';
976
+								$dir = rtrim($dir, '/').'/';
977 977
 							}
978 978
 							if (!isset($chemin['type']) || $chemin['type'] == 'public') {
979
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
979
+								$chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
980 980
 							}
981 981
 							if (!isset($chemin['type']) || $chemin['type'] == 'prive') {
982
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
982
+								$chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
983 983
 							}
984 984
 						}
985 985
 					}
@@ -988,11 +988,11 @@  discard block
 block discarded – undo
988 988
 		}
989 989
 	}
990 990
 	if (count($chemins['public']) || count($chemins['prive'])) {
991
-		$contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode(
991
+		$contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode(
992 992
 			',',
993 993
 			array_reverse($chemins['public'])
994
-		) . "]);\n"
995
-			. 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n";
994
+		)."]);\n"
995
+			. 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n";
996 996
 	}
997 997
 
998 998
 	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 					&& !str_contains($dir, ':')
1042 1042
 					&& file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1043 1043
 				) {
1044
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) {
1044
+					if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) {
1045 1045
 						$info[$charge] = [$file];
1046 1046
 					}
1047 1047
 				}
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 						) {
1057 1057
 							unset($info[$charge][$k]);
1058 1058
 						} else {
1059
-							$_file = $root_dir_type . ".'$plug/$file'";
1059
+							$_file = $root_dir_type.".'$plug/$file'";
1060 1060
 							$contenu[$charge] .= "include_once_check($_file);\n";
1061 1061
 						}
1062 1062
 					}
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 		}
1067 1067
 	}
1068 1068
 
1069
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1069
+	$contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options'];
1070 1070
 	$contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons)
1071 1071
 		. plugin_ongletbouton('onglets_plugins', $onglets);
1072 1072
 
@@ -1101,12 +1101,12 @@  discard block
 block discarded – undo
1101 1101
 		define("_UPDATED_$nom", $val);
1102 1102
 		define("_UPDATED_md5_$nom", $md5);
1103 1103
 	}
1104
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1104
+	$val = "unserialize('".str_replace("'", "\'", $val)."')";
1105 1105
 
1106 1106
 	return
1107 1107
 		"if (!function_exists('$nom')) {\n"
1108 1108
 		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1109
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1109
+		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n"
1110 1110
 		. "}\n";
1111 1111
 }
1112 1112
 
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1130 1130
 		include_once(_CACHE_PLUGINS_OPT);
1131 1131
 	} else {
1132
-		spip_logger()->info('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT);
1132
+		spip_logger()->info('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT);
1133 1133
 	}
1134 1134
 }
1135 1135
 
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 			$dir_type = $plugin_valides[$p]['dir_type'];
1167 1167
 			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1168 1168
 			$plug = $plugin_valides[$p]['dir'];
1169
-			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_');
1169
+			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_');
1170 1170
 			if (isset($info['pipeline']) && is_array($info['pipeline'])) {
1171 1171
 				foreach ($info['pipeline'] as $pipe) {
1172 1172
 					$nom = $pipe['nom'];
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
 						}
1201 1201
 						if (isset($pipe['inclure'])) {
1202 1202
 							$GLOBALS['spip_matrice']["$prefix$action"] =
1203
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1203
+								"$root_dir_type:$plug/".$pipe['inclure'];
1204 1204
 						}
1205 1205
 					}
1206 1206
 				}
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
 					$prepend_code['taches_generales_cron'] = '';
1211 1211
 				}
1212 1212
 				foreach ($info['genie'] as $genie) {
1213
-					$nom = $prefix . $genie['nom'];
1213
+					$nom = $prefix.$genie['nom'];
1214 1214
 					$periode = max(60, intval($genie['periode']));
1215 1215
 					if (charger_fonction($nom, 'genie', true)) {
1216 1216
 						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
@@ -1228,13 +1228,13 @@  discard block
 block discarded – undo
1228 1228
 				}
1229 1229
 				foreach ($info['style'] as $style) {
1230 1230
 					if (isset($style['path']) && $style['path']) {
1231
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1231
+						$code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) ";
1232 1232
 					} else {
1233
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1233
+						$code = "if (\$f='".addslashes($style['url'])."') ";
1234 1234
 					}
1235 1235
 					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1236 1236
 					if (isset($style['media']) && strlen($style['media'])) {
1237
-						$code .= ' media="' . addslashes($style['media']) . '"';
1237
+						$code .= ' media="'.addslashes($style['media']).'"';
1238 1238
 					}
1239 1239
 					$code .= "/>';\n";
1240 1240
 					if ($style['type'] != 'prive') {
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 			if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) {
1255 1255
 				foreach ($info['script'] as $script) {
1256 1256
 					if (isset($script['path']) && $script['path']) {
1257
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1257
+						$code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) ";
1258 1258
 					} else {
1259
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1259
+						$code = "if (\$f='".addslashes($script['url'])."') ";
1260 1260
 					}
1261 1261
 					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1262 1262
 					if ($script['type'] != 'prive') {
@@ -1319,10 +1319,10 @@  discard block
 block discarded – undo
1319 1319
 		unset($GLOBALS['spip_pipeline']['all']);
1320 1320
 		$all_pipes = trim(array_shift($a));
1321 1321
 		if ($all_pipes) {
1322
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1322
+			$all_pipes = '|'.ltrim($all_pipes, '|');
1323 1323
 		}
1324 1324
 		if (count($a)) {
1325
-			$all_pipes_end = '||' . array_shift($a);
1325
+			$all_pipes_end = '||'.array_shift($a);
1326 1326
 		}
1327 1327
 	}
1328 1328
 	$content = '';
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 		// Eclater le pipeline en filtres et appliquer chaque filtre
1340 1340
 		foreach ($pipe as $fonc) {
1341 1341
 			$fonc = trim($fonc);
1342
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1342
+			$s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n";
1343 1343
 			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1344 1344
 				$file = $GLOBALS['spip_matrice'][$fonc];
1345 1345
 				$file = "'$file'";
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 					if (defined($root_dir)) {
1351 1351
 						$dir = $root_dir;
1352 1352
 					}
1353
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1353
+					$file = str_replace($regs[0], "'.".$dir.".'", $file);
1354 1354
 					$file = str_replace("''.", '', $file);
1355 1355
 					$file = str_replace(constant($dir), '', $file);
1356 1356
 				}
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 		$content .= "// Pipeline $action \n"
1364 1364
 			. "function execute_pipeline_$action(&\$val){\n"
1365 1365
 			. $s_inc
1366
-			. ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1366
+			. ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '')
1367 1367
 			. $s_call
1368 1368
 			. "return \$val;\n}\n";
1369 1369
 	}
@@ -1419,9 +1419,9 @@  discard block
 block discarded – undo
1419 1419
 					$result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec'));
1420 1420
 					if (_IS_CLI) {
1421 1421
 						include_spip('inc/filtres');
1422
-						$trace = ltrim(textebrut($trace) . "\n" . $result);
1423
-						$trace = '    ' . str_replace("\n", "\n    ", $trace);
1424
-						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1422
+						$trace = ltrim(textebrut($trace)."\n".$result);
1423
+						$trace = '    '.str_replace("\n", "\n    ", $trace);
1424
+						echo "\n".($ok ? 'OK  ' : '/!\ ').textebrut($titre)."\n",
1425 1425
 						  $trace,
1426 1426
 						  "\n";
1427 1427
 					}
@@ -1456,15 +1456,15 @@  discard block
 block discarded – undo
1456 1456
 		$GLOBALS['fichier_php_compile_recent'] = 0;
1457 1457
 	}
1458 1458
 
1459
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1459
+	$contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>';
1460 1460
 	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1461 1461
 	// si pas de modif on ne touche pas au fichier initial
1462 1462
 	if (file_exists($nom)) {
1463 1463
 		if (str_ends_with($nom, '.php')) {
1464
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1464
+			$fichier_tmp = substr($nom, 0, -4).'.tmp.php';
1465 1465
 		}
1466 1466
 		else {
1467
-			$fichier_tmp = $nom . '.tmp';
1467
+			$fichier_tmp = $nom.'.tmp';
1468 1468
 		}
1469 1469
 		file_put_contents($fichier_tmp, $contenu);
1470 1470
 		if (md5_file($nom) == md5_file($fichier_tmp)) {
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @package SPIP\Core\Minipres
18 18
  **/
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
  */
38 38
 function install_debut_html($titre = 'AUTO', $onLoad = '', $all_inline = false) {
39 39
 
40
-	if ($onLoad) {
41
-		include_spip('inc/filtres');
42
-		$onLoad = extraire_attribut("<body $onLoad>", 'onload');
43
-	}
40
+    if ($onLoad) {
41
+        include_spip('inc/filtres');
42
+        $onLoad = extraire_attribut("<body $onLoad>", 'onload');
43
+    }
44 44
 
45
-	$options = [
46
-		'all_inline' => $all_inline,
47
-		'onload' => $onLoad,
48
-		'titre' => $titre,
49
-	];
45
+    $options = [
46
+        'all_inline' => $all_inline,
47
+        'onload' => $onLoad,
48
+        'titre' => $titre,
49
+    ];
50 50
 
51
-	$minipage = new Admin();
52
-	return $minipage->installDebutPage($options);
51
+    $minipage = new Admin();
52
+    return $minipage->installDebutPage($options);
53 53
 }
54 54
 
55 55
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  * @return string Code HTML
62 62
  */
63 63
 function install_fin_html() {
64
-	$minipage = new Admin();
65
-	return $minipage->installFinPage();
64
+    $minipage = new Admin();
65
+    return $minipage->installFinPage();
66 66
 }
67 67
 
68 68
 
@@ -101,23 +101,23 @@  discard block
 block discarded – undo
101 101
  */
102 102
 function minipres($titre = '', $corps = '', $options = []) {
103 103
 
104
-	// compat signature old
105
-	// minipres($titre='', $corps="", $onload='', $all_inline = false)
106
-	$args = func_get_args();
107
-	if (isset($args[2]) && is_string($args[2])) {
108
-		$options = ['onload' => $args[2]];
109
-	}
110
-	if (isset($args[3])) {
111
-		$options['all_inline'] = $args[3];
112
-	}
104
+    // compat signature old
105
+    // minipres($titre='', $corps="", $onload='', $all_inline = false)
106
+    $args = func_get_args();
107
+    if (isset($args[2]) && is_string($args[2])) {
108
+        $options = ['onload' => $args[2]];
109
+    }
110
+    if (isset($args[3])) {
111
+        $options['all_inline'] = $args[3];
112
+    }
113 113
 
114
-	$options = array_merge([
115
-		'onload' => '',
116
-		'all_inline' => false,
117
-	], $options);
114
+    $options = array_merge([
115
+        'onload' => '',
116
+        'all_inline' => false,
117
+    ], $options);
118 118
 
119
-	$options['titre'] = $titre;
119
+    $options['titre'] = $titre;
120 120
 
121
-	$minipage = new Admin();
122
-	return $minipage->page($corps, $options);
121
+    $minipage = new Admin();
122
+    return $minipage->page($corps, $options);
123 123
 }
Please login to merge, or discard this patch.
ecrire/inc/lang.php 2 patches
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	if (is_null($liste_langues)) {
46
-		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
46
+		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? '');
47 47
 	} else {
48 48
 		if (is_array($liste_langues)) {
49 49
 			$liste_langues = implode(',', $liste_langues);
50 50
 		}
51 51
 	}
52
-	$liste_langues = ',' . $liste_langues . ',';
52
+	$liste_langues = ','.$liste_langues.',';
53 53
 
54 54
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
55 55
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	}
192 192
 	foreach ($langues as $l) {
193 193
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
194
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
194
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
195 195
 	}
196 196
 
197 197
 	if (!test_espace_prive()) {
@@ -209,21 +209,20 @@  discard block
 block discarded – undo
209 209
 		$base,
210 210
 		$cible,
211 211
 		(select_langues($nom_select, $change, $ret)
212
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
212
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
213 213
 		" method='post'"
214 214
 	);
215 215
 }
216 216
 
217 217
 function select_langues($nom_select, $change, $options, $label = '') {
218 218
 	static $cpt = 0;
219
-	$id = 'menu_langues' . $cpt++;
219
+	$id = 'menu_langues'.$cpt++;
220 220
 
221 221
 	return
222
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
222
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
223 223
 		"<select name='$nom_select' id='$id' "
224 224
 		. ((test_espace_prive()) ?
225
-			(($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) :
226
-			("class='forml menu_langues'"))
225
+			(($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : ("class='forml menu_langues'"))
227 226
 		. $change
228 227
 		. ">\n"
229 228
 		. $options
@@ -346,7 +345,7 @@  discard block
 block discarded – undo
346 345
 		isset($GLOBALS['meta']['langue_site'])
347 346
 		&& (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
348 347
 	) {
349
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
348
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
350 349
 	}
351 350
 	// en theorie là, la globale est définie, sinon c'est un problème.
352 351
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -458,7 +457,7 @@  discard block
 block discarded – undo
458 457
 	if (!isset($GLOBALS['meta']['langue_site'])) {
459 458
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
460 459
 		$GLOBALS['meta']['langue_site'] = $tout =
461
-			(!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,"))
460
+			(!$all_langs || str_contains(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,"))
462 461
 				? _LANGUE_PAR_DEFAUT
463 462
 				: substr((string) $all_langs, 0, strpos((string) $all_langs, ','));
464 463
 		ecrire_meta('langue_site', $tout);
Please login to merge, or discard this patch.
Indentation   +256 added lines, -256 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @package SPIP\Core\Langue
16 16
  **/
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18
-	return;
18
+    return;
19 19
 }
20 20
 
21 21
 
@@ -38,35 +38,35 @@  discard block
 block discarded – undo
38 38
  **/
39 39
 function changer_langue($lang, $liste_langues = null) {
40 40
 
41
-	if (empty($lang)) {
42
-		return false;
43
-	}
44
-
45
-	if (is_null($liste_langues)) {
46
-		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
47
-	} else {
48
-		if (is_array($liste_langues)) {
49
-			$liste_langues = implode(',', $liste_langues);
50
-		}
51
-	}
52
-	$liste_langues = ',' . $liste_langues . ',';
53
-
54
-	// Si la langue demandee n'existe pas, on essaie d'autres variantes
55
-	// Exemple : 'pt-br' => 'pt_br' => 'pt'
56
-	$lang = str_replace('-', '_', trim($lang));
57
-
58
-	if (
59
-		str_contains($liste_langues, (string) ",$lang,")
60
-		|| ($lang = preg_replace(',_.*,', '', $lang)) && str_contains($liste_langues, (string) ",$lang,")
61
-	) {
62
-		$GLOBALS['spip_lang_rtl'] = lang_dir($lang, '', '_rtl');
63
-		$GLOBALS['spip_lang_right'] = $GLOBALS['spip_lang_rtl'] ? 'left' : 'right';
64
-		$GLOBALS['spip_lang_left'] = $GLOBALS['spip_lang_rtl'] ? 'right' : 'left';
65
-
66
-		return $GLOBALS['spip_lang'] = $lang;
67
-	} else {
68
-		return false;
69
-	}
41
+    if (empty($lang)) {
42
+        return false;
43
+    }
44
+
45
+    if (is_null($liste_langues)) {
46
+        $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
47
+    } else {
48
+        if (is_array($liste_langues)) {
49
+            $liste_langues = implode(',', $liste_langues);
50
+        }
51
+    }
52
+    $liste_langues = ',' . $liste_langues . ',';
53
+
54
+    // Si la langue demandee n'existe pas, on essaie d'autres variantes
55
+    // Exemple : 'pt-br' => 'pt_br' => 'pt'
56
+    $lang = str_replace('-', '_', trim($lang));
57
+
58
+    if (
59
+        str_contains($liste_langues, (string) ",$lang,")
60
+        || ($lang = preg_replace(',_.*,', '', $lang)) && str_contains($liste_langues, (string) ",$lang,")
61
+    ) {
62
+        $GLOBALS['spip_lang_rtl'] = lang_dir($lang, '', '_rtl');
63
+        $GLOBALS['spip_lang_right'] = $GLOBALS['spip_lang_rtl'] ? 'left' : 'right';
64
+        $GLOBALS['spip_lang_left'] = $GLOBALS['spip_lang_rtl'] ? 'right' : 'left';
65
+
66
+        return $GLOBALS['spip_lang'] = $lang;
67
+    } else {
68
+        return false;
69
+    }
70 70
 }
71 71
 
72 72
 //
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 // par exemple le francais pour l'espagnol, l'anglais pour l'allemand, etc.
80 80
 
81 81
 function choisir_traduction($trads, $lang = '') {
82
-	$k = approcher_langue($trads, $lang);
82
+    $k = approcher_langue($trads, $lang);
83 83
 
84
-	return $k ? $trads[$k] : array_shift($trads);
84
+    return $k ? $trads[$k] : array_shift($trads);
85 85
 }
86 86
 
87 87
 // retourne son 2e argument si c'est un index du premier
@@ -89,21 +89,21 @@  discard block
 block discarded – undo
89 89
 // la langue X etant consideree comme une approche de X_Y
90 90
 function approcher_langue($trads, $lang = '') {
91 91
 
92
-	if (!$lang) {
93
-		$lang = $GLOBALS['spip_lang'];
94
-	}
95
-
96
-	if (isset($trads[$lang])) {
97
-		return $lang;
98
-	} // cas des langues xx_yy
99
-	else {
100
-		$r = explode('_', (string) $lang);
101
-		if (isset($trads[$r[0]])) {
102
-			return $r[0];
103
-		}
104
-	}
105
-
106
-	return '';
92
+    if (!$lang) {
93
+        $lang = $GLOBALS['spip_lang'];
94
+    }
95
+
96
+    if (isset($trads[$lang])) {
97
+        return $lang;
98
+    } // cas des langues xx_yy
99
+    else {
100
+        $r = explode('_', (string) $lang);
101
+        if (isset($trads[$r[0]])) {
102
+            return $r[0];
103
+        }
104
+    }
105
+
106
+    return '';
107 107
 }
108 108
 
109 109
 /**
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
  *     Nom de la langue, sinon son code.
119 119
  **/
120 120
 function traduire_nom_langue($lang) {
121
-	include_spip('inc/lang_liste');
122
-	include_spip('inc/charsets');
121
+    include_spip('inc/lang_liste');
122
+    include_spip('inc/charsets');
123 123
 
124
-	return html2unicode($GLOBALS['codes_langues'][$lang] ?? $lang);
124
+    return html2unicode($GLOBALS['codes_langues'][$lang] ?? $lang);
125 125
 }
126 126
 
127 127
 //
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 // hebreu a priori), 'droitier' sinon.
135 135
 // C'est utilise par #LANG_DIR, #LANG_LEFT, #LANG_RIGHT.
136 136
 function lang_dir($lang = '', $droitier = 'ltr', $gaucher = 'rtl') {
137
-	static $lang_rtl = ['ar', 'fa', 'ku', 'prs', 'ps', 'ur', 'he', 'heb', 'hbo', 'yi'];
137
+    static $lang_rtl = ['ar', 'fa', 'ku', 'prs', 'ps', 'ur', 'he', 'heb', 'hbo', 'yi'];
138 138
 
139
-	return in_array(($lang ?: $GLOBALS['spip_lang']), $lang_rtl) ?
140
-		$gaucher : $droitier;
139
+    return in_array(($lang ?: $GLOBALS['spip_lang']), $lang_rtl) ?
140
+        $gaucher : $droitier;
141 141
 }
142 142
 
143 143
 // typo francaise ou anglaise ?
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 // sinon determiner la typo en fonction de la langue courante
147 147
 
148 148
 function lang_typo($lang = '') {
149
-	if (!$lang) {
150
-		$lang = $GLOBALS['lang_objet'] ?? $GLOBALS['spip_lang'];
151
-	}
152
-	if (
153
-		$lang == 'eo'
154
-		|| $lang == 'fr'
155
-		|| str_starts_with((string) $lang, 'fr_')
156
-		|| $lang == 'cpf'
157
-	) {
158
-		return 'fr';
159
-	} else {
160
-		return 'en';
161
-	}
149
+    if (!$lang) {
150
+        $lang = $GLOBALS['lang_objet'] ?? $GLOBALS['spip_lang'];
151
+    }
152
+    if (
153
+        $lang == 'eo'
154
+        || $lang == 'fr'
155
+        || str_starts_with((string) $lang, 'fr_')
156
+        || $lang == 'cpf'
157
+    ) {
158
+        return 'fr';
159
+    } else {
160
+        return 'en';
161
+    }
162 162
 }
163 163
 
164 164
 // gestion de la globale $lang_objet pour que les textes soient affiches
165 165
 // avec les memes typo et direction dans l'espace prive que dans le public
166 166
 function changer_typo($lang = '') {
167
-	if ($lang) {
168
-		$GLOBALS['lang_objet'] = $lang;
169
-	} else {
170
-		unset($GLOBALS['lang_objet']);
171
-	}
167
+    if ($lang) {
168
+        $GLOBALS['lang_objet'] = $lang;
169
+    } else {
170
+        unset($GLOBALS['lang_objet']);
171
+    }
172 172
 }
173 173
 
174 174
 //
@@ -178,56 +178,56 @@  discard block
 block discarded – undo
178 178
 // pour 'changer_lang' (langue de l'article, espace prive), c'est en Ajax
179 179
 //
180 180
 function menu_langues($nom_select, $default = '') {
181
-	include_spip('inc/actions');
182
-
183
-	$langues = liste_options_langues($nom_select);
184
-	$ret = '';
185
-	if ($langues === []) {
186
-		return '';
187
-	}
188
-
189
-	if (!$default) {
190
-		$default = $GLOBALS['spip_lang'];
191
-	}
192
-	foreach ($langues as $l) {
193
-		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
194
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
195
-	}
196
-
197
-	if (!test_espace_prive()) {
198
-		$cible = self();
199
-		$base = '';
200
-	} else {
201
-		$cible = self();
202
-		$base = spip_connect() ? 'base' : '';
203
-	}
204
-
205
-	$change = ' onchange="this.parentNode.parentNode.submit()"';
206
-
207
-	return generer_action_auteur(
208
-		'converser',
209
-		$base,
210
-		$cible,
211
-		(select_langues($nom_select, $change, $ret)
212
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
213
-		" method='post'"
214
-	);
181
+    include_spip('inc/actions');
182
+
183
+    $langues = liste_options_langues($nom_select);
184
+    $ret = '';
185
+    if ($langues === []) {
186
+        return '';
187
+    }
188
+
189
+    if (!$default) {
190
+        $default = $GLOBALS['spip_lang'];
191
+    }
192
+    foreach ($langues as $l) {
193
+        $selected = ($l == $default) ? ' selected=\'selected\'' : '';
194
+        $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
195
+    }
196
+
197
+    if (!test_espace_prive()) {
198
+        $cible = self();
199
+        $base = '';
200
+    } else {
201
+        $cible = self();
202
+        $base = spip_connect() ? 'base' : '';
203
+    }
204
+
205
+    $change = ' onchange="this.parentNode.parentNode.submit()"';
206
+
207
+    return generer_action_auteur(
208
+        'converser',
209
+        $base,
210
+        $cible,
211
+        (select_langues($nom_select, $change, $ret)
212
+            . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
213
+        " method='post'"
214
+    );
215 215
 }
216 216
 
217 217
 function select_langues($nom_select, $change, $options, $label = '') {
218
-	static $cpt = 0;
219
-	$id = 'menu_langues' . $cpt++;
220
-
221
-	return
222
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
223
-		"<select name='$nom_select' id='$id' "
224
-		. ((test_espace_prive()) ?
225
-			(($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) :
226
-			("class='forml menu_langues'"))
227
-		. $change
228
-		. ">\n"
229
-		. $options
230
-		. '</select>';
218
+    static $cpt = 0;
219
+    $id = 'menu_langues' . $cpt++;
220
+
221
+    return
222
+        "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
223
+        "<select name='$nom_select' id='$id' "
224
+        . ((test_espace_prive()) ?
225
+            (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) :
226
+            ("class='forml menu_langues'"))
227
+        . $change
228
+        . ">\n"
229
+        . $options
230
+        . '</select>';
231 231
 }
232 232
 
233 233
 /**
@@ -249,34 +249,34 @@  discard block
 block discarded – undo
249 249
  */
250 250
 function liste_options_langues($nom_select) {
251 251
 
252
-	switch ($nom_select) {
253
-		# #MENU_LANG
254
-		case 'var_lang':
255
-			# menu de changement de la langue d'un article
256
-			# les langues selectionnees dans la configuration "multilinguisme"
257
-		case 'changer_lang':
258
-			$langues = explode(',', (string) $GLOBALS['meta']['langues_multilingue']);
259
-			break;
260
-		# menu de l'interface (privee, installation et panneau de login)
261
-		# les langues presentes sous forme de fichiers de langue
262
-		# on force la relecture du repertoire des langues pour etre synchrone.
263
-		case 'var_lang_ecrire':
264
-		default:
265
-			$GLOBALS['meta']['langues_proposees'] = '';
266
-			init_langues();
267
-			$langues = explode(',', $GLOBALS['meta']['langues_proposees']);
268
-			break;
252
+    switch ($nom_select) {
253
+        # #MENU_LANG
254
+        case 'var_lang':
255
+            # menu de changement de la langue d'un article
256
+            # les langues selectionnees dans la configuration "multilinguisme"
257
+        case 'changer_lang':
258
+            $langues = explode(',', (string) $GLOBALS['meta']['langues_multilingue']);
259
+            break;
260
+        # menu de l'interface (privee, installation et panneau de login)
261
+        # les langues presentes sous forme de fichiers de langue
262
+        # on force la relecture du repertoire des langues pour etre synchrone.
263
+        case 'var_lang_ecrire':
264
+        default:
265
+            $GLOBALS['meta']['langues_proposees'] = '';
266
+            init_langues();
267
+            $langues = explode(',', $GLOBALS['meta']['langues_proposees']);
268
+            break;
269 269
 
270 270
 # dernier choix possible : toutes les langues = langues_proposees
271 271
 # + langues_multilingues ; mais, ne sert pas
272 272
 #			$langues = explode(',', $GLOBALS['all_langs']);
273
-	}
274
-	if (count($langues) <= 1) {
275
-		return [];
276
-	}
277
-	sort($langues);
273
+    }
274
+    if (count($langues) <= 1) {
275
+        return [];
276
+    }
277
+    sort($langues);
278 278
 
279
-	return $langues;
279
+    return $langues;
280 280
 }
281 281
 
282 282
 
@@ -291,39 +291,39 @@  discard block
 block discarded – undo
291 291
  **/
292 292
 function verifier_lang_url() {
293 293
 
294
-	// quelle langue est demandee ?
295
-	$lang_demandee = (test_espace_prive() ? $GLOBALS['spip_lang'] : $GLOBALS['meta']['langue_site']);
296
-	if (isset($_COOKIE['spip_lang_ecrire'])) {
297
-		$lang_demandee = $_COOKIE['spip_lang_ecrire'];
298
-	}
299
-	if (!test_espace_prive() && isset($_COOKIE['spip_lang'])) {
300
-		$lang_demandee = $_COOKIE['spip_lang'];
301
-	}
302
-	if (isset($_GET['lang'])) {
303
-		$lang_demandee = $_GET['lang'];
304
-	}
305
-
306
-	// Renvoyer si besoin (et si la langue demandee existe)
307
-	if (
308
-		$GLOBALS['spip_lang'] != $lang_demandee
309
-		&& changer_langue($lang_demandee)
310
-		&& $lang_demandee != @$_GET['lang']
311
-	) {
312
-		$destination = parametre_url(self(), 'lang', $lang_demandee, '&');
313
-		// ici on a besoin des var_truc
314
-		foreach ($_GET as $var => $val) {
315
-			if (!strncmp('var_', $var, 4)) {
316
-				$destination = parametre_url($destination, $var, $val, '&');
317
-			}
318
-		}
319
-		include_spip('inc/headers');
320
-		redirige_par_entete($destination);
321
-	}
322
-
323
-	// Subtilite : si la langue demandee par cookie est la bonne
324
-	// alors on fait comme si $lang etait passee dans l'URL
325
-	// (pour criteres {lang}).
326
-	$GLOBALS['lang'] = $_GET['lang'] = $GLOBALS['spip_lang'];
294
+    // quelle langue est demandee ?
295
+    $lang_demandee = (test_espace_prive() ? $GLOBALS['spip_lang'] : $GLOBALS['meta']['langue_site']);
296
+    if (isset($_COOKIE['spip_lang_ecrire'])) {
297
+        $lang_demandee = $_COOKIE['spip_lang_ecrire'];
298
+    }
299
+    if (!test_espace_prive() && isset($_COOKIE['spip_lang'])) {
300
+        $lang_demandee = $_COOKIE['spip_lang'];
301
+    }
302
+    if (isset($_GET['lang'])) {
303
+        $lang_demandee = $_GET['lang'];
304
+    }
305
+
306
+    // Renvoyer si besoin (et si la langue demandee existe)
307
+    if (
308
+        $GLOBALS['spip_lang'] != $lang_demandee
309
+        && changer_langue($lang_demandee)
310
+        && $lang_demandee != @$_GET['lang']
311
+    ) {
312
+        $destination = parametre_url(self(), 'lang', $lang_demandee, '&');
313
+        // ici on a besoin des var_truc
314
+        foreach ($_GET as $var => $val) {
315
+            if (!strncmp('var_', $var, 4)) {
316
+                $destination = parametre_url($destination, $var, $val, '&');
317
+            }
318
+        }
319
+        include_spip('inc/headers');
320
+        redirige_par_entete($destination);
321
+    }
322
+
323
+    // Subtilite : si la langue demandee par cookie est la bonne
324
+    // alors on fait comme si $lang etait passee dans l'URL
325
+    // (pour criteres {lang}).
326
+    $GLOBALS['lang'] = $_GET['lang'] = $GLOBALS['spip_lang'];
327 327
 }
328 328
 
329 329
 
@@ -341,19 +341,19 @@  discard block
 block discarded – undo
341 341
  *     La langue sélectionnée
342 342
  **/
343 343
 function utiliser_langue_site($liste_langues = null) {
344
-	// s'il existe une langue du site (en gros tout le temps en théorie)
345
-	if (
346
-		isset($GLOBALS['meta']['langue_site'])
347
-		&& (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
348
-	) {
349
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
350
-	}
351
-	// en theorie là, la globale est définie, sinon c'est un problème.
352
-	if (!isset($GLOBALS['spip_lang'])) {
353
-		spip_logger()->error('La globale spip_lang est indéfinie dans utiliser_langue_site() !');
354
-	}
355
-
356
-	return $GLOBALS['spip_lang'];
344
+    // s'il existe une langue du site (en gros tout le temps en théorie)
345
+    if (
346
+        isset($GLOBALS['meta']['langue_site'])
347
+        && (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
348
+    ) {
349
+        return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
350
+    }
351
+    // en theorie là, la globale est définie, sinon c'est un problème.
352
+    if (!isset($GLOBALS['spip_lang'])) {
353
+        spip_logger()->error('La globale spip_lang est indéfinie dans utiliser_langue_site() !');
354
+    }
355
+
356
+    return $GLOBALS['spip_lang'];
357 357
 }
358 358
 
359 359
 /**
@@ -372,38 +372,38 @@  discard block
 block discarded – undo
372 372
  **/
373 373
 function utiliser_langue_visiteur($liste_langues = null) {
374 374
 
375
-	// si on est dans l'espace public et pas de $liste_langues : se limiter a la config langues_multilingue si définie
376
-	if (is_null($liste_langues) && !test_espace_prive() && !empty($GLOBALS['meta']['langues_multilingue'])) {
377
-		$liste_langues = $GLOBALS['meta']['langues_multilingue'];
378
-	}
379
-
380
-	$l = (test_espace_prive() ? 'spip_lang_ecrire' : 'spip_lang');
381
-	if (
382
-		isset($_COOKIE[$l])
383
-		&& changer_langue($l = $_COOKIE[$l], $liste_langues)
384
-	) {
385
-		return $l;
386
-	}
387
-
388
-	if (
389
-		isset($GLOBALS['visiteur_session']['lang'])
390
-		&& changer_langue($l = $GLOBALS['visiteur_session']['lang'], $liste_langues)
391
-	) {
392
-		return $l;
393
-	}
394
-
395
-	if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
396
-		foreach (explode(',', (string) $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $s) {
397
-			if (
398
-				preg_match('#^([a-z]{2,3})(-[a-z]{2,3})?(;q=[0-9.]+)?$#i', trim($s), $r)
399
-				&& changer_langue($l = strtolower($r[1]), $liste_langues)
400
-			) {
401
-				return $l;
402
-			}
403
-		}
404
-	}
405
-
406
-	return utiliser_langue_site($liste_langues);
375
+    // si on est dans l'espace public et pas de $liste_langues : se limiter a la config langues_multilingue si définie
376
+    if (is_null($liste_langues) && !test_espace_prive() && !empty($GLOBALS['meta']['langues_multilingue'])) {
377
+        $liste_langues = $GLOBALS['meta']['langues_multilingue'];
378
+    }
379
+
380
+    $l = (test_espace_prive() ? 'spip_lang_ecrire' : 'spip_lang');
381
+    if (
382
+        isset($_COOKIE[$l])
383
+        && changer_langue($l = $_COOKIE[$l], $liste_langues)
384
+    ) {
385
+        return $l;
386
+    }
387
+
388
+    if (
389
+        isset($GLOBALS['visiteur_session']['lang'])
390
+        && changer_langue($l = $GLOBALS['visiteur_session']['lang'], $liste_langues)
391
+    ) {
392
+        return $l;
393
+    }
394
+
395
+    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
396
+        foreach (explode(',', (string) $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $s) {
397
+            if (
398
+                preg_match('#^([a-z]{2,3})(-[a-z]{2,3})?(;q=[0-9.]+)?$#i', trim($s), $r)
399
+                && changer_langue($l = strtolower($r[1]), $liste_langues)
400
+            ) {
401
+                return $l;
402
+            }
403
+        }
404
+    }
405
+
406
+    return utiliser_langue_site($liste_langues);
407 407
 }
408 408
 
409 409
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
  * @return int
414 414
  */
415 415
 function match_langue($chaine) {
416
-	return preg_match('/^[a-z]{2,3}(_[a-z]{2,3}){0,2}$/', $chaine);
416
+    return preg_match('/^[a-z]{2,3}(_[a-z]{2,3}){0,2}$/', $chaine);
417 417
 }
418 418
 
419 419
 /**
@@ -431,38 +431,38 @@  discard block
 block discarded – undo
431 431
  **/
432 432
 function init_langues() {
433 433
 
434
-	// liste des langues dans les meta, sauf a l'install
435
-	$all_langs = $GLOBALS['meta']['langues_proposees'] ?? '';
436
-
437
-	$tout = [];
438
-	if (!$all_langs) {
439
-		// trouver tous les modules lang/spip_xx.php
440
-		$modules = find_all_in_path('lang/', '/spip_([a-z_]+)\.php$');
441
-		foreach (array_keys($modules) as $name) {
442
-			if (
443
-				preg_match(',^spip_([a-z_]+)\.php$,', $name, $regs)
444
-				&& match_langue($regs[1])
445
-			) {
446
-				$tout[] = $regs[1];
447
-			}
448
-		}
449
-		sort($tout);
450
-		$tout = implode(',', $tout);
451
-		// Si les langues n'ont pas change, ne rien faire
452
-		if ($tout != $all_langs) {
453
-			$GLOBALS['meta']['langues_proposees'] = $tout;
454
-			include_spip('inc/meta');
455
-			ecrire_meta('langues_proposees', $tout);
456
-		}
457
-	}
458
-	if (!isset($GLOBALS['meta']['langue_site'])) {
459
-		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
460
-		$GLOBALS['meta']['langue_site'] = $tout =
461
-			(!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,"))
462
-				? _LANGUE_PAR_DEFAUT
463
-				: substr((string) $all_langs, 0, strpos((string) $all_langs, ','));
464
-		ecrire_meta('langue_site', $tout);
465
-	}
434
+    // liste des langues dans les meta, sauf a l'install
435
+    $all_langs = $GLOBALS['meta']['langues_proposees'] ?? '';
436
+
437
+    $tout = [];
438
+    if (!$all_langs) {
439
+        // trouver tous les modules lang/spip_xx.php
440
+        $modules = find_all_in_path('lang/', '/spip_([a-z_]+)\.php$');
441
+        foreach (array_keys($modules) as $name) {
442
+            if (
443
+                preg_match(',^spip_([a-z_]+)\.php$,', $name, $regs)
444
+                && match_langue($regs[1])
445
+            ) {
446
+                $tout[] = $regs[1];
447
+            }
448
+        }
449
+        sort($tout);
450
+        $tout = implode(',', $tout);
451
+        // Si les langues n'ont pas change, ne rien faire
452
+        if ($tout != $all_langs) {
453
+            $GLOBALS['meta']['langues_proposees'] = $tout;
454
+            include_spip('inc/meta');
455
+            ecrire_meta('langues_proposees', $tout);
456
+        }
457
+    }
458
+    if (!isset($GLOBALS['meta']['langue_site'])) {
459
+        // Initialisation : le francais si dispo, sinon la premiere langue trouvee
460
+        $GLOBALS['meta']['langue_site'] = $tout =
461
+            (!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,"))
462
+                ? _LANGUE_PAR_DEFAUT
463
+                : substr((string) $all_langs, 0, strpos((string) $all_langs, ','));
464
+        ecrire_meta('langue_site', $tout);
465
+    }
466 466
 }
467 467
 
468 468
 /**
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
  *     Code html de la balise <html>
477 477
  **/
478 478
 function html_lang_attributes() {
479
-	$lang = $GLOBALS['spip_lang'];
480
-	$dir = lang_dir($lang);
479
+    $lang = $GLOBALS['spip_lang'];
480
+    $dir = lang_dir($lang);
481 481
 
482
-	return "<html class='$dir $lang no-js' xmlns='http://www.w3.org/1999/xhtml' lang='$lang' dir='$dir'>\n";
482
+    return "<html class='$dir $lang no-js' xmlns='http://www.w3.org/1999/xhtml' lang='$lang' dir='$dir'>\n";
483 483
 }
484 484
 
485 485
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
  * @return string
494 494
  */
495 495
 function aide_lang_dir($spip_lang, $spip_lang_rtl) {
496
-	return ($spip_lang != 'he') ? $spip_lang_rtl : '';
496
+    return ($spip_lang != 'he') ? $spip_lang_rtl : '';
497 497
 }
498 498
 
499 499
 
Please login to merge, or discard this patch.
ecrire/inc/pipelines.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		}
64 64
 	}
65 65
 
66
-	return $x . $texte;
66
+	return $x.$texte;
67 67
 }
68 68
 
69 69
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) {
141
-		$insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
141
+		$insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n";
142 142
 		$texte = substr_replace($texte, $insert, $pos, 0);
143 143
 	}
144 144
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		}
171 171
 		$texte = substr_replace($texte, $x, $pos, 0);
172 172
 		// pas de preview en fenetre enfant
173
-		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>";
173
+		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes((string) $GLOBALS['meta']['adresse_site'])."';}</script>";
174 174
 		if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) {
175 175
 			$pos = -1;
176 176
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 	// inserer avant le </body> fermant si on peut, a la fin de la page sinon
243 243
 	if (($p = strpos($texte, '</body>')) !== false) {
244
-		$texte = substr($texte, 0, $p) . $code . substr($texte, $p);
244
+		$texte = substr($texte, 0, $p).$code.substr($texte, $p);
245 245
 	} else {
246 246
 		$texte .= $code;
247 247
 	}
Please login to merge, or discard this patch.
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
  * @package SPIP\Core\Pipelines
16 16
  **/
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18
-	return;
18
+    return;
19 19
 }
20 20
 if (test_espace_prive()) {
21
-	include_spip('inc/pipelines_ecrire');
21
+    include_spip('inc/pipelines_ecrire');
22 22
 }
23 23
 
24 24
 
@@ -44,26 +44,26 @@  discard block
 block discarded – undo
44 44
  * @return string          Contenu qui sera inséré dans le head HTML
45 45
  **/
46 46
 function f_jQuery($texte) {
47
-	$x = '';
48
-	$jquery_plugins = pipeline(
49
-		'jquery_plugins',
50
-		[
51
-			'javascript/jquery.js',
52
-			'javascript/jquery.form.js',
53
-			'javascript/jquery.autosave.js',
54
-			'javascript/jquery.placeholder-label.js',
55
-			'javascript/ajaxCallback.js',
56
-			'javascript/js.cookie.js',
57
-		]
58
-	);
59
-	foreach (array_unique($jquery_plugins) as $script) {
60
-		if ($script = find_in_path(supprimer_timestamp($script))) {
61
-			$script = timestamp($script);
62
-			$x .= "\n<script src=\"$script\" type=\"text/javascript\"></script>\n";
63
-		}
64
-	}
65
-
66
-	return $x . $texte;
47
+    $x = '';
48
+    $jquery_plugins = pipeline(
49
+        'jquery_plugins',
50
+        [
51
+            'javascript/jquery.js',
52
+            'javascript/jquery.form.js',
53
+            'javascript/jquery.autosave.js',
54
+            'javascript/jquery.placeholder-label.js',
55
+            'javascript/ajaxCallback.js',
56
+            'javascript/js.cookie.js',
57
+        ]
58
+    );
59
+    foreach (array_unique($jquery_plugins) as $script) {
60
+        if ($script = find_in_path(supprimer_timestamp($script))) {
61
+            $script = timestamp($script);
62
+            $x .= "\n<script src=\"$script\" type=\"text/javascript\"></script>\n";
63
+        }
64
+    }
65
+
66
+    return $x . $texte;
67 67
 }
68 68
 
69 69
 /**
@@ -80,33 +80,33 @@  discard block
 block discarded – undo
80 80
  * @return string         Contenu de la page envoyée au navigateur
81 81
  **/
82 82
 function f_tidy($texte) {
83
-	/**
84
-	 * Indentation à faire ?
85
-	 *
86
-	 * - true : actif.
87
-	 * - false par défaut.
88
-	 */
89
-
90
-	if (
91
-		$GLOBALS['xhtml']
92
-		&& $GLOBALS['html']
93
-		&& strlen($texte)
94
-		&& !headers_sent()
95
-	) {
96
-		# Compatibilite ascendante
97
-		if (!is_string($GLOBALS['xhtml'])) {
98
-			$GLOBALS['xhtml'] = 'tidy';
99
-		}
100
-
101
-		if (!$f = charger_fonction($GLOBALS['xhtml'], 'inc', true)) {
102
-			spip_logger()->info("tidy absent, l'indenteur SPIP le remplace");
103
-			$f = charger_fonction('sax', 'xml');
104
-		}
105
-
106
-		return $f($texte);
107
-	}
108
-
109
-	return $texte;
83
+    /**
84
+     * Indentation à faire ?
85
+     *
86
+     * - true : actif.
87
+     * - false par défaut.
88
+     */
89
+
90
+    if (
91
+        $GLOBALS['xhtml']
92
+        && $GLOBALS['html']
93
+        && strlen($texte)
94
+        && !headers_sent()
95
+    ) {
96
+        # Compatibilite ascendante
97
+        if (!is_string($GLOBALS['xhtml'])) {
98
+            $GLOBALS['xhtml'] = 'tidy';
99
+        }
100
+
101
+        if (!$f = charger_fonction($GLOBALS['xhtml'], 'inc', true)) {
102
+            spip_logger()->info("tidy absent, l'indenteur SPIP le remplace");
103
+            $f = charger_fonction('sax', 'xml');
104
+        }
105
+
106
+        return $f($texte);
107
+    }
108
+
109
+    return $texte;
110 110
 }
111 111
 
112 112
 
@@ -125,24 +125,24 @@  discard block
 block discarded – undo
125 125
  * @return string         Contenu de la page envoyée au navigateur
126 126
  **/
127 127
 function f_insert_head($texte) {
128
-	if (!$GLOBALS['html']) {
129
-		return $texte;
130
-	}
131
-	include_spip('public/admin'); // pour strripos
132
-
133
-	if (
134
-		!($pos = stripos($texte, '</head>'))
135
-		&& !($pos = stripos($texte, '<body>'))
136
-	) {
137
-		$pos = 0;
138
-	}
139
-
140
-	if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) {
141
-		$insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
142
-		$texte = substr_replace($texte, $insert, $pos, 0);
143
-	}
144
-
145
-	return $texte;
128
+    if (!$GLOBALS['html']) {
129
+        return $texte;
130
+    }
131
+    include_spip('public/admin'); // pour strripos
132
+
133
+    if (
134
+        !($pos = stripos($texte, '</head>'))
135
+        && !($pos = stripos($texte, '<body>'))
136
+    ) {
137
+        $pos = 0;
138
+    }
139
+
140
+    if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) {
141
+        $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
142
+        $texte = substr_replace($texte, $insert, $pos, 0);
143
+    }
144
+
145
+    return $texte;
146 146
 }
147 147
 
148 148
 
@@ -158,34 +158,34 @@  discard block
 block discarded – undo
158 158
  * @return string         Contenu de la page envoyée au navigateur
159 159
  **/
160 160
 function f_admin($texte) {
161
-	if (defined('_VAR_PREVIEW') && _VAR_PREVIEW && $GLOBALS['html']) {
162
-		include_spip('inc/filtres'); // pour http_img_pack
163
-		$x = "<div class='spip-previsu' "
164
-			. http_style_background('preview-32.png', '', 32)
165
-			. '>'
166
-			. _T('previsualisation')
167
-			. '</div>';
168
-		if (!$pos = stripos($texte, '</body>')) {
169
-			$pos = strlen($texte);
170
-		}
171
-		$texte = substr_replace($texte, $x, $pos, 0);
172
-		// pas de preview en fenetre enfant
173
-		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>";
174
-		if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) {
175
-			$pos = -1;
176
-		}
177
-		$texte = substr_replace($texte, $x, $pos + 1, 0);
178
-	}
179
-
180
-	if (isset($GLOBALS['affiche_boutons_admin']) && $GLOBALS['affiche_boutons_admin']) {
181
-		include_spip('public/admin');
182
-		$texte = affiche_boutons_admin($texte);
183
-	}
184
-	if (_request('var_mode') == 'noajax') {
185
-		$texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims', "\\1\\2", $texte);
186
-	}
187
-
188
-	return $texte;
161
+    if (defined('_VAR_PREVIEW') && _VAR_PREVIEW && $GLOBALS['html']) {
162
+        include_spip('inc/filtres'); // pour http_img_pack
163
+        $x = "<div class='spip-previsu' "
164
+            . http_style_background('preview-32.png', '', 32)
165
+            . '>'
166
+            . _T('previsualisation')
167
+            . '</div>';
168
+        if (!$pos = stripos($texte, '</body>')) {
169
+            $pos = strlen($texte);
170
+        }
171
+        $texte = substr_replace($texte, $x, $pos, 0);
172
+        // pas de preview en fenetre enfant
173
+        $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>";
174
+        if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) {
175
+            $pos = -1;
176
+        }
177
+        $texte = substr_replace($texte, $x, $pos + 1, 0);
178
+    }
179
+
180
+    if (isset($GLOBALS['affiche_boutons_admin']) && $GLOBALS['affiche_boutons_admin']) {
181
+        include_spip('public/admin');
182
+        $texte = affiche_boutons_admin($texte);
183
+    }
184
+    if (_request('var_mode') == 'noajax') {
185
+        $texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims', "\\1\\2", $texte);
186
+    }
187
+
188
+    return $texte;
189 189
 }
190 190
 
191 191
 /**
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
  * @return array $flux  Description et contenu de l'inclusion
204 204
  **/
205 205
 function f_recuperer_fond($flux) {
206
-	if (!test_espace_prive()) {
207
-		return $flux;
208
-	}
206
+    if (!test_espace_prive()) {
207
+        return $flux;
208
+    }
209 209
 
210
-	return f_afficher_blocs_ecrire($flux);
210
+    return f_afficher_blocs_ecrire($flux);
211 211
 }
212 212
 
213 213
 /**
@@ -221,30 +221,30 @@  discard block
 block discarded – undo
221 221
  * @return string         Contenu de la page envoyée au navigateur
222 222
  */
223 223
 function f_queue($texte) {
224
-	// eviter une inclusion si rien a faire
225
-	if (
226
-		_request('action') == 'cron'
227
-		|| queue_sleep_time_to_next_job() > 0
228
-		|| defined('_DEBUG_BLOCK_QUEUE')
229
-	) {
230
-		return $texte;
231
-	}
232
-
233
-	include_spip('inc/queue');
234
-	$code = queue_affichage_cron();
235
-
236
-	// si rien a afficher
237
-	// ou si on est pas dans une page html, on ne sait rien faire de mieux
238
-	if (!$code || !isset($GLOBALS['html']) || !$GLOBALS['html']) {
239
-		return $texte;
240
-	}
241
-
242
-	// inserer avant le </body> fermant si on peut, a la fin de la page sinon
243
-	if (($p = strpos($texte, '</body>')) !== false) {
244
-		$texte = substr($texte, 0, $p) . $code . substr($texte, $p);
245
-	} else {
246
-		$texte .= $code;
247
-	}
248
-
249
-	return $texte;
224
+    // eviter une inclusion si rien a faire
225
+    if (
226
+        _request('action') == 'cron'
227
+        || queue_sleep_time_to_next_job() > 0
228
+        || defined('_DEBUG_BLOCK_QUEUE')
229
+    ) {
230
+        return $texte;
231
+    }
232
+
233
+    include_spip('inc/queue');
234
+    $code = queue_affichage_cron();
235
+
236
+    // si rien a afficher
237
+    // ou si on est pas dans une page html, on ne sait rien faire de mieux
238
+    if (!$code || !isset($GLOBALS['html']) || !$GLOBALS['html']) {
239
+        return $texte;
240
+    }
241
+
242
+    // inserer avant le </body> fermant si on peut, a la fin de la page sinon
243
+    if (($p = strpos($texte, '</body>')) !== false) {
244
+        $texte = substr($texte, 0, $p) . $code . substr($texte, $p);
245
+    } else {
246
+        $texte .= $code;
247
+    }
248
+
249
+    return $texte;
250 250
 }
Please login to merge, or discard this patch.
ecrire/inc/texte.php 2 patches
Indentation   +229 added lines, -229 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  **/
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 include_spip('inc/texte_mini');
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
  * @return array Tablea ('','')
36 36
  */
37 37
 function definir_raccourcis_alineas() {
38
-	return ['', ''];
38
+    return ['', ''];
39 39
 }
40 40
 
41 41
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  * @return string
49 49
  */
50 50
 function traiter_tableau($bloc) {
51
-	return $bloc;
51
+    return $bloc;
52 52
 }
53 53
 
54 54
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  * @return string
63 63
  */
64 64
 function traiter_listes($texte) {
65
-	return $texte;
65
+    return $texte;
66 66
 }
67 67
 
68 68
 /**
@@ -78,16 +78,16 @@  discard block
 block discarded – undo
78 78
  */
79 79
 function traiter_raccourcis($letexte) {
80 80
 
81
-	// Appeler les fonctions de pre_traitement
82
-	$letexte = pipeline('pre_propre', $letexte);
81
+    // Appeler les fonctions de pre_traitement
82
+    $letexte = pipeline('pre_propre', $letexte);
83 83
 
84
-	// APPELER ICI UN PIPELINE traiter_raccourcis ?
85
-	// $letexte = pipeline('traiter_raccourcis', $letexte);
84
+    // APPELER ICI UN PIPELINE traiter_raccourcis ?
85
+    // $letexte = pipeline('traiter_raccourcis', $letexte);
86 86
 
87
-	// Appeler les fonctions de post-traitement
88
-	$letexte = pipeline('post_propre', $letexte);
87
+    // Appeler les fonctions de post-traitement
88
+    $letexte = pipeline('post_propre', $letexte);
89 89
 
90
-	return $letexte;
90
+    return $letexte;
91 91
 }
92 92
 
93 93
 /*************************************************************************************************************************
@@ -103,22 +103,22 @@  discard block
 block discarded – undo
103 103
  * @return string
104 104
  */
105 105
 function echappe_js($t, $class = ' class = "echappe-js"') {
106
-	foreach (['script', 'iframe'] as $tag) {
107
-		if (
108
-			stripos($t, (string) "<$tag") !== false
109
-			&& preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
110
-		) {
111
-			foreach ($r as $regs) {
112
-				$t = str_replace(
113
-					$regs[0],
114
-					"<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
115
-					$t
116
-				);
117
-			}
118
-		}
119
-	}
120
-
121
-	return $t;
106
+    foreach (['script', 'iframe'] as $tag) {
107
+        if (
108
+            stripos($t, (string) "<$tag") !== false
109
+            && preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
110
+        ) {
111
+            foreach ($r as $regs) {
112
+                $t = str_replace(
113
+                    $regs[0],
114
+                    "<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
115
+                    $t
116
+                );
117
+            }
118
+        }
119
+    }
120
+
121
+    return $t;
122 122
 }
123 123
 
124 124
 
@@ -147,55 +147,55 @@  discard block
 block discarded – undo
147 147
  *     Code protégé
148 148
  **/
149 149
 function interdire_scripts($arg, $mode_filtre = null) {
150
-	// on memorise le resultat sur les arguments non triviaux
151
-	static $dejavu = [];
152
-
153
-	// Attention, si ce n'est pas une chaine, laisser intact
154
-	if (!$arg || !is_string($arg) || !strstr($arg, '<')) {
155
-		return $arg;
156
-	}
157
-
158
-	if (is_null($mode_filtre) || !in_array($mode_filtre, [-1, 0, 1])) {
159
-		$mode_filtre = $GLOBALS['filtrer_javascript'];
160
-	}
161
-
162
-	if (isset($dejavu[$mode_filtre][$arg])) {
163
-		return $dejavu[$mode_filtre][$arg];
164
-	}
165
-
166
-	// echapper les tags asp/php
167
-	$t = str_replace('<' . '%', '&lt;%', $arg);
168
-
169
-	// echapper le php
170
-	$t = str_replace('<' . '?', '&lt;?', $t);
171
-
172
-	// echapper le < script language=php >
173
-	$t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
174
-
175
-	// Pour le js, trois modes : parano (-1), prive (0), ok (1)
176
-	switch ($mode_filtre) {
177
-		case 0:
178
-			if (!_DIR_RESTREINT) {
179
-				$t = echappe_js($t);
180
-			}
181
-			break;
182
-		case -1:
183
-			$t = echappe_js($t);
184
-			break;
185
-	}
186
-
187
-	// pas de <base href /> svp !
188
-	$t = preg_replace(',<(base\b),iS', '&lt;\1', $t);
189
-
190
-	// Reinserer les echappements des modeles
191
-	if (defined('_PROTEGE_JS_MODELES')) {
192
-		$t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES);
193
-	}
194
-	if (defined('_PROTEGE_PHP_MODELES')) {
195
-		$t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES);
196
-	}
197
-
198
-	return $dejavu[$mode_filtre][$arg] = $t;
150
+    // on memorise le resultat sur les arguments non triviaux
151
+    static $dejavu = [];
152
+
153
+    // Attention, si ce n'est pas une chaine, laisser intact
154
+    if (!$arg || !is_string($arg) || !strstr($arg, '<')) {
155
+        return $arg;
156
+    }
157
+
158
+    if (is_null($mode_filtre) || !in_array($mode_filtre, [-1, 0, 1])) {
159
+        $mode_filtre = $GLOBALS['filtrer_javascript'];
160
+    }
161
+
162
+    if (isset($dejavu[$mode_filtre][$arg])) {
163
+        return $dejavu[$mode_filtre][$arg];
164
+    }
165
+
166
+    // echapper les tags asp/php
167
+    $t = str_replace('<' . '%', '&lt;%', $arg);
168
+
169
+    // echapper le php
170
+    $t = str_replace('<' . '?', '&lt;?', $t);
171
+
172
+    // echapper le < script language=php >
173
+    $t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
174
+
175
+    // Pour le js, trois modes : parano (-1), prive (0), ok (1)
176
+    switch ($mode_filtre) {
177
+        case 0:
178
+            if (!_DIR_RESTREINT) {
179
+                $t = echappe_js($t);
180
+            }
181
+            break;
182
+        case -1:
183
+            $t = echappe_js($t);
184
+            break;
185
+    }
186
+
187
+    // pas de <base href /> svp !
188
+    $t = preg_replace(',<(base\b),iS', '&lt;\1', $t);
189
+
190
+    // Reinserer les echappements des modeles
191
+    if (defined('_PROTEGE_JS_MODELES')) {
192
+        $t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES);
193
+    }
194
+    if (defined('_PROTEGE_PHP_MODELES')) {
195
+        $t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES);
196
+    }
197
+
198
+    return $dejavu[$mode_filtre][$arg] = $t;
199 199
 }
200 200
 
201 201
 
@@ -224,66 +224,66 @@  discard block
 block discarded – undo
224 224
  *     texte transformé
225 225
  **/
226 226
 function typo($letexte, $echapper = true, $connect = null, $env = []) {
227
-	// Plus vite !
228
-	if (!$letexte) {
229
-		return $letexte;
230
-	}
231
-
232
-	// les appels directs a cette fonction depuis le php de l'espace
233
-	// prive etant historiquement ecrit sans argment $connect
234
-	// on utilise la presence de celui-ci pour distinguer les cas
235
-	// ou il faut passer interdire_script explicitement
236
-	// les appels dans les squelettes (de l'espace prive) fournissant un $connect
237
-	// ne seront pas perturbes
238
-	$interdire_script = false;
239
-	if (is_null($connect)) {
240
-		$connect = '';
241
-		$interdire_script = true;
242
-		$env['espace_prive'] = test_espace_prive();
243
-	}
244
-
245
-	// Echapper les codes <html> etc
246
-	if ($echapper) {
247
-		$letexte = CollecteurHtmlTag::proteger_balisesHtml($letexte, 'TYPO');
248
-	}
249
-
250
-	//
251
-	// Installer les modeles, notamment images et documents ;
252
-	//
253
-	// NOTE : propre() ne passe pas par ici mais directement par corriger_typo
254
-	// cf. inc/lien
255
-
256
-	$letexte = traiter_modeles($mem = $letexte, false, $echapper ? 'TYPO' : '', $connect ?? '', null, $env);
257
-	if ($letexte != $mem) {
258
-		$echapper = true;
259
-	}
260
-	unset($mem);
261
-
262
-	$letexte = corriger_typo($letexte);
263
-	$letexte = echapper_faux_tags($letexte);
264
-
265
-	// reintegrer les echappements
266
-	if ($echapper) {
267
-		$letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64($letexte, 'TYPO');
268
-	}
269
-
270
-	// Dans les appels directs hors squelette, securiser ici aussi
271
-	if ($interdire_script) {
272
-		$letexte = interdire_scripts($letexte);
273
-	}
274
-
275
-	// Dans l'espace prive on se mefie de tout contenu dangereux
276
-	// https://core.spip.net/issues/3371
277
-	// et aussi dans l'espace public si la globale filtrer_javascript = -1
278
-	// https://core.spip.net/issues/4166
279
-	if (
280
-		$GLOBALS['filtrer_javascript'] == -1
281
-		|| isset($env['espace_prive']) && $env['espace_prive'] && $GLOBALS['filtrer_javascript'] <= 0
282
-	) {
283
-		$letexte = echapper_html_suspect($letexte, [], $connect, $env);
284
-	}
285
-
286
-	return $letexte;
227
+    // Plus vite !
228
+    if (!$letexte) {
229
+        return $letexte;
230
+    }
231
+
232
+    // les appels directs a cette fonction depuis le php de l'espace
233
+    // prive etant historiquement ecrit sans argment $connect
234
+    // on utilise la presence de celui-ci pour distinguer les cas
235
+    // ou il faut passer interdire_script explicitement
236
+    // les appels dans les squelettes (de l'espace prive) fournissant un $connect
237
+    // ne seront pas perturbes
238
+    $interdire_script = false;
239
+    if (is_null($connect)) {
240
+        $connect = '';
241
+        $interdire_script = true;
242
+        $env['espace_prive'] = test_espace_prive();
243
+    }
244
+
245
+    // Echapper les codes <html> etc
246
+    if ($echapper) {
247
+        $letexte = CollecteurHtmlTag::proteger_balisesHtml($letexte, 'TYPO');
248
+    }
249
+
250
+    //
251
+    // Installer les modeles, notamment images et documents ;
252
+    //
253
+    // NOTE : propre() ne passe pas par ici mais directement par corriger_typo
254
+    // cf. inc/lien
255
+
256
+    $letexte = traiter_modeles($mem = $letexte, false, $echapper ? 'TYPO' : '', $connect ?? '', null, $env);
257
+    if ($letexte != $mem) {
258
+        $echapper = true;
259
+    }
260
+    unset($mem);
261
+
262
+    $letexte = corriger_typo($letexte);
263
+    $letexte = echapper_faux_tags($letexte);
264
+
265
+    // reintegrer les echappements
266
+    if ($echapper) {
267
+        $letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64($letexte, 'TYPO');
268
+    }
269
+
270
+    // Dans les appels directs hors squelette, securiser ici aussi
271
+    if ($interdire_script) {
272
+        $letexte = interdire_scripts($letexte);
273
+    }
274
+
275
+    // Dans l'espace prive on se mefie de tout contenu dangereux
276
+    // https://core.spip.net/issues/3371
277
+    // et aussi dans l'espace public si la globale filtrer_javascript = -1
278
+    // https://core.spip.net/issues/4166
279
+    if (
280
+        $GLOBALS['filtrer_javascript'] == -1
281
+        || isset($env['espace_prive']) && $env['espace_prive'] && $GLOBALS['filtrer_javascript'] <= 0
282
+    ) {
283
+        $letexte = echapper_html_suspect($letexte, [], $connect, $env);
284
+    }
285
+
286
+    return $letexte;
287 287
 }
288 288
 
289 289
 // Correcteur typographique
@@ -308,57 +308,57 @@  discard block
 block discarded – undo
308 308
  */
309 309
 function corriger_typo($letexte, $lang = '') {
310 310
 
311
-	// Plus vite !
312
-	if (!$letexte) {
313
-		return $letexte;
314
-	}
315
-
316
-	$letexte = pipeline('pre_typo', $letexte);
317
-
318
-	// Caracteres de controle "illegaux"
319
-	$letexte = corriger_caracteres($letexte);
320
-
321
-	// Proteger les caracteres typographiques a l'interieur des tags html
322
-	if (preg_match_all(_TYPO_BALISE, $letexte, $regs, PREG_SET_ORDER)) {
323
-		foreach ($regs as $reg) {
324
-			$insert = $reg[0];
325
-			// hack: on transforme les caracteres a proteger en les remplacant
326
-			// par des caracteres "illegaux". (cf corriger_caracteres())
327
-			$insert = strtr($insert, _TYPO_PROTEGER, _TYPO_PROTECTEUR);
328
-			$letexte = str_replace($reg[0], $insert, $letexte);
329
-		}
330
-	}
331
-
332
-	// trouver les blocs idiomes et les traiter à part
333
-	$letexte = extraire_idiome($ei = $letexte, $lang, ['echappe_span' => true]);
334
-	$ei = ($ei !== $letexte);
335
-
336
-	// trouver les blocs multi et les traiter a part
337
-	$letexte = extraire_multi($em = $letexte, $lang, ['echappe_span' => true]);
338
-	$em = ($em !== $letexte);
339
-
340
-	// Charger & appliquer les fonctions de typographie
341
-	$typographie = charger_fonction(lang_typo($lang), 'typographie');
342
-	$letexte = $typographie($letexte);
343
-
344
-	// Les citations en une autre langue, s'il y a lieu
345
-	if ($em) {
346
-		$letexte = echappe_retour($letexte, 'multi');
347
-	}
348
-	if ($ei) {
349
-		$letexte = echappe_retour($letexte, 'idiome');
350
-	}
351
-
352
-	// Retablir les caracteres proteges
353
-	$letexte = strtr($letexte, _TYPO_PROTECTEUR, _TYPO_PROTEGER);
354
-
355
-	// pipeline
356
-	$letexte = pipeline('post_typo', $letexte);
357
-
358
-	# un message pour abs_url - on est passe en mode texte
359
-	$GLOBALS['mode_abs_url'] = 'texte';
360
-
361
-	return $letexte;
311
+    // Plus vite !
312
+    if (!$letexte) {
313
+        return $letexte;
314
+    }
315
+
316
+    $letexte = pipeline('pre_typo', $letexte);
317
+
318
+    // Caracteres de controle "illegaux"
319
+    $letexte = corriger_caracteres($letexte);
320
+
321
+    // Proteger les caracteres typographiques a l'interieur des tags html
322
+    if (preg_match_all(_TYPO_BALISE, $letexte, $regs, PREG_SET_ORDER)) {
323
+        foreach ($regs as $reg) {
324
+            $insert = $reg[0];
325
+            // hack: on transforme les caracteres a proteger en les remplacant
326
+            // par des caracteres "illegaux". (cf corriger_caracteres())
327
+            $insert = strtr($insert, _TYPO_PROTEGER, _TYPO_PROTECTEUR);
328
+            $letexte = str_replace($reg[0], $insert, $letexte);
329
+        }
330
+    }
331
+
332
+    // trouver les blocs idiomes et les traiter à part
333
+    $letexte = extraire_idiome($ei = $letexte, $lang, ['echappe_span' => true]);
334
+    $ei = ($ei !== $letexte);
335
+
336
+    // trouver les blocs multi et les traiter a part
337
+    $letexte = extraire_multi($em = $letexte, $lang, ['echappe_span' => true]);
338
+    $em = ($em !== $letexte);
339
+
340
+    // Charger & appliquer les fonctions de typographie
341
+    $typographie = charger_fonction(lang_typo($lang), 'typographie');
342
+    $letexte = $typographie($letexte);
343
+
344
+    // Les citations en une autre langue, s'il y a lieu
345
+    if ($em) {
346
+        $letexte = echappe_retour($letexte, 'multi');
347
+    }
348
+    if ($ei) {
349
+        $letexte = echappe_retour($letexte, 'idiome');
350
+    }
351
+
352
+    // Retablir les caracteres proteges
353
+    $letexte = strtr($letexte, _TYPO_PROTECTEUR, _TYPO_PROTEGER);
354
+
355
+    // pipeline
356
+    $letexte = pipeline('post_typo', $letexte);
357
+
358
+    # un message pour abs_url - on est passe en mode texte
359
+    $GLOBALS['mode_abs_url'] = 'texte';
360
+
361
+    return $letexte;
362 362
 }
363 363
 
364 364
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
  * @return string
375 375
  */
376 376
 function paragrapher($letexte, $forcer = true) {
377
-	return $letexte;
377
+    return $letexte;
378 378
 }
379 379
 
380 380
 /**
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
  * @return string texte
387 387
  **/
388 388
 function traiter_retours_chariots($letexte) {
389
-	$letexte = preg_replace(",\r\n?,S", "\n", $letexte);
390
-	$letexte = preg_replace(',<p[>[:space:]],iS', "\n\n\\0", $letexte);
391
-	$letexte = preg_replace(',</p[>[:space:]],iS', "\\0\n\n", $letexte);
389
+    $letexte = preg_replace(",\r\n?,S", "\n", $letexte);
390
+    $letexte = preg_replace(',<p[>[:space:]],iS', "\n\n\\0", $letexte);
391
+    $letexte = preg_replace(',</p[>[:space:]],iS', "\\0\n\n", $letexte);
392 392
 
393
-	return $letexte;
393
+    return $letexte;
394 394
 }
395 395
 
396 396
 
@@ -416,41 +416,41 @@  discard block
 block discarded – undo
416 416
  *     texte transformé
417 417
  **/
418 418
 function propre($t, $connect = null, $env = []) {
419
-	// les appels directs a cette fonction depuis le php de l'espace
420
-	// prive etant historiquement ecrits sans argment $connect
421
-	// on utilise la presence de celui-ci pour distinguer les cas
422
-	// ou il faut passer interdire_script explicitement
423
-	// les appels dans les squelettes (de l'espace prive) fournissant un $connect
424
-	// ne seront pas perturbes
425
-	// FIXME: Trouver une solution pour avoir un type (string) unique sur $connect.
426
-	$interdire_script = false;
427
-	if (is_null($connect)) {
428
-		$connect = '';
429
-		$interdire_script = true;
430
-		$env['espace_prive'] = true;
431
-	}
432
-
433
-	if (!$t) {
434
-		return strval($t);
435
-	}
436
-
437
-	// Dans l'espace prive on se mefie de tout contenu dangereux
438
-	// avant echappement des balises <html>
439
-	// https://core.spip.net/issues/3371
440
-	// et aussi dans l'espace public si la globale filtrer_javascript = -1
441
-	// https://core.spip.net/issues/4166
442
-	if (
443
-		$interdire_script
444
-		|| $GLOBALS['filtrer_javascript'] == -1
445
-		|| !empty($env['espace_prive']) && $GLOBALS['filtrer_javascript'] <= 0
446
-		|| !empty($env['wysiwyg']) && $env['wysiwyg'] && $GLOBALS['filtrer_javascript'] <= 0
447
-	) {
448
-		$t = echapper_html_suspect($t, ['strict' => false], $connect, $env);
449
-	}
450
-	$t = echappe_html($t);
451
-	$t = expanser_liens($t, $connect ?? '', $env);
452
-	$t = traiter_raccourcis($t);
453
-	$t = echappe_retour_modeles($t, $interdire_script);
454
-
455
-	return $t;
419
+    // les appels directs a cette fonction depuis le php de l'espace
420
+    // prive etant historiquement ecrits sans argment $connect
421
+    // on utilise la presence de celui-ci pour distinguer les cas
422
+    // ou il faut passer interdire_script explicitement
423
+    // les appels dans les squelettes (de l'espace prive) fournissant un $connect
424
+    // ne seront pas perturbes
425
+    // FIXME: Trouver une solution pour avoir un type (string) unique sur $connect.
426
+    $interdire_script = false;
427
+    if (is_null($connect)) {
428
+        $connect = '';
429
+        $interdire_script = true;
430
+        $env['espace_prive'] = true;
431
+    }
432
+
433
+    if (!$t) {
434
+        return strval($t);
435
+    }
436
+
437
+    // Dans l'espace prive on se mefie de tout contenu dangereux
438
+    // avant echappement des balises <html>
439
+    // https://core.spip.net/issues/3371
440
+    // et aussi dans l'espace public si la globale filtrer_javascript = -1
441
+    // https://core.spip.net/issues/4166
442
+    if (
443
+        $interdire_script
444
+        || $GLOBALS['filtrer_javascript'] == -1
445
+        || !empty($env['espace_prive']) && $GLOBALS['filtrer_javascript'] <= 0
446
+        || !empty($env['wysiwyg']) && $env['wysiwyg'] && $GLOBALS['filtrer_javascript'] <= 0
447
+    ) {
448
+        $t = echapper_html_suspect($t, ['strict' => false], $connect, $env);
449
+    }
450
+    $t = echappe_html($t);
451
+    $t = expanser_liens($t, $connect ?? '', $env);
452
+    $t = traiter_raccourcis($t);
453
+    $t = echappe_retour_modeles($t, $interdire_script);
454
+
455
+    return $t;
456 456
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 	foreach (['script', 'iframe'] as $tag) {
107 107
 		if (
108 108
 			stripos($t, (string) "<$tag") !== false
109
-			&& preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
109
+			&& preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER)
110 110
 		) {
111 111
 			foreach ($r as $regs) {
112 112
 				$t = str_replace(
113 113
 					$regs[0],
114
-					"<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
114
+					"<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>',
115 115
 					$t
116 116
 				);
117 117
 			}
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
 	}
165 165
 
166 166
 	// echapper les tags asp/php
167
-	$t = str_replace('<' . '%', '&lt;%', $arg);
167
+	$t = str_replace('<'.'%', '&lt;%', $arg);
168 168
 
169 169
 	// echapper le php
170
-	$t = str_replace('<' . '?', '&lt;?', $t);
170
+	$t = str_replace('<'.'?', '&lt;?', $t);
171 171
 
172 172
 	// echapper le < script language=php >
173 173
 	$t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 
190 190
 	// Reinserer les echappements des modeles
191 191
 	if (defined('_PROTEGE_JS_MODELES')) {
192
-		$t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES);
192
+		$t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES);
193 193
 	}
194 194
 	if (defined('_PROTEGE_PHP_MODELES')) {
195
-		$t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES);
195
+		$t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES);
196 196
 	}
197 197
 
198 198
 	return $dejavu[$mode_filtre][$arg] = $t;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 define('_TYPO_PROTEGER', "!':;?~%-");
291 291
 define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8");
292 292
 
293
-define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS');
293
+define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS');
294 294
 
295 295
 /**
296 296
  * Corrige la typographie
Please login to merge, or discard this patch.
ecrire/inc/filtres_ecrire.php 3 patches
Indentation   +372 added lines, -372 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @package SPIP\Core\Filtres
16 16
  */
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18
-	return;
18
+    return;
19 19
 }
20 20
 
21 21
 include_spip('inc/filtres_boites');
@@ -40,25 +40,25 @@  discard block
 block discarded – undo
40 40
  */
41 41
 function parametres_css_prive() {
42 42
 
43
-	$args = [];
44
-	$args['v'] = $GLOBALS['spip_version_code'];
45
-	$args['p'] = substr(md5((string) $GLOBALS['meta']['plugin']), 0, 4);
46
-	$args['themes'] = implode(',', lister_themes_prives());
47
-	$args['ltr'] = $GLOBALS['spip_lang_left'];
48
-	// un md5 des menus : si un menu change il faut maj la css
49
-	$args['md5b'] = (function_exists('md5_boutons_plugins') ? md5_boutons_plugins() : '');
43
+    $args = [];
44
+    $args['v'] = $GLOBALS['spip_version_code'];
45
+    $args['p'] = substr(md5((string) $GLOBALS['meta']['plugin']), 0, 4);
46
+    $args['themes'] = implode(',', lister_themes_prives());
47
+    $args['ltr'] = $GLOBALS['spip_lang_left'];
48
+    // un md5 des menus : si un menu change il faut maj la css
49
+    $args['md5b'] = (function_exists('md5_boutons_plugins') ? md5_boutons_plugins() : '');
50 50
 
51
-	$c = $GLOBALS['visiteur_session']['prefs']['couleur'] ?? 2;
51
+    $c = $GLOBALS['visiteur_session']['prefs']['couleur'] ?? 2;
52 52
 
53
-	$couleurs = charger_fonction('couleurs', 'inc');
54
-	parse_str((string) $couleurs($c), $c);
55
-	$args = array_merge($args, $c);
53
+    $couleurs = charger_fonction('couleurs', 'inc');
54
+    parse_str((string) $couleurs($c), $c);
55
+    $args = array_merge($args, $c);
56 56
 
57
-	if (_request('var_mode') == 'recalcul' || defined('_VAR_MODE') && _VAR_MODE == 'recalcul') {
58
-		$args['var_mode'] = 'recalcul';
59
-	}
57
+    if (_request('var_mode') == 'recalcul' || defined('_VAR_MODE') && _VAR_MODE == 'recalcul') {
58
+        $args['var_mode'] = 'recalcul';
59
+    }
60 60
 
61
-	return http_build_query($args);
61
+    return http_build_query($args);
62 62
 }
63 63
 
64 64
 
@@ -81,95 +81,95 @@  discard block
 block discarded – undo
81 81
  * @return string
82 82
  */
83 83
 function chercher_rubrique(
84
-	$titre,
85
-	$id_objet,
86
-	$id_parent,
87
-	$objet,
88
-	$id_secteur,
89
-	$restreint,
90
-	$actionable = false,
91
-	$retour_sans_cadre = false
84
+    $titre,
85
+    $id_objet,
86
+    $id_parent,
87
+    $objet,
88
+    $id_secteur,
89
+    $restreint,
90
+    $actionable = false,
91
+    $retour_sans_cadre = false
92 92
 ) {
93 93
 
94
-	include_spip('inc/autoriser');
95
-	if ((int) $id_objet && !autoriser('modifier', $objet, $id_objet)) {
96
-		return '';
97
-	}
98
-	if (!sql_countsel('spip_rubriques')) {
99
-		return '';
100
-	}
101
-	$chercher_rubrique = charger_fonction('chercher_rubrique', 'inc');
102
-	$form = $chercher_rubrique($id_parent, $objet, $restreint, ($objet == 'rubrique') ? $id_objet : 0);
103
-
104
-	if ($id_parent == 0) {
105
-		$logo = 'racine-24.png';
106
-	} elseif ($id_secteur == $id_parent) {
107
-		$logo = 'secteur-24.png';
108
-	} else {
109
-		$logo = 'rubrique-24.png';
110
-	}
111
-
112
-	$confirm = '';
113
-	if ($objet == 'rubrique') {
114
-		// FIXME: Migration plus adapté vers le plugin Brèves ?
115
-		// si c'est une rubrique-secteur contenant des breves, demander la
116
-		// confirmation du deplacement
117
-		if (
118
-			sql_table_exists('spip_breves')
119
-			&& ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet))
120
-			&& $contient_breves > 0
121
-		) {
122
-			// FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves
123
-			$scb = ($contient_breves > 1 ? 's' : '');
124
-			$scb = _T(
125
-				'avis_deplacement_rubrique',
126
-				[
127
-					'contient_breves' => $contient_breves,
128
-					'scb' => $scb
129
-				]
130
-			);
131
-			$confirm .= "\n<div class='confirmer_deplacement verdana2'>"
132
-				. "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
133
-				. $scb .
134
-				"</label></div></div>\n";
135
-		} else {
136
-			$confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
137
-		}
138
-	}
139
-	$form .= $confirm;
140
-	if ($actionable) {
141
-		if (str_contains($form, '<select')) {
142
-			$form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
143
-				. '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
144
-				. '</div>';
145
-		}
146
-		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
147
-		if ($action = charger_fonction("editer_$objet", 'action', true)) {
148
-			$form = generer_action_auteur(
149
-				"editer_$objet",
150
-				$id_objet,
151
-				self(),
152
-				$form,
153
-				" method='post' class='submit_plongeur'"
154
-			);
155
-		} else {
156
-			$form = generer_action_auteur(
157
-				'editer_objet',
158
-				"$objet/$id_objet",
159
-				self(),
160
-				$form,
161
-				" method='post' class='submit_plongeur'"
162
-			);
163
-		}
164
-	}
165
-
166
-	if ($retour_sans_cadre) {
167
-		return $form;
168
-	}
169
-
170
-	include_spip('inc/presentation');
171
-
172
-	return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
94
+    include_spip('inc/autoriser');
95
+    if ((int) $id_objet && !autoriser('modifier', $objet, $id_objet)) {
96
+        return '';
97
+    }
98
+    if (!sql_countsel('spip_rubriques')) {
99
+        return '';
100
+    }
101
+    $chercher_rubrique = charger_fonction('chercher_rubrique', 'inc');
102
+    $form = $chercher_rubrique($id_parent, $objet, $restreint, ($objet == 'rubrique') ? $id_objet : 0);
103
+
104
+    if ($id_parent == 0) {
105
+        $logo = 'racine-24.png';
106
+    } elseif ($id_secteur == $id_parent) {
107
+        $logo = 'secteur-24.png';
108
+    } else {
109
+        $logo = 'rubrique-24.png';
110
+    }
111
+
112
+    $confirm = '';
113
+    if ($objet == 'rubrique') {
114
+        // FIXME: Migration plus adapté vers le plugin Brèves ?
115
+        // si c'est une rubrique-secteur contenant des breves, demander la
116
+        // confirmation du deplacement
117
+        if (
118
+            sql_table_exists('spip_breves')
119
+            && ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet))
120
+            && $contient_breves > 0
121
+        ) {
122
+            // FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves
123
+            $scb = ($contient_breves > 1 ? 's' : '');
124
+            $scb = _T(
125
+                'avis_deplacement_rubrique',
126
+                [
127
+                    'contient_breves' => $contient_breves,
128
+                    'scb' => $scb
129
+                ]
130
+            );
131
+            $confirm .= "\n<div class='confirmer_deplacement verdana2'>"
132
+                . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
133
+                . $scb .
134
+                "</label></div></div>\n";
135
+        } else {
136
+            $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
137
+        }
138
+    }
139
+    $form .= $confirm;
140
+    if ($actionable) {
141
+        if (str_contains($form, '<select')) {
142
+            $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
143
+                . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
144
+                . '</div>';
145
+        }
146
+        $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
147
+        if ($action = charger_fonction("editer_$objet", 'action', true)) {
148
+            $form = generer_action_auteur(
149
+                "editer_$objet",
150
+                $id_objet,
151
+                self(),
152
+                $form,
153
+                " method='post' class='submit_plongeur'"
154
+            );
155
+        } else {
156
+            $form = generer_action_auteur(
157
+                'editer_objet',
158
+                "$objet/$id_objet",
159
+                self(),
160
+                $form,
161
+                " method='post' class='submit_plongeur'"
162
+            );
163
+        }
164
+    }
165
+
166
+    if ($retour_sans_cadre) {
167
+        return $form;
168
+    }
169
+
170
+    include_spip('inc/presentation');
171
+
172
+    return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
173 173
 }
174 174
 
175 175
 
@@ -183,24 +183,24 @@  discard block
 block discarded – undo
183 183
  * @return bool
184 184
  */
185 185
 function avoir_visiteurs($past = false, $accepter = true) {
186
-	if ($GLOBALS['meta']['forums_publics'] == 'abo') {
187
-		return true;
188
-	}
189
-	if ($accepter && $GLOBALS['meta']['accepter_visiteurs'] != 'non') {
190
-		return true;
191
-	}
192
-	if (sql_countsel('spip_articles', "accepter_forum='abo'")) {
193
-		return true;
194
-	}
195
-	if (!$past) {
196
-		return false;
197
-	}
198
-
199
-	return sql_countsel(
200
-		'spip_auteurs',
201
-		"statut NOT IN ('0minirezo','1comite', '5poubelle')
186
+    if ($GLOBALS['meta']['forums_publics'] == 'abo') {
187
+        return true;
188
+    }
189
+    if ($accepter && $GLOBALS['meta']['accepter_visiteurs'] != 'non') {
190
+        return true;
191
+    }
192
+    if (sql_countsel('spip_articles', "accepter_forum='abo'")) {
193
+        return true;
194
+    }
195
+    if (!$past) {
196
+        return false;
197
+    }
198
+
199
+    return sql_countsel(
200
+        'spip_auteurs',
201
+        "statut NOT IN ('0minirezo','1comite', '5poubelle')
202 202
 	                    AND (statut<>'nouveau' OR prefs NOT IN ('0minirezo','1comite', '5poubelle'))"
203
-	);
203
+    );
204 204
 }
205 205
 
206 206
 /**
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
  * @return array
217 217
  */
218 218
 function statuts_articles_visibles($statut_auteur) {
219
-	static $auth = [];
220
-	if (!isset($auth[$statut_auteur])) {
221
-		$auth[$statut_auteur] = [];
222
-		$statuts = array_column(sql_allfetsel('distinct statut', 'spip_articles'), 'statut');
223
-		foreach ($statuts as $s) {
224
-			if (autoriser('voir', 'article', 0, ['statut' => $statut_auteur], ['statut' => $s])) {
225
-				$auth[$statut_auteur][] = $s;
226
-			}
227
-		}
228
-	}
229
-
230
-	return $auth[$statut_auteur];
219
+    static $auth = [];
220
+    if (!isset($auth[$statut_auteur])) {
221
+        $auth[$statut_auteur] = [];
222
+        $statuts = array_column(sql_allfetsel('distinct statut', 'spip_articles'), 'statut');
223
+        foreach ($statuts as $s) {
224
+            if (autoriser('voir', 'article', 0, ['statut' => $statut_auteur], ['statut' => $s])) {
225
+                $auth[$statut_auteur][] = $s;
226
+            }
227
+        }
228
+    }
229
+
230
+    return $auth[$statut_auteur];
231 231
 }
232 232
 
233 233
 /**
@@ -241,38 +241,38 @@  discard block
 block discarded – undo
241 241
  * @return string
242 242
  */
243 243
 function traduire_statut_auteur($statut, $attente = '') {
244
-	$plus = '';
245
-	if ($statut == 'nouveau') {
246
-		if ($attente) {
247
-			$statut = $attente;
248
-			$plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
249
-		} else {
250
-			return _T('info_statut_auteur_a_confirmer');
251
-		}
252
-	}
253
-
254
-	$recom = [
255
-		'info_administrateurs' => _T('item_administrateur_2'),
256
-		'info_redacteurs' => _T('intem_redacteur'),
257
-		'info_visiteurs' => _T('item_visiteur'),
258
-		'5poubelle' => _T('texte_statut_poubelle'), // bouh
259
-	];
260
-	if (isset($recom[$statut])) {
261
-		return $recom[$statut] . $plus;
262
-	}
263
-
264
-	// retrouver directement par le statut sinon
265
-	if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
266
-		if (isset($recom[$t])) {
267
-			return $recom[$t] . $plus;
268
-		}
269
-
270
-		return _T($t) . $plus;
271
-	}
272
-
273
-	// si on a pas reussi a le traduire, retournons la chaine telle quelle
274
-	// c'est toujours plus informatif que rien du tout
275
-	return $statut;
244
+    $plus = '';
245
+    if ($statut == 'nouveau') {
246
+        if ($attente) {
247
+            $statut = $attente;
248
+            $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
249
+        } else {
250
+            return _T('info_statut_auteur_a_confirmer');
251
+        }
252
+    }
253
+
254
+    $recom = [
255
+        'info_administrateurs' => _T('item_administrateur_2'),
256
+        'info_redacteurs' => _T('intem_redacteur'),
257
+        'info_visiteurs' => _T('item_visiteur'),
258
+        '5poubelle' => _T('texte_statut_poubelle'), // bouh
259
+    ];
260
+    if (isset($recom[$statut])) {
261
+        return $recom[$statut] . $plus;
262
+    }
263
+
264
+    // retrouver directement par le statut sinon
265
+    if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
266
+        if (isset($recom[$t])) {
267
+            return $recom[$t] . $plus;
268
+        }
269
+
270
+        return _T($t) . $plus;
271
+    }
272
+
273
+    // si on a pas reussi a le traduire, retournons la chaine telle quelle
274
+    // c'est toujours plus informatif que rien du tout
275
+    return $statut;
276 276
 }
277 277
 
278 278
 /**
@@ -283,29 +283,29 @@  discard block
 block discarded – undo
283 283
  * @return string
284 284
  */
285 285
 function afficher_qui_edite($id_objet, $objet): string {
286
-	static $qui = [];
287
-	if (isset($qui[$objet][$id_objet])) {
288
-		return $qui[$objet][$id_objet];
289
-	}
290
-
291
-	include_spip('inc/config');
292
-	if (lire_config('articles_modif', 'non') === 'non') {
293
-		return $qui[$objet][$id_objet] = '';
294
-	}
295
-
296
-	include_spip('inc/drapeau_edition');
297
-	$modif = mention_qui_edite($id_objet, $objet);
298
-	if (!$modif) {
299
-		return $qui[$objet][$id_objet] = '';
300
-	}
301
-
302
-	include_spip('base/objets');
303
-	$infos = lister_tables_objets_sql(table_objet_sql($objet));
304
-	if (isset($infos['texte_signale_edition'])) {
305
-		return $qui[$objet][$id_objet] = _T($infos['texte_signale_edition'], $modif);
306
-	}
307
-
308
-	return $qui[$objet][$id_objet] = _T('info_qui_edite', $modif);
286
+    static $qui = [];
287
+    if (isset($qui[$objet][$id_objet])) {
288
+        return $qui[$objet][$id_objet];
289
+    }
290
+
291
+    include_spip('inc/config');
292
+    if (lire_config('articles_modif', 'non') === 'non') {
293
+        return $qui[$objet][$id_objet] = '';
294
+    }
295
+
296
+    include_spip('inc/drapeau_edition');
297
+    $modif = mention_qui_edite($id_objet, $objet);
298
+    if (!$modif) {
299
+        return $qui[$objet][$id_objet] = '';
300
+    }
301
+
302
+    include_spip('base/objets');
303
+    $infos = lister_tables_objets_sql(table_objet_sql($objet));
304
+    if (isset($infos['texte_signale_edition'])) {
305
+        return $qui[$objet][$id_objet] = _T($infos['texte_signale_edition'], $modif);
306
+    }
307
+
308
+    return $qui[$objet][$id_objet] = _T('info_qui_edite', $modif);
309 309
 }
310 310
 
311 311
 /**
@@ -323,53 +323,53 @@  discard block
 block discarded – undo
323 323
  * @return array
324 324
  */
325 325
 function auteurs_lister_statuts($quoi = 'tous', $en_base = true): array {
326
-	if (!defined('AUTEURS_MIN_REDAC')) {
327
-		define('AUTEURS_MIN_REDAC', '0minirezo,1comite,5poubelle');
328
-	}
329
-
330
-	switch ($quoi) {
331
-		case 'redacteurs':
332
-			$statut = AUTEURS_MIN_REDAC;
333
-			$statut = explode(',', (string) $statut);
334
-			if ($en_base) {
335
-				$check = array_column(sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut)), 'statut');
336
-				$retire = array_diff($statut, $check);
337
-				$statut = array_diff($statut, $retire);
338
-			}
339
-
340
-			return array_unique($statut);
341
-
342
-		case 'visiteurs':
343
-			$statut = [];
344
-			$exclus = AUTEURS_MIN_REDAC;
345
-			$exclus = explode(',', (string) $exclus);
346
-			if (!$en_base) {
347
-				// prendre aussi les statuts de la table des status qui ne sont pas dans le define
348
-				$statut = array_diff(array_values($GLOBALS['liste_des_statuts']), $exclus);
349
-			}
350
-			$s_complement = array_column(
351
-				sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $exclus, 'NOT')),
352
-				'statut'
353
-			);
354
-
355
-			return array_unique([...$statut, ...$s_complement]);
356
-
357
-		default:
358
-		case 'tous':
359
-			$statut = array_values($GLOBALS['liste_des_statuts']);
360
-			$s_complement = array_column(
361
-				sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut, 'NOT')),
362
-				'statut'
363
-			);
364
-			$statut = [...$statut, ...$s_complement];
365
-			if ($en_base) {
366
-				$check = array_column(sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut)), 'statut');
367
-				$retire = array_diff($statut, $check);
368
-				$statut = array_diff($statut, $retire);
369
-			}
370
-
371
-			return array_unique($statut);
372
-	}
326
+    if (!defined('AUTEURS_MIN_REDAC')) {
327
+        define('AUTEURS_MIN_REDAC', '0minirezo,1comite,5poubelle');
328
+    }
329
+
330
+    switch ($quoi) {
331
+        case 'redacteurs':
332
+            $statut = AUTEURS_MIN_REDAC;
333
+            $statut = explode(',', (string) $statut);
334
+            if ($en_base) {
335
+                $check = array_column(sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut)), 'statut');
336
+                $retire = array_diff($statut, $check);
337
+                $statut = array_diff($statut, $retire);
338
+            }
339
+
340
+            return array_unique($statut);
341
+
342
+        case 'visiteurs':
343
+            $statut = [];
344
+            $exclus = AUTEURS_MIN_REDAC;
345
+            $exclus = explode(',', (string) $exclus);
346
+            if (!$en_base) {
347
+                // prendre aussi les statuts de la table des status qui ne sont pas dans le define
348
+                $statut = array_diff(array_values($GLOBALS['liste_des_statuts']), $exclus);
349
+            }
350
+            $s_complement = array_column(
351
+                sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $exclus, 'NOT')),
352
+                'statut'
353
+            );
354
+
355
+            return array_unique([...$statut, ...$s_complement]);
356
+
357
+        default:
358
+        case 'tous':
359
+            $statut = array_values($GLOBALS['liste_des_statuts']);
360
+            $s_complement = array_column(
361
+                sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut, 'NOT')),
362
+                'statut'
363
+            );
364
+            $statut = [...$statut, ...$s_complement];
365
+            if ($en_base) {
366
+                $check = array_column(sql_allfetsel('DISTINCT statut', 'spip_auteurs', sql_in('statut', $statut)), 'statut');
367
+                $retire = array_diff($statut, $check);
368
+                $statut = array_diff($statut, $retire);
369
+            }
370
+
371
+            return array_unique($statut);
372
+    }
373 373
 }
374 374
 
375 375
 /**
@@ -385,28 +385,28 @@  discard block
 block discarded – undo
385 385
  */
386 386
 function trouver_rubrique_creer_objet($id_rubrique, $objet) {
387 387
 
388
-	if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) {
389
-		$in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
390
-			? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
391
-			: '';
392
-
393
-		// on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
394
-		if ($objet == 'rubrique') {
395
-			$id_rubrique = 0;
396
-		} else {
397
-			$id_rubrique = sql_getfetsel('id_rubrique', 'spip_rubriques', "id_parent=0$in", '', 'id_rubrique DESC', 1);
398
-		}
399
-
400
-		if (!autoriser("creer{$objet}dans", 'rubrique', $id_rubrique)) {
401
-			// manque de chance, la rubrique n'est pas autorisee, on cherche un des secteurs autorises
402
-			$res = sql_select('id_rubrique', 'spip_rubriques', 'id_parent=0');
403
-			while (!autoriser("creer{$objet}dans", 'rubrique', $id_rubrique) && $row_rub = sql_fetch($res)) {
404
-				$id_rubrique = $row_rub['id_rubrique'];
405
-			}
406
-		}
407
-	}
408
-
409
-	return $id_rubrique;
388
+    if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) {
389
+        $in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
390
+            ? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
391
+            : '';
392
+
393
+        // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
394
+        if ($objet == 'rubrique') {
395
+            $id_rubrique = 0;
396
+        } else {
397
+            $id_rubrique = sql_getfetsel('id_rubrique', 'spip_rubriques', "id_parent=0$in", '', 'id_rubrique DESC', 1);
398
+        }
399
+
400
+        if (!autoriser("creer{$objet}dans", 'rubrique', $id_rubrique)) {
401
+            // manque de chance, la rubrique n'est pas autorisee, on cherche un des secteurs autorises
402
+            $res = sql_select('id_rubrique', 'spip_rubriques', 'id_parent=0');
403
+            while (!autoriser("creer{$objet}dans", 'rubrique', $id_rubrique) && $row_rub = sql_fetch($res)) {
404
+                $id_rubrique = $row_rub['id_rubrique'];
405
+            }
406
+        }
407
+    }
408
+
409
+    return $id_rubrique;
410 410
 }
411 411
 
412 412
 /**
@@ -417,25 +417,25 @@  discard block
 block discarded – undo
417 417
  * @return string
418 418
  */
419 419
 function lien_article_virtuel($virtuel) {
420
-	include_spip('inc/lien');
421
-	if (!$virtuel = virtuel_redirige($virtuel)) {
422
-		return '';
423
-	}
424
-
425
-	$joli = $virtuel;
426
-	$parts = parse_url($virtuel);
427
-	if (!empty($parts['query']) && str_contains($parts['query'], ']')) {
428
-		$query = str_replace(['[', ']'], [urlencode('['), urlencode(']')], $parts['query']);
429
-		$virtuel = str_replace('?' . $parts['query'], "?$query", $virtuel);
430
-	}
431
-	if ($virtuel !== $joli) {
432
-		$joli = propre('[' . $joli . ' -> ' . $virtuel . ']');
433
-	}
434
-	else {
435
-		$joli = propre('[->' . $virtuel . ']');
436
-	}
437
-
438
-	return $joli;
420
+    include_spip('inc/lien');
421
+    if (!$virtuel = virtuel_redirige($virtuel)) {
422
+        return '';
423
+    }
424
+
425
+    $joli = $virtuel;
426
+    $parts = parse_url($virtuel);
427
+    if (!empty($parts['query']) && str_contains($parts['query'], ']')) {
428
+        $query = str_replace(['[', ']'], [urlencode('['), urlencode(']')], $parts['query']);
429
+        $virtuel = str_replace('?' . $parts['query'], "?$query", $virtuel);
430
+    }
431
+    if ($virtuel !== $joli) {
432
+        $joli = propre('[' . $joli . ' -> ' . $virtuel . ']');
433
+    }
434
+    else {
435
+        $joli = propre('[->' . $virtuel . ']');
436
+    }
437
+
438
+    return $joli;
439 439
 }
440 440
 
441 441
 
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
  * @filtre
459 459
  */
460 460
 function bouton_spip_rss($op, $args = [], $lang = '', $title = 'RSS') {
461
-	include_spip('inc/acces');
462
-	$clic = http_img_pack('rss-16.png', 'RSS', '', $title);
461
+    include_spip('inc/acces');
462
+    $clic = http_img_pack('rss-16.png', 'RSS', '', $title);
463 463
 
464
-	$url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
465
-	return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
464
+    $url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
465
+    return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
466 466
 }
467 467
 
468 468
 
@@ -474,72 +474,72 @@  discard block
 block discarded – undo
474 474
  */
475 475
 function alertes_auteur($id_auteur): string {
476 476
 
477
-	$alertes = [];
478
-
479
-	if (
480
-		isset($GLOBALS['meta']['message_crash_tables'])
481
-		&& autoriser('detruire', null, null, $id_auteur)
482
-	) {
483
-		include_spip('genie/maintenance');
484
-		if ($msg = message_crash_tables()) {
485
-			$alertes[] = $msg;
486
-		}
487
-	}
488
-
489
-	if (
490
-		isset($GLOBALS['meta']['message_crash_plugins'])
491
-		&& $GLOBALS['meta']['message_crash_plugins']
492
-		&& autoriser('configurer', '_plugins', null, $id_auteur)
493
-		&& is_array($msg = unserialize($GLOBALS['meta']['message_crash_plugins']))
494
-	) {
495
-		$msg = implode(', ', array_map('joli_repertoire', array_keys($msg)));
496
-		$alertes[] = _T('plugins_erreur', ['plugins' => $msg]);
497
-	}
498
-
499
-	$a = $GLOBALS['meta']['message_alertes_auteurs'] ?? '';
500
-	if ($a && is_array($a = unserialize($a)) && count($a)) {
501
-		$update = false;
502
-		if (isset($a[$GLOBALS['visiteur_session']['statut']])) {
503
-			$alertes = array_merge($alertes, $a[$GLOBALS['visiteur_session']['statut']]);
504
-			unset($a[$GLOBALS['visiteur_session']['statut']]);
505
-			$update = true;
506
-		}
507
-		if (isset($a[''])) {
508
-			$alertes = array_merge($alertes, $a['']);
509
-			unset($a['']);
510
-			$update = true;
511
-		}
512
-		if ($update) {
513
-			ecrire_meta('message_alertes_auteurs', serialize($a));
514
-		}
515
-	}
516
-
517
-	if (
518
-		isset($GLOBALS['meta']['plugin_erreur_activation'])
519
-		&& autoriser('configurer', '_plugins', null, $id_auteur)
520
-	) {
521
-		include_spip('inc/plugin');
522
-		$alertes[] = plugin_donne_erreurs();
523
-	}
524
-
525
-	$alertes = pipeline(
526
-		'alertes_auteur',
527
-		[
528
-			'args' => [
529
-				'id_auteur' => $id_auteur,
530
-				'exec' => _request('exec'),
531
-			],
532
-			'data' => $alertes
533
-		]
534
-	);
535
-
536
-	if ($alertes = array_filter($alertes)) {
537
-		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
538
-		implode(' | ', $alertes)
539
-		. '</div></div>';
540
-	}
541
-
542
-	return '';
477
+    $alertes = [];
478
+
479
+    if (
480
+        isset($GLOBALS['meta']['message_crash_tables'])
481
+        && autoriser('detruire', null, null, $id_auteur)
482
+    ) {
483
+        include_spip('genie/maintenance');
484
+        if ($msg = message_crash_tables()) {
485
+            $alertes[] = $msg;
486
+        }
487
+    }
488
+
489
+    if (
490
+        isset($GLOBALS['meta']['message_crash_plugins'])
491
+        && $GLOBALS['meta']['message_crash_plugins']
492
+        && autoriser('configurer', '_plugins', null, $id_auteur)
493
+        && is_array($msg = unserialize($GLOBALS['meta']['message_crash_plugins']))
494
+    ) {
495
+        $msg = implode(', ', array_map('joli_repertoire', array_keys($msg)));
496
+        $alertes[] = _T('plugins_erreur', ['plugins' => $msg]);
497
+    }
498
+
499
+    $a = $GLOBALS['meta']['message_alertes_auteurs'] ?? '';
500
+    if ($a && is_array($a = unserialize($a)) && count($a)) {
501
+        $update = false;
502
+        if (isset($a[$GLOBALS['visiteur_session']['statut']])) {
503
+            $alertes = array_merge($alertes, $a[$GLOBALS['visiteur_session']['statut']]);
504
+            unset($a[$GLOBALS['visiteur_session']['statut']]);
505
+            $update = true;
506
+        }
507
+        if (isset($a[''])) {
508
+            $alertes = array_merge($alertes, $a['']);
509
+            unset($a['']);
510
+            $update = true;
511
+        }
512
+        if ($update) {
513
+            ecrire_meta('message_alertes_auteurs', serialize($a));
514
+        }
515
+    }
516
+
517
+    if (
518
+        isset($GLOBALS['meta']['plugin_erreur_activation'])
519
+        && autoriser('configurer', '_plugins', null, $id_auteur)
520
+    ) {
521
+        include_spip('inc/plugin');
522
+        $alertes[] = plugin_donne_erreurs();
523
+    }
524
+
525
+    $alertes = pipeline(
526
+        'alertes_auteur',
527
+        [
528
+            'args' => [
529
+                'id_auteur' => $id_auteur,
530
+                'exec' => _request('exec'),
531
+            ],
532
+            'data' => $alertes
533
+        ]
534
+    );
535
+
536
+    if ($alertes = array_filter($alertes)) {
537
+        return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
538
+        implode(' | ', $alertes)
539
+        . '</div></div>';
540
+    }
541
+
542
+    return '';
543 543
 }
544 544
 
545 545
 /**
@@ -549,9 +549,9 @@  discard block
 block discarded – undo
549 549
  * @return string
550 550
  */
551 551
 function filtre_afficher_enfant_rub_dist($id_rubrique) {
552
-	include_spip('inc/presenter_enfants');
552
+    include_spip('inc/presenter_enfants');
553 553
 
554
-	return afficher_enfant_rub((int) $id_rubrique);
554
+    return afficher_enfant_rub((int) $id_rubrique);
555 555
 }
556 556
 
557 557
 /**
@@ -569,15 +569,15 @@  discard block
 block discarded – undo
569 569
  * @return string
570 570
  */
571 571
 function afficher_plus_info($lien, $titre = '+', $titre_lien = '') {
572
-	$titre = attribut_html($titre);
573
-	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
574
-		http_img_pack('information-16.png', $titre) . '</a>';
575
-
576
-	if (!$titre_lien) {
577
-		return $icone;
578
-	} else {
579
-		return $icone . "\n<a href='$lien'>$titre_lien</a>";
580
-	}
572
+    $titre = attribut_html($titre);
573
+    $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
574
+        http_img_pack('information-16.png', $titre) . '</a>';
575
+
576
+    if (!$titre_lien) {
577
+        return $icone;
578
+    } else {
579
+        return $icone . "\n<a href='$lien'>$titre_lien</a>";
580
+    }
581 581
 }
582 582
 
583 583
 
@@ -596,20 +596,20 @@  discard block
 block discarded – undo
596 596
  * @return array
597 597
  */
598 598
 function lister_objets_lies($objet_source, $objet, $id_objet, $objet_lien) {
599
-	$res = lister_objets_liens($objet_source, $objet, $id_objet, $objet_lien);
600
-	if (!(is_countable($res) ? count($res) : 0)) {
601
-		return [];
602
-	}
603
-	$r = reset($res);
604
-	$colonne_id = ($objet_source == $objet_lien ? id_table_objet($objet_source) : 'id_objet');
605
-	if (isset($r['rang_lien'])) {
606
-		$l = array_column($res, 'rang_lien', $colonne_id);
607
-		asort($l);
608
-		$l = array_keys($l);
609
-	} else {
610
-		// Si les liens qu'on cherche sont ceux de la table de lien, l'info est dans la clé de l'objet
611
-		// Sinon c'est dans "id_objet"
612
-		$l = array_column($res, $colonne_id);
613
-	}
614
-	return $l;
599
+    $res = lister_objets_liens($objet_source, $objet, $id_objet, $objet_lien);
600
+    if (!(is_countable($res) ? count($res) : 0)) {
601
+        return [];
602
+    }
603
+    $r = reset($res);
604
+    $colonne_id = ($objet_source == $objet_lien ? id_table_objet($objet_source) : 'id_objet');
605
+    if (isset($r['rang_lien'])) {
606
+        $l = array_column($res, 'rang_lien', $colonne_id);
607
+        asort($l);
608
+        $l = array_keys($l);
609
+    } else {
610
+        // Si les liens qu'on cherche sont ceux de la table de lien, l'info est dans la clé de l'objet
611
+        // Sinon c'est dans "id_objet"
612
+        $l = array_column($res, $colonne_id);
613
+    }
614
+    return $l;
615 615
 }
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		// confirmation du deplacement
117 117
 		if (
118 118
 			sql_table_exists('spip_breves')
119
-			&& ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet))
119
+			&& ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.(int) $id_objet))
120 120
 			&& $contient_breves > 0
121 121
 		) {
122 122
 			// FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 			);
131 131
 			$confirm .= "\n<div class='confirmer_deplacement verdana2'>"
132 132
 				. "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
133
-				. $scb .
133
+				. $scb.
134 134
 				"</label></div></div>\n";
135 135
 		} else {
136 136
 			$confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	$form .= $confirm;
140 140
 	if ($actionable) {
141 141
 		if (str_contains($form, '<select')) {
142
-			$form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
143
-				. '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
142
+			$form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>"
143
+				. '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>'
144 144
 				. '</div>';
145 145
 		}
146
-		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
146
+		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form;
147 147
 		if ($action = charger_fonction("editer_$objet", 'action', true)) {
148 148
 			$form = generer_action_auteur(
149 149
 				"editer_$objet",
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
 	include_spip('inc/presentation');
171 171
 
172
-	return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
172
+	return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur();
173 173
 }
174 174
 
175 175
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	if ($statut == 'nouveau') {
246 246
 		if ($attente) {
247 247
 			$statut = $attente;
248
-			$plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
248
+			$plus = ' ('._T('info_statut_auteur_a_confirmer').')';
249 249
 		} else {
250 250
 			return _T('info_statut_auteur_a_confirmer');
251 251
 		}
@@ -258,16 +258,16 @@  discard block
 block discarded – undo
258 258
 		'5poubelle' => _T('texte_statut_poubelle'), // bouh
259 259
 	];
260 260
 	if (isset($recom[$statut])) {
261
-		return $recom[$statut] . $plus;
261
+		return $recom[$statut].$plus;
262 262
 	}
263 263
 
264 264
 	// retrouver directement par le statut sinon
265 265
 	if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
266 266
 		if (isset($recom[$t])) {
267
-			return $recom[$t] . $plus;
267
+			return $recom[$t].$plus;
268 268
 		}
269 269
 
270
-		return _T($t) . $plus;
270
+		return _T($t).$plus;
271 271
 	}
272 272
 
273 273
 	// si on a pas reussi a le traduire, retournons la chaine telle quelle
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 	if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) {
389 389
 		$in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
390
-			? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
390
+			? ' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
391 391
 			: '';
392 392
 
393 393
 		// on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
@@ -426,13 +426,13 @@  discard block
 block discarded – undo
426 426
 	$parts = parse_url($virtuel);
427 427
 	if (!empty($parts['query']) && str_contains($parts['query'], ']')) {
428 428
 		$query = str_replace(['[', ']'], [urlencode('['), urlencode(']')], $parts['query']);
429
-		$virtuel = str_replace('?' . $parts['query'], "?$query", $virtuel);
429
+		$virtuel = str_replace('?'.$parts['query'], "?$query", $virtuel);
430 430
 	}
431 431
 	if ($virtuel !== $joli) {
432
-		$joli = propre('[' . $joli . ' -> ' . $virtuel . ']');
432
+		$joli = propre('['.$joli.' -> '.$virtuel.']');
433 433
 	}
434 434
 	else {
435
-		$joli = propre('[->' . $virtuel . ']');
435
+		$joli = propre('[->'.$virtuel.']');
436 436
 	}
437 437
 
438 438
 	return $joli;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 	$clic = http_img_pack('rss-16.png', 'RSS', '', $title);
463 463
 
464 464
 	$url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
465
-	return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
465
+	return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>";
466 466
 }
467 467
 
468 468
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	);
535 535
 
536 536
 	if ($alertes = array_filter($alertes)) {
537
-		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
537
+		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>".
538 538
 		implode(' | ', $alertes)
539 539
 		. '</div></div>';
540 540
 	}
@@ -570,13 +570,13 @@  discard block
 block discarded – undo
570 570
  */
571 571
 function afficher_plus_info($lien, $titre = '+', $titre_lien = '') {
572 572
 	$titre = attribut_html($titre);
573
-	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
574
-		http_img_pack('information-16.png', $titre) . '</a>';
573
+	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>".
574
+		http_img_pack('information-16.png', $titre).'</a>';
575 575
 
576 576
 	if (!$titre_lien) {
577 577
 		return $icone;
578 578
 	} else {
579
-		return $icone . "\n<a href='$lien'>$titre_lien</a>";
579
+		return $icone."\n<a href='$lien'>$titre_lien</a>";
580 580
 	}
581 581
 }
582 582
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -430,8 +430,7 @@
 block discarded – undo
430 430
 	}
431 431
 	if ($virtuel !== $joli) {
432 432
 		$joli = propre('[' . $joli . ' -> ' . $virtuel . ']');
433
-	}
434
-	else {
433
+	} else {
435 434
 		$joli = propre('[->' . $virtuel . ']');
436 435
 	}
437 436
 
Please login to merge, or discard this patch.
ecrire/inc/urls.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	) {
193 193
 		$r = nettoyer_url_page($url, $contexte);
194 194
 		if ($r) {
195
-			[$contexte, $type, , , $suite] = $r;
195
+			[$contexte, $type,,, $suite] = $r;
196 196
 			$_id = id_table_objet($type);
197 197
 			$id_objet = $contexte[$_id];
198 198
 			$url_propre = generer_objet_url($id_objet, $type);
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
  */
264 264
 function nettoyer_url_page($url, $contexte = []) {
265 265
 	$url_objets = urls_liste_objets();
266
-	$raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
267
-	$raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
-	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
266
+	$raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,';
267
+	$raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
+	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,';
269 269
 
270 270
 	if (
271 271
 		preg_match($raccourci_url_page_html, $url, $regs)
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	$id = intval($id);
304 304
 	if (!isset($furls[$objet])) {
305 305
 		if (
306
-			function_exists($f = 'generer_' . $objet . '_url_ecrire')
306
+			function_exists($f = 'generer_'.$objet.'_url_ecrire')
307 307
 			|| ($f = charger_fonction($f, 'urls', true))
308
-			|| function_exists($f = 'generer_url_ecrire_' . $objet) // deprecated
308
+			|| function_exists($f = 'generer_url_ecrire_'.$objet) // deprecated
309 309
 			|| ($f = charger_fonction($f, 'urls', true)) // deprecated
310 310
 		) {
311 311
 			$furls[$objet] = $f;
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 	if ($public || $connect) {
325 325
 		return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect);
326 326
 	}
327
-	$a = id_table_objet($objet) . '=' . intval($id);
327
+	$a = id_table_objet($objet).'='.intval($id);
328 328
 	if (!function_exists('objet_info')) {
329 329
 		include_spip('inc/filtres');
330 330
 	}
331 331
 
332
-	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
332
+	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : '');
333 333
 }
Please login to merge, or discard this patch.
Indentation   +203 added lines, -203 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 include_spip('base/objets');
22 22
 
@@ -56,106 +56,106 @@  discard block
 block discarded – undo
56 56
  *
57 57
  */
58 58
 function urls_decoder_url($url, $fond = '', $contexte = [], $assembler = false) {
59
-	static $current_base = null;
59
+    static $current_base = null;
60 60
 
61
-	// les anciennes fonctions modifient directement les globales
62
-	// on les sauve avant l'appel, et on les retablit apres !
63
-	$save = [
64
-		$GLOBALS['fond'] ?? null,
65
-		$GLOBALS['contexte'] ?? null,
66
-		$_SERVER['REDIRECT_url_propre'] ?? null,
67
-		$_ENV['url_propre'] ?? null,
68
-		$GLOBALS['profondeur_url']
69
-	];
61
+    // les anciennes fonctions modifient directement les globales
62
+    // on les sauve avant l'appel, et on les retablit apres !
63
+    $save = [
64
+        $GLOBALS['fond'] ?? null,
65
+        $GLOBALS['contexte'] ?? null,
66
+        $_SERVER['REDIRECT_url_propre'] ?? null,
67
+        $_ENV['url_propre'] ?? null,
68
+        $GLOBALS['profondeur_url']
69
+    ];
70 70
 
71
-	if (is_null($current_base)) {
72
-		include_spip('inc/filtres_mini');
73
-		// le decodage des urls se fait toujours par rapport au site public
74
-		$current_base = url_absolue(_DIR_RACINE ?: './');
75
-	}
76
-	if (str_starts_with($url, $current_base)) {
77
-		$url = substr($url, strlen($current_base));
78
-	}
71
+    if (is_null($current_base)) {
72
+        include_spip('inc/filtres_mini');
73
+        // le decodage des urls se fait toujours par rapport au site public
74
+        $current_base = url_absolue(_DIR_RACINE ?: './');
75
+    }
76
+    if (str_starts_with($url, $current_base)) {
77
+        $url = substr($url, strlen($current_base));
78
+    }
79 79
 
80
-	// si on est en train d'assembler la page principale,
81
-	// recuperer l'url depuis les globales url propres si fournies
82
-	// sinon extraire la bonne portion d'url
83
-	if ($assembler) {
84
-		if (isset($_SERVER['REDIRECT_url_propre'])) {
85
-			$url = $_SERVER['REDIRECT_url_propre'];
86
-		} elseif (isset($_ENV['url_propre'])) {
87
-			$url = $_ENV['url_propre'];
88
-		} else {
89
-			$qs = explode('?', $url);
90
-			// ne prendre que le segment d'url qui correspond, en fonction de la profondeur calculee
91
-			$url = ltrim($qs[0], '/');
92
-			$url = explode('/', $url);
93
-			while (count($url) > $GLOBALS['profondeur_url'] + 1) {
94
-				array_shift($url);
95
-			}
96
-			$qs[0] = implode('/', $url);
97
-			$url = implode('?', $qs);
98
-		}
99
-	}
80
+    // si on est en train d'assembler la page principale,
81
+    // recuperer l'url depuis les globales url propres si fournies
82
+    // sinon extraire la bonne portion d'url
83
+    if ($assembler) {
84
+        if (isset($_SERVER['REDIRECT_url_propre'])) {
85
+            $url = $_SERVER['REDIRECT_url_propre'];
86
+        } elseif (isset($_ENV['url_propre'])) {
87
+            $url = $_ENV['url_propre'];
88
+        } else {
89
+            $qs = explode('?', $url);
90
+            // ne prendre que le segment d'url qui correspond, en fonction de la profondeur calculee
91
+            $url = ltrim($qs[0], '/');
92
+            $url = explode('/', $url);
93
+            while (count($url) > $GLOBALS['profondeur_url'] + 1) {
94
+                array_shift($url);
95
+            }
96
+            $qs[0] = implode('/', $url);
97
+            $url = implode('?', $qs);
98
+        }
99
+    }
100 100
 
101
-	unset($_SERVER['REDIRECT_url_propre']);
102
-	unset($_ENV['url_propre']);
103
-	include_spip('inc/filtres_mini');
104
-	if (!str_contains($url, '://')) {
105
-		$GLOBALS['profondeur_url'] = substr_count(ltrim(resolve_path("/$url"), '/'), '/');
106
-	} else {
107
-		$GLOBALS['profondeur_url'] = max(0, substr_count($url, '/') - substr_count($current_base, '/'));
108
-	}
101
+    unset($_SERVER['REDIRECT_url_propre']);
102
+    unset($_ENV['url_propre']);
103
+    include_spip('inc/filtres_mini');
104
+    if (!str_contains($url, '://')) {
105
+        $GLOBALS['profondeur_url'] = substr_count(ltrim(resolve_path("/$url"), '/'), '/');
106
+    } else {
107
+        $GLOBALS['profondeur_url'] = max(0, substr_count($url, '/') - substr_count($current_base, '/'));
108
+    }
109 109
 
110
-	$url_redirect = '';
111
-	$decoder = charger_fonction_url('decoder');
112
-	if ($decoder) {
113
-		$a = $decoder($url, $fond, $contexte);
114
-		if (is_array($a)) {
115
-			[$ncontexte, $type, $url_redirect, $nfond] = array_pad($a, 4, null);
116
-			$url_redirect ??= '';
117
-			if ($url_redirect === $url) {
118
-				$url_redirect = '';
119
-			} // securite pour eviter une redirection infinie
120
-			if ($assembler && strlen($url_redirect)) {
121
-				spip_logger()->info("Redirige $url vers $url_redirect");
122
-				include_spip('inc/headers');
123
-				redirige_par_entete($url_redirect, '', 301);
124
-			}
125
-			if (isset($nfond)) {
126
-				$fond = $nfond;
127
-			} else {
128
-				if (
129
-					$fond == ''
130
-					|| $fond == 'type_urls' /* compat avec htaccess 2.0.0 */
131
-				) {
132
-					$fond = $type;
133
-				}
134
-			}
135
-			if (isset($ncontexte)) {
136
-				$contexte = $ncontexte;
137
-			}
138
-			if (defined('_DEFINIR_CONTEXTE_TYPE') && _DEFINIR_CONTEXTE_TYPE) {
139
-				$contexte['type'] = $type;
140
-			}
141
-			if (!defined('_DEFINIR_CONTEXTE_TYPE_PAGE') || _DEFINIR_CONTEXTE_TYPE_PAGE) {
142
-				$contexte['type-page'] = $type;
143
-			}
144
-		}
145
-	}
110
+    $url_redirect = '';
111
+    $decoder = charger_fonction_url('decoder');
112
+    if ($decoder) {
113
+        $a = $decoder($url, $fond, $contexte);
114
+        if (is_array($a)) {
115
+            [$ncontexte, $type, $url_redirect, $nfond] = array_pad($a, 4, null);
116
+            $url_redirect ??= '';
117
+            if ($url_redirect === $url) {
118
+                $url_redirect = '';
119
+            } // securite pour eviter une redirection infinie
120
+            if ($assembler && strlen($url_redirect)) {
121
+                spip_logger()->info("Redirige $url vers $url_redirect");
122
+                include_spip('inc/headers');
123
+                redirige_par_entete($url_redirect, '', 301);
124
+            }
125
+            if (isset($nfond)) {
126
+                $fond = $nfond;
127
+            } else {
128
+                if (
129
+                    $fond == ''
130
+                    || $fond == 'type_urls' /* compat avec htaccess 2.0.0 */
131
+                ) {
132
+                    $fond = $type;
133
+                }
134
+            }
135
+            if (isset($ncontexte)) {
136
+                $contexte = $ncontexte;
137
+            }
138
+            if (defined('_DEFINIR_CONTEXTE_TYPE') && _DEFINIR_CONTEXTE_TYPE) {
139
+                $contexte['type'] = $type;
140
+            }
141
+            if (!defined('_DEFINIR_CONTEXTE_TYPE_PAGE') || _DEFINIR_CONTEXTE_TYPE_PAGE) {
142
+                $contexte['type-page'] = $type;
143
+            }
144
+        }
145
+    }
146 146
 
147
-	// retablir les globales
148
-	[$GLOBALS['fond'], $GLOBALS['contexte'], $_SERVER['REDIRECT_url_propre'], $_ENV['url_propre'], $GLOBALS['profondeur_url']] = $save;
147
+    // retablir les globales
148
+    [$GLOBALS['fond'], $GLOBALS['contexte'], $_SERVER['REDIRECT_url_propre'], $_ENV['url_propre'], $GLOBALS['profondeur_url']] = $save;
149 149
 
150
-	// vider les globales url propres qui ne doivent plus etre utilisees en cas
151
-	// d'inversion url => objet
152
-	// maintenir pour compat ?
153
-	#if ($assembler) {
154
-	#	unset($_SERVER['REDIRECT_url_propre']);
155
-	#	unset($_ENV['url_propre']);
156
-	#}
150
+    // vider les globales url propres qui ne doivent plus etre utilisees en cas
151
+    // d'inversion url => objet
152
+    // maintenir pour compat ?
153
+    #if ($assembler) {
154
+    #	unset($_SERVER['REDIRECT_url_propre']);
155
+    #	unset($_ENV['url_propre']);
156
+    #}
157 157
 
158
-	return [$fond, $contexte, $url_redirect];
158
+    return [$fond, $contexte, $url_redirect];
159 159
 }
160 160
 
161 161
 /**
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
  * le mode 'urls-propres' vers les modes 'urls-standard' et 'url-html'
164 164
  */
165 165
 function urls_transition_retrouver_anciennes_url_propres(string $url_propre, string $entite, array $contexte = []): array {
166
-	if ($url_propre) {
167
-		if ($GLOBALS['profondeur_url'] <= 0) {
168
-			$urls_anciennes = charger_fonction_url('decoder', 'propres');
169
-		} else {
170
-			$urls_anciennes = charger_fonction_url('decoder', 'arbo');
171
-		}
166
+    if ($url_propre) {
167
+        if ($GLOBALS['profondeur_url'] <= 0) {
168
+            $urls_anciennes = charger_fonction_url('decoder', 'propres');
169
+        } else {
170
+            $urls_anciennes = charger_fonction_url('decoder', 'arbo');
171
+        }
172 172
 
173
-		if ($urls_anciennes) {
174
-			$urls_anciennes = $urls_anciennes($url_propre, $entite, $contexte);
175
-		}
176
-		return $urls_anciennes ?: [];
177
-	}
173
+        if ($urls_anciennes) {
174
+            $urls_anciennes = $urls_anciennes($url_propre, $entite, $contexte);
175
+        }
176
+        return $urls_anciennes ?: [];
177
+    }
178 178
 
179
-	return [];
179
+    return [];
180 180
 }
181 181
 
182 182
 /**
@@ -184,41 +184,41 @@  discard block
 block discarded – undo
184 184
  * le mode 'urls-html/standard' vers les modes 'urls propres|arbos'
185 185
  */
186 186
 function urls_transition_retrouver_anciennes_url_html(string $url, string $entite, array $contexte = []): array {
187
-	// Migration depuis anciennes URLs ?
188
-	// traiter les injections domain.tld/spip.php/n/importe/quoi/rubrique23
189
-	if (
190
-		$url
191
-		&& $GLOBALS['profondeur_url'] <= 0
192
-	) {
193
-		$r = nettoyer_url_page($url, $contexte);
194
-		if ($r) {
195
-			[$contexte, $type, , , $suite] = $r;
196
-			$_id = id_table_objet($type);
197
-			$id_objet = $contexte[$_id];
198
-			$url_propre = generer_objet_url($id_objet, $type);
199
-			if (
200
-				strlen($url_propre)
201
-				&& !strstr($url, (string) $url_propre)
202
-				&& (
203
-					objet_test_si_publie($type, $id_objet)
204
-					|| defined('_VAR_PREVIEW') && _VAR_PREVIEW && autoriser('voir', $type, $id_objet)
205
-				)
206
-			) {
207
-				[, $hash] = array_pad(explode('#', $url_propre), 2, '');
208
-				$args = [];
209
-				foreach (array_filter(explode('&', $suite ?? '')) as $fragment) {
210
-					if ($fragment != "$_id=$id_objet") {
211
-						$args[] = $fragment;
212
-					}
213
-				}
214
-				$url_redirect = generer_objet_url($id_objet, $type, join('&', array_filter($args)), $hash);
187
+    // Migration depuis anciennes URLs ?
188
+    // traiter les injections domain.tld/spip.php/n/importe/quoi/rubrique23
189
+    if (
190
+        $url
191
+        && $GLOBALS['profondeur_url'] <= 0
192
+    ) {
193
+        $r = nettoyer_url_page($url, $contexte);
194
+        if ($r) {
195
+            [$contexte, $type, , , $suite] = $r;
196
+            $_id = id_table_objet($type);
197
+            $id_objet = $contexte[$_id];
198
+            $url_propre = generer_objet_url($id_objet, $type);
199
+            if (
200
+                strlen($url_propre)
201
+                && !strstr($url, (string) $url_propre)
202
+                && (
203
+                    objet_test_si_publie($type, $id_objet)
204
+                    || defined('_VAR_PREVIEW') && _VAR_PREVIEW && autoriser('voir', $type, $id_objet)
205
+                )
206
+            ) {
207
+                [, $hash] = array_pad(explode('#', $url_propre), 2, '');
208
+                $args = [];
209
+                foreach (array_filter(explode('&', $suite ?? '')) as $fragment) {
210
+                    if ($fragment != "$_id=$id_objet") {
211
+                        $args[] = $fragment;
212
+                    }
213
+                }
214
+                $url_redirect = generer_objet_url($id_objet, $type, join('&', array_filter($args)), $hash);
215 215
 
216
-				return [$contexte, $type, $url_redirect, $type];
217
-			}
218
-		}
219
-	}
220
-	/* Fin compatibilite anciennes urls */
221
-	return [];
216
+                return [$contexte, $type, $url_redirect, $type];
217
+            }
218
+        }
219
+    }
220
+    /* Fin compatibilite anciennes urls */
221
+    return [];
222 222
 }
223 223
 
224 224
 /**
@@ -231,24 +231,24 @@  discard block
 block discarded – undo
231 231
  * @return string|array
232 232
  */
233 233
 function urls_liste_objets($preg = true) {
234
-	static $url_objets = null;
235
-	if (is_null($url_objets)) {
236
-		$url_objets = [];
237
-		// recuperer les tables_objets_sql declarees
238
-		$tables_objets = lister_tables_objets_sql();
239
-		foreach ($tables_objets as $t => $infos) {
240
-			if ($infos['page']) {
241
-				$url_objets[] = $infos['type'];
242
-				$url_objets = array_merge($url_objets, $infos['type_surnoms']);
243
-			}
244
-		}
245
-		$url_objets = pipeline('declarer_url_objets', $url_objets);
246
-	}
247
-	if (!$preg) {
248
-		return $url_objets;
249
-	}
234
+    static $url_objets = null;
235
+    if (is_null($url_objets)) {
236
+        $url_objets = [];
237
+        // recuperer les tables_objets_sql declarees
238
+        $tables_objets = lister_tables_objets_sql();
239
+        foreach ($tables_objets as $t => $infos) {
240
+            if ($infos['page']) {
241
+                $url_objets[] = $infos['type'];
242
+                $url_objets = array_merge($url_objets, $infos['type_surnoms']);
243
+            }
244
+        }
245
+        $url_objets = pipeline('declarer_url_objets', $url_objets);
246
+    }
247
+    if (!$preg) {
248
+        return $url_objets;
249
+    }
250 250
 
251
-	return implode('|', array_map('preg_quote', $url_objets));
251
+    return implode('|', array_map('preg_quote', $url_objets));
252 252
 }
253 253
 
254 254
 /**
@@ -262,26 +262,26 @@  discard block
 block discarded – undo
262 262
  * @return array
263 263
  */
264 264
 function nettoyer_url_page($url, $contexte = []) {
265
-	$url_objets = urls_liste_objets();
266
-	$raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
267
-	$raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
-	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
265
+    $url_objets = urls_liste_objets();
266
+    $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
267
+    $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
+    $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
269 269
 
270
-	if (
271
-		preg_match($raccourci_url_page_html, $url, $regs)
272
-		|| preg_match($raccourci_url_page_id, $url, $regs)
273
-		|| preg_match($raccourci_url_page_spip, $url, $regs)
274
-	) {
275
-		$regs = array_pad($regs, 4, null);
276
-		$type = objet_type($regs[1]);
277
-		$_id = id_table_objet($type);
278
-		$contexte[$_id] = $regs[2];
279
-		$suite = $regs[3];
270
+    if (
271
+        preg_match($raccourci_url_page_html, $url, $regs)
272
+        || preg_match($raccourci_url_page_id, $url, $regs)
273
+        || preg_match($raccourci_url_page_spip, $url, $regs)
274
+    ) {
275
+        $regs = array_pad($regs, 4, null);
276
+        $type = objet_type($regs[1]);
277
+        $_id = id_table_objet($type);
278
+        $contexte[$_id] = $regs[2];
279
+        $suite = $regs[3];
280 280
 
281
-		return [$contexte, $type, null, $type, $suite];
282
-	}
281
+        return [$contexte, $type, null, $type, $suite];
282
+    }
283 283
 
284
-	return [];
284
+    return [];
285 285
 }
286 286
 
287 287
 /**
@@ -299,35 +299,35 @@  discard block
 block discarded – undo
299 299
  * @return string
300 300
  */
301 301
 function generer_objet_url_ecrire($id, string $objet, string $args = '', string $ancre = '', ?bool $public = null, string $connect = ''): string {
302
-	static $furls = [];
303
-	$id = intval($id);
304
-	if (!isset($furls[$objet])) {
305
-		if (
306
-			function_exists($f = 'generer_' . $objet . '_url_ecrire')
307
-			|| ($f = charger_fonction($f, 'urls', true))
308
-			|| function_exists($f = 'generer_url_ecrire_' . $objet) // deprecated
309
-			|| ($f = charger_fonction($f, 'urls', true)) // deprecated
310
-		) {
311
-			$furls[$objet] = $f;
312
-		} else {
313
-			$furls[$objet] = '';
314
-		}
315
-	}
316
-	if ($furls[$objet]) {
317
-		return $furls[$objet]($id, $args, $ancre, $public, $connect);
318
-	}
319
-	// si pas de flag public fourni
320
-	// le calculer en fonction de la declaration de statut
321
-	if (is_null($public) && !$connect) {
322
-		$public = objet_test_si_publie($objet, $id, $connect);
323
-	}
324
-	if ($public || $connect) {
325
-		return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect);
326
-	}
327
-	$a = id_table_objet($objet) . '=' . intval($id);
328
-	if (!function_exists('objet_info')) {
329
-		include_spip('inc/filtres');
330
-	}
302
+    static $furls = [];
303
+    $id = intval($id);
304
+    if (!isset($furls[$objet])) {
305
+        if (
306
+            function_exists($f = 'generer_' . $objet . '_url_ecrire')
307
+            || ($f = charger_fonction($f, 'urls', true))
308
+            || function_exists($f = 'generer_url_ecrire_' . $objet) // deprecated
309
+            || ($f = charger_fonction($f, 'urls', true)) // deprecated
310
+        ) {
311
+            $furls[$objet] = $f;
312
+        } else {
313
+            $furls[$objet] = '';
314
+        }
315
+    }
316
+    if ($furls[$objet]) {
317
+        return $furls[$objet]($id, $args, $ancre, $public, $connect);
318
+    }
319
+    // si pas de flag public fourni
320
+    // le calculer en fonction de la declaration de statut
321
+    if (is_null($public) && !$connect) {
322
+        $public = objet_test_si_publie($objet, $id, $connect);
323
+    }
324
+    if ($public || $connect) {
325
+        return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect);
326
+    }
327
+    $a = id_table_objet($objet) . '=' . intval($id);
328
+    if (!function_exists('objet_info')) {
329
+        include_spip('inc/filtres');
330
+    }
331 331
 
332
-	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
332
+    return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
333 333
 }
Please login to merge, or discard this patch.