Completed
Push — master ( 1fe7c3...e997e0 )
by cam
02:01
created
prive/formulaires/configurer_articles.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -11,65 +11,65 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_articles_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'articles_surtitre',
22
-			'articles_soustitre',
23
-			'articles_descriptif',
24
-			'articles_chapeau',
25
-			'articles_texte',
26
-			'articles_ps',
27
-			'articles_redac',
28
-			'articles_urlref',
29
-			'post_dates',
30
-			'articles_redirection',
31
-		] as $m
32
-	) {
33
-		$valeurs[$m] = $GLOBALS['meta'][$m];
34
-	}
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'articles_surtitre',
22
+            'articles_soustitre',
23
+            'articles_descriptif',
24
+            'articles_chapeau',
25
+            'articles_texte',
26
+            'articles_ps',
27
+            'articles_redac',
28
+            'articles_urlref',
29
+            'post_dates',
30
+            'articles_redirection',
31
+        ] as $m
32
+    ) {
33
+        $valeurs[$m] = $GLOBALS['meta'][$m];
34
+    }
35 35
 
36
-	return $valeurs;
36
+    return $valeurs;
37 37
 }
38 38
 
39 39
 
40 40
 function formulaires_configurer_articles_traiter_dist() {
41
-	$res = ['editable' => true];
42
-	$purger_skel = false;
43
-	// Purger les squelettes si un changement de meta les affecte
44
-	if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) {
45
-		$purger_skel = true;
46
-	}
41
+    $res = ['editable' => true];
42
+    $purger_skel = false;
43
+    // Purger les squelettes si un changement de meta les affecte
44
+    if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) {
45
+        $purger_skel = true;
46
+    }
47 47
 
48
-	foreach (
49
-		[
50
-			'articles_surtitre',
51
-			'articles_soustitre',
52
-			'articles_descriptif',
53
-			'articles_chapeau',
54
-			'articles_texte',
55
-			'articles_ps',
56
-			'articles_redac',
57
-			'articles_urlref',
58
-			'post_dates',
59
-			'articles_redirection',
60
-		] as $m
61
-	) {
62
-		if (!is_null($v = _request($m))) {
63
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
64
-		}
65
-	}
48
+    foreach (
49
+        [
50
+            'articles_surtitre',
51
+            'articles_soustitre',
52
+            'articles_descriptif',
53
+            'articles_chapeau',
54
+            'articles_texte',
55
+            'articles_ps',
56
+            'articles_redac',
57
+            'articles_urlref',
58
+            'post_dates',
59
+            'articles_redirection',
60
+        ] as $m
61
+    ) {
62
+        if (!is_null($v = _request($m))) {
63
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
64
+        }
65
+    }
66 66
 
67
-	if ($purger_skel) {
68
-		include_spip('inc/invalideur');
69
-		purger_repertoire(_DIR_SKELS);
70
-	}
67
+    if ($purger_skel) {
68
+        include_spip('inc/invalideur');
69
+        purger_repertoire(_DIR_SKELS);
70
+    }
71 71
 
72
-	$res['message_ok'] = _T('config_info_enregistree');
72
+    $res['message_ok'] = _T('config_info_enregistree');
73 73
 
74
-	return $res;
74
+    return $res;
75 75
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_annonces.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -11,93 +11,93 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_annonces_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'suivi_edito',
22
-			'adresse_suivi',
23
-			'adresse_suivi_inscription',
24
-			'quoi_de_neuf',
25
-			'adresse_neuf',
26
-			'jours_neuf',
27
-			'email_envoi',
28
-		] as $m
29
-	) {
30
-		$valeurs[$m] = $GLOBALS['meta'][$m];
31
-	}
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'suivi_edito',
22
+            'adresse_suivi',
23
+            'adresse_suivi_inscription',
24
+            'quoi_de_neuf',
25
+            'adresse_neuf',
26
+            'jours_neuf',
27
+            'email_envoi',
28
+        ] as $m
29
+    ) {
30
+        $valeurs[$m] = $GLOBALS['meta'][$m];
31
+    }
32 32
 
33
-	return $valeurs;
33
+    return $valeurs;
34 34
 }
35 35
 
36 36
 function formulaires_configurer_annonces_verifier_dist() {
37
-	$erreurs = [];
38
-	if (_request('suivi_edito') == 'oui') {
39
-		if (!$email = _request('adresse_suivi')) {
40
-			$erreurs['adresse_suivi'] = _T('info_obligatoire');
41
-		} else {
42
-			include_spip('inc/filtres');
43
-			if (!email_valide($email)) {
44
-				$erreurs['adresse_suivi'] = _T('form_prop_indiquer_email');
45
-			}
46
-		}
47
-	}
48
-	if (_request('quoi_de_neuf') == 'oui') {
49
-		if (!$email = _request('adresse_neuf')) {
50
-			$erreurs['adresse_neuf'] = _T('info_obligatoire');
51
-		} else {
52
-			include_spip('inc/filtres');
53
-			if (!email_valide($email)) {
54
-				$erreurs['adresse_neuf'] = _T('form_prop_indiquer_email');
55
-			}
56
-		}
57
-		if (!$email = _request('jours_neuf')) {
58
-			$erreurs['jours_neuf'] = _T('info_obligatoire');
59
-		}
60
-	}
37
+    $erreurs = [];
38
+    if (_request('suivi_edito') == 'oui') {
39
+        if (!$email = _request('adresse_suivi')) {
40
+            $erreurs['adresse_suivi'] = _T('info_obligatoire');
41
+        } else {
42
+            include_spip('inc/filtres');
43
+            if (!email_valide($email)) {
44
+                $erreurs['adresse_suivi'] = _T('form_prop_indiquer_email');
45
+            }
46
+        }
47
+    }
48
+    if (_request('quoi_de_neuf') == 'oui') {
49
+        if (!$email = _request('adresse_neuf')) {
50
+            $erreurs['adresse_neuf'] = _T('info_obligatoire');
51
+        } else {
52
+            include_spip('inc/filtres');
53
+            if (!email_valide($email)) {
54
+                $erreurs['adresse_neuf'] = _T('form_prop_indiquer_email');
55
+            }
56
+        }
57
+        if (!$email = _request('jours_neuf')) {
58
+            $erreurs['jours_neuf'] = _T('info_obligatoire');
59
+        }
60
+    }
61 61
 
62
-	return $erreurs;
62
+    return $erreurs;
63 63
 }
64 64
 
65 65
 function formulaires_configurer_annonces_traiter_dist() {
66
-	$res = ['editable' => true];
67
-	foreach (
68
-		[
69
-			'suivi_edito',
70
-			'quoi_de_neuf',
71
-		] as $m
72
-	) {
73
-		if (!is_null($v = _request($m))) {
74
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
75
-		}
76
-	}
66
+    $res = ['editable' => true];
67
+    foreach (
68
+        [
69
+            'suivi_edito',
70
+            'quoi_de_neuf',
71
+        ] as $m
72
+    ) {
73
+        if (!is_null($v = _request($m))) {
74
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
75
+        }
76
+    }
77 77
 
78
-	foreach (
79
-		[
80
-			'adresse_suivi',
81
-			'adresse_suivi_inscription',
82
-			'adresse_neuf',
83
-			'jours_neuf',
84
-			'email_envoi',
85
-		] as $m
86
-	) {
87
-		if (!is_null($v = _request($m))) {
88
-			ecrire_meta($m, $v);
89
-		}
90
-	}
78
+    foreach (
79
+        [
80
+            'adresse_suivi',
81
+            'adresse_suivi_inscription',
82
+            'adresse_neuf',
83
+            'jours_neuf',
84
+            'email_envoi',
85
+        ] as $m
86
+    ) {
87
+        if (!is_null($v = _request($m))) {
88
+            ecrire_meta($m, $v);
89
+        }
90
+    }
91 91
 
92
-	$res['message_ok'] = _T('config_info_enregistree');
93
-	// provoquer l'envoi des nouveautes en supprimant le fichier lock
94
-	if (_request('envoi_now')) {
95
-		effacer_meta('dernier_envoi_neuf');
96
-		$id_job = job_queue_add('mail', 'Test Envoi des nouveautes', [0], 'genie/');
97
-		include_spip('inc/queue');
98
-		queue_schedule([$id_job]);
99
-		$res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee');
100
-	}
92
+    $res['message_ok'] = _T('config_info_enregistree');
93
+    // provoquer l'envoi des nouveautes en supprimant le fichier lock
94
+    if (_request('envoi_now')) {
95
+        effacer_meta('dernier_envoi_neuf');
96
+        $id_job = job_queue_add('mail', 'Test Envoi des nouveautes', [0], 'genie/');
97
+        include_spip('inc/queue');
98
+        queue_schedule([$id_job]);
99
+        $res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee');
100
+    }
101 101
 
102
-	return $res;
102
+    return $res;
103 103
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_avertisseur.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,37 +11,37 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 include_spip('inc/presentation');
17 17
 
18 18
 function formulaires_configurer_avertisseur_charger_dist() {
19
-	$valeurs = [];
20
-	foreach (
21
-		[
22
-			'articles_modif',
23
-		] as $m
24
-	) {
25
-		$valeurs[$m] = $GLOBALS['meta'][$m];
26
-	}
27
-
28
-	return $valeurs;
19
+    $valeurs = [];
20
+    foreach (
21
+        [
22
+            'articles_modif',
23
+        ] as $m
24
+    ) {
25
+        $valeurs[$m] = $GLOBALS['meta'][$m];
26
+    }
27
+
28
+    return $valeurs;
29 29
 }
30 30
 
31 31
 
32 32
 function formulaires_configurer_avertisseur_traiter_dist() {
33
-	$res = ['editable' => true];
34
-	foreach (
35
-		[
36
-			'articles_modif',
37
-		] as $m
38
-	) {
39
-		if (!is_null($v = _request($m))) {
40
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
41
-		}
42
-	}
43
-
44
-	$res['message_ok'] = _T('config_info_enregistree');
45
-
46
-	return $res;
33
+    $res = ['editable' => true];
34
+    foreach (
35
+        [
36
+            'articles_modif',
37
+        ] as $m
38
+    ) {
39
+        if (!is_null($v = _request($m))) {
40
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
41
+        }
42
+    }
43
+
44
+    $res['message_ok'] = _T('config_info_enregistree');
45
+
46
+    return $res;
47 47
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_visiteurs.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,51 +11,51 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 include_spip('inc/presentation');
17 17
 
18 18
 function formulaires_configurer_visiteurs_charger_dist() {
19
-	$valeurs = [];
20
-	if (avoir_visiteurs(false, false)) {
21
-		$valeurs['editable'] = false;
22
-	}
23
-
24
-	foreach (
25
-		[
26
-			'accepter_visiteurs'
27
-		] as $m
28
-	) {
29
-		$valeurs[$m] = $GLOBALS['meta'][$m];
30
-	}
31
-
32
-	return $valeurs;
19
+    $valeurs = [];
20
+    if (avoir_visiteurs(false, false)) {
21
+        $valeurs['editable'] = false;
22
+    }
23
+
24
+    foreach (
25
+        [
26
+            'accepter_visiteurs'
27
+        ] as $m
28
+    ) {
29
+        $valeurs[$m] = $GLOBALS['meta'][$m];
30
+    }
31
+
32
+    return $valeurs;
33 33
 }
34 34
 
35 35
 
36 36
 function formulaires_configurer_visiteurs_traiter_dist() {
37
-	$res = ['editable' => true];
38
-	// Modification du reglage accepter_inscriptions => vider le cache
39
-	// (pour repercuter la modif sur le panneau de login)
40
-	if (
41
-		($i = _request('accepter_visiteurs')
42
-		and $i != $GLOBALS['meta']['accepter_visiteurs'])
43
-	) {
44
-		include_spip('inc/invalideur');
45
-		suivre_invalideur('1'); # tout effacer
46
-	}
47
-
48
-	foreach (
49
-		[
50
-			'accepter_visiteurs',
51
-		] as $m
52
-	) {
53
-		if (!is_null($v = _request($m))) {
54
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
55
-		}
56
-	}
57
-
58
-	$res['message_ok'] = _T('config_info_enregistree');
59
-
60
-	return $res;
37
+    $res = ['editable' => true];
38
+    // Modification du reglage accepter_inscriptions => vider le cache
39
+    // (pour repercuter la modif sur le panneau de login)
40
+    if (
41
+        ($i = _request('accepter_visiteurs')
42
+        and $i != $GLOBALS['meta']['accepter_visiteurs'])
43
+    ) {
44
+        include_spip('inc/invalideur');
45
+        suivre_invalideur('1'); # tout effacer
46
+    }
47
+
48
+    foreach (
49
+        [
50
+            'accepter_visiteurs',
51
+        ] as $m
52
+    ) {
53
+        if (!is_null($v = _request($m))) {
54
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
55
+        }
56
+    }
57
+
58
+    $res['message_ok'] = _T('config_info_enregistree');
59
+
60
+    return $res;
61 61
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_rubriques.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_rubriques_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'rubriques_descriptif',
22
-			'rubriques_texte'
23
-		] as $m
24
-	) {
25
-		$valeurs[$m] = $GLOBALS['meta'][$m];
26
-	}
27
-
28
-	return $valeurs;
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'rubriques_descriptif',
22
+            'rubriques_texte'
23
+        ] as $m
24
+    ) {
25
+        $valeurs[$m] = $GLOBALS['meta'][$m];
26
+    }
27
+
28
+    return $valeurs;
29 29
 }
30 30
 
31 31
 
32 32
 function formulaires_configurer_rubriques_traiter_dist() {
33
-	$res = ['editable' => true];
34
-	foreach (
35
-		[
36
-			'rubriques_descriptif',
37
-			'rubriques_texte'
38
-		] as $m
39
-	) {
40
-		if (!is_null($v = _request($m))) {
41
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
42
-		}
43
-	}
44
-
45
-	$res['message_ok'] = _T('config_info_enregistree');
46
-
47
-	return $res;
33
+    $res = ['editable' => true];
34
+    foreach (
35
+        [
36
+            'rubriques_descriptif',
37
+            'rubriques_texte'
38
+        ] as $m
39
+    ) {
40
+        if (!is_null($v = _request($m))) {
41
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
42
+        }
43
+    }
44
+
45
+    $res['message_ok'] = _T('config_info_enregistree');
46
+
47
+    return $res;
48 48
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_flux.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,36 +11,36 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_flux_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'syndication_integrale'
22
-		] as $m
23
-	) {
24
-		$valeurs[$m] = $GLOBALS['meta'][$m];
25
-	}
26
-
27
-	return $valeurs;
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'syndication_integrale'
22
+        ] as $m
23
+    ) {
24
+        $valeurs[$m] = $GLOBALS['meta'][$m];
25
+    }
26
+
27
+    return $valeurs;
28 28
 }
29 29
 
30 30
 
31 31
 function formulaires_configurer_flux_traiter_dist() {
32
-	$res = ['editable' => true];
33
-	foreach (
34
-		[
35
-			'syndication_integrale',
36
-		] as $m
37
-	) {
38
-		if (!is_null($v = _request($m))) {
39
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
40
-		}
41
-	}
42
-
43
-	$res['message_ok'] = _T('config_info_enregistree');
44
-
45
-	return $res;
32
+    $res = ['editable' => true];
33
+    foreach (
34
+        [
35
+            'syndication_integrale',
36
+        ] as $m
37
+    ) {
38
+        if (!is_null($v = _request($m))) {
39
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
40
+        }
41
+    }
42
+
43
+    $res['message_ok'] = _T('config_info_enregistree');
44
+
45
+    return $res;
46 46
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_logos.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_logos_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'activer_logos',
22
-			'activer_logos_survol'
23
-		] as $m
24
-	) {
25
-		$valeurs[$m] = $GLOBALS['meta'][$m];
26
-	}
27
-
28
-	return $valeurs;
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'activer_logos',
22
+            'activer_logos_survol'
23
+        ] as $m
24
+    ) {
25
+        $valeurs[$m] = $GLOBALS['meta'][$m];
26
+    }
27
+
28
+    return $valeurs;
29 29
 }
30 30
 
31 31
 
32 32
 function formulaires_configurer_logos_traiter_dist() {
33
-	$res = ['editable' => true];
34
-	foreach (
35
-		[
36
-			'activer_logos',
37
-			'activer_logos_survol',
38
-		] as $m
39
-	) {
40
-		if (!is_null($v = _request($m))) {
41
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
42
-		}
43
-	}
44
-
45
-	$res['message_ok'] = _T('config_info_enregistree');
46
-
47
-	return $res;
33
+    $res = ['editable' => true];
34
+    foreach (
35
+        [
36
+            'activer_logos',
37
+            'activer_logos_survol',
38
+        ] as $m
39
+    ) {
40
+        if (!is_null($v = _request($m))) {
41
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
42
+        }
43
+    }
44
+
45
+    $res['message_ok'] = _T('config_info_enregistree');
46
+
47
+    return $res;
48 48
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_redacteurs.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,46 +11,46 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_redacteurs_charger_dist() {
18
-	$valeurs = [];
19
-	foreach (
20
-		[
21
-			'accepter_inscriptions',
22
-		] as $m
23
-	) {
24
-		$valeurs[$m] = $GLOBALS['meta'][$m];
25
-	}
26
-
27
-	return $valeurs;
18
+    $valeurs = [];
19
+    foreach (
20
+        [
21
+            'accepter_inscriptions',
22
+        ] as $m
23
+    ) {
24
+        $valeurs[$m] = $GLOBALS['meta'][$m];
25
+    }
26
+
27
+    return $valeurs;
28 28
 }
29 29
 
30 30
 
31 31
 function formulaires_configurer_redacteurs_traiter_dist() {
32
-	$res = ['editable' => true];
33
-	// Modification du reglage accepter_inscriptions => vider le cache
34
-	// (pour repercuter la modif sur le panneau de login)
35
-	if (
36
-		($i = _request('accepter_inscriptions')
37
-		and $i != $GLOBALS['meta']['accepter_inscriptions'])
38
-	) {
39
-		include_spip('inc/invalideur');
40
-		suivre_invalideur('1'); # tout effacer
41
-	}
42
-
43
-	foreach (
44
-		[
45
-			'accepter_inscriptions',
46
-		] as $m
47
-	) {
48
-		if (!is_null($v = _request($m))) {
49
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
50
-		}
51
-	}
52
-
53
-	$res['message_ok'] = _T('config_info_enregistree');
54
-
55
-	return $res;
32
+    $res = ['editable' => true];
33
+    // Modification du reglage accepter_inscriptions => vider le cache
34
+    // (pour repercuter la modif sur le panneau de login)
35
+    if (
36
+        ($i = _request('accepter_inscriptions')
37
+        and $i != $GLOBALS['meta']['accepter_inscriptions'])
38
+    ) {
39
+        include_spip('inc/invalideur');
40
+        suivre_invalideur('1'); # tout effacer
41
+    }
42
+
43
+    foreach (
44
+        [
45
+            'accepter_inscriptions',
46
+        ] as $m
47
+    ) {
48
+        if (!is_null($v = _request($m))) {
49
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
50
+        }
51
+    }
52
+
53
+    $res['message_ok'] = _T('config_info_enregistree');
54
+
55
+    return $res;
56 56
 }
Please login to merge, or discard this patch.
ecrire/exec/rechercher.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  **/
20 20
 
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 include_spip('inc/actions');
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
  * @uses ajax_retour()
33 33
  **/
34 34
 function exec_rechercher_dist() {
35
-	$id = intval(_request('id'));
36
-	$exclus = intval(_request('exclus'));
37
-	$rac = spip_htmlentities(_request('rac'));
38
-	$type = _request('type');
39
-	$do = _request('do');
40
-	if (preg_match('/^\w*$/', $do)) {
41
-		$r = exec_rechercher_args($id, $type, $exclus, $rac, $do);
42
-	} else {
43
-		$r = '';
44
-	}
45
-	ajax_retour($r);
35
+    $id = intval(_request('id'));
36
+    $exclus = intval(_request('exclus'));
37
+    $rac = spip_htmlentities(_request('rac'));
38
+    $type = _request('type');
39
+    $do = _request('do');
40
+    if (preg_match('/^\w*$/', $do)) {
41
+        $r = exec_rechercher_args($id, $type, $exclus, $rac, $do);
42
+    } else {
43
+        $r = '';
44
+    }
45
+    ajax_retour($r);
46 46
 }
47 47
 
48 48
 /**
@@ -59,61 +59,61 @@  discard block
 block discarded – undo
59 59
  * @return string
60 60
  **/
61 61
 function exec_rechercher_args($id, $type, $exclus, $rac, $do) {
62
-	if (!$do) {
63
-		$do = 'aff';
64
-	}
65
-
66
-	$points = $rub = [];
67
-
68
-	$where = preg_split(',\s+,', $type);
69
-	if ($where) {
70
-		foreach ($where as $k => $v) {
71
-			$where[$k] = "'%" . substr(str_replace('%', '\%', sql_quote($v, '', 'string')), 1, -1) . "%'";
72
-		}
73
-		$where_titre = ('(titre LIKE ' . join(' AND titre LIKE ', $where) . ')');
74
-		$where_desc = ('(descriptif LIKE ' . join(' AND descriptif LIKE ', $where) . ')');
75
-		$where_id = ('(id_rubrique = ' . intval($type) . ')');
76
-
77
-		if ($exclus) {
78
-			include_spip('inc/rubriques');
79
-			$where_exclus = ' AND ' . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT');
80
-		} else {
81
-			$where_exclus = '';
82
-		}
83
-
84
-		foreach (
85
-			[
86
-				3 => $where_titre,
87
-				2 => $where_desc,
88
-				1 => $where_id,
89
-			] as $point => $recherche
90
-		) {
91
-			$res = sql_select('id_rubrique, id_parent, titre', 'spip_rubriques', "$recherche$where_exclus");
92
-			while ($row = sql_fetch($res)) {
93
-				$id_rubrique = $row['id_rubrique'];
94
-				if (!isset($rub[$id_rubrique])) {
95
-					$rub[$id_rubrique] = [];
96
-				}
97
-				$rub[$id_rubrique]['titre'] = typo($row['titre']);
98
-				$rub[$id_rubrique]['id_parent'] = $row['id_parent'];
99
-				if (!isset($points[$id_rubrique])) {
100
-					$points[$id_rubrique] = 0;
101
-				}
102
-				$points[$id_rubrique] = $points[$id_rubrique] + $point;
103
-			}
104
-		}
105
-	}
106
-
107
-	if ($points) {
108
-		arsort($points);
109
-		$style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'";
110
-		foreach ($rub as $k => $v) {
111
-			$rub[$k]['atts'] = ($v['id_parent'] ? $style : '')
112
-				. " class='petite-rubrique'";
113
-		}
114
-	}
115
-
116
-	return (proposer_item($points, $rub, $rac, $type, $do));
62
+    if (!$do) {
63
+        $do = 'aff';
64
+    }
65
+
66
+    $points = $rub = [];
67
+
68
+    $where = preg_split(',\s+,', $type);
69
+    if ($where) {
70
+        foreach ($where as $k => $v) {
71
+            $where[$k] = "'%" . substr(str_replace('%', '\%', sql_quote($v, '', 'string')), 1, -1) . "%'";
72
+        }
73
+        $where_titre = ('(titre LIKE ' . join(' AND titre LIKE ', $where) . ')');
74
+        $where_desc = ('(descriptif LIKE ' . join(' AND descriptif LIKE ', $where) . ')');
75
+        $where_id = ('(id_rubrique = ' . intval($type) . ')');
76
+
77
+        if ($exclus) {
78
+            include_spip('inc/rubriques');
79
+            $where_exclus = ' AND ' . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT');
80
+        } else {
81
+            $where_exclus = '';
82
+        }
83
+
84
+        foreach (
85
+            [
86
+                3 => $where_titre,
87
+                2 => $where_desc,
88
+                1 => $where_id,
89
+            ] as $point => $recherche
90
+        ) {
91
+            $res = sql_select('id_rubrique, id_parent, titre', 'spip_rubriques', "$recherche$where_exclus");
92
+            while ($row = sql_fetch($res)) {
93
+                $id_rubrique = $row['id_rubrique'];
94
+                if (!isset($rub[$id_rubrique])) {
95
+                    $rub[$id_rubrique] = [];
96
+                }
97
+                $rub[$id_rubrique]['titre'] = typo($row['titre']);
98
+                $rub[$id_rubrique]['id_parent'] = $row['id_parent'];
99
+                if (!isset($points[$id_rubrique])) {
100
+                    $points[$id_rubrique] = 0;
101
+                }
102
+                $points[$id_rubrique] = $points[$id_rubrique] + $point;
103
+            }
104
+        }
105
+    }
106
+
107
+    if ($points) {
108
+        arsort($points);
109
+        $style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'";
110
+        foreach ($rub as $k => $v) {
111
+            $rub[$k]['atts'] = ($v['id_parent'] ? $style : '')
112
+                . " class='petite-rubrique'";
113
+        }
114
+    }
115
+
116
+    return (proposer_item($points, $rub, $rac, $type, $do));
117 117
 }
118 118
 
119 119
 
@@ -136,37 +136,37 @@  discard block
 block discarded – undo
136 136
  **/
137 137
 function proposer_item($ids, $titles, $rac, $type, $do) {
138 138
 
139
-	if (!$ids) {
140
-		return "<br /><br /><div style='padding: 5px; color: red;'><b>"
141
-		. spip_htmlentities($type)
142
-		. '</b> :  ' . _T('avis_aucun_resultat') . '</div>';
143
-	}
144
-
145
-	$ret = '';
146
-	$info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id=");
147
-
148
-	$onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)";
149
-
150
-	$ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');";
151
-
152
-	foreach ($ids as $id => $bof) {
153
-		$titre = strtr(
154
-			str_replace("'", '&#8217;', str_replace('"', '&#34;', textebrut($titles[$id]['titre']))),
155
-			"\n\r",
156
-			'  '
157
-		);
158
-
159
-		$ret .= "<div class='highlight off'\nonclick=\"changerhighlight(this); "
160
-			. $onClick
161
-			. "\"\nondblclick=\""
162
-			. $ondbClick
163
-			. $onClick
164
-			. ' "><div'
165
-			. $titles[$id]['atts']
166
-			. " title='$id'>&nbsp; "
167
-			. $titre
168
-			. '</div></div>';
169
-	}
170
-
171
-	return $ret;
139
+    if (!$ids) {
140
+        return "<br /><br /><div style='padding: 5px; color: red;'><b>"
141
+        . spip_htmlentities($type)
142
+        . '</b> :  ' . _T('avis_aucun_resultat') . '</div>';
143
+    }
144
+
145
+    $ret = '';
146
+    $info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id=");
147
+
148
+    $onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)";
149
+
150
+    $ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');";
151
+
152
+    foreach ($ids as $id => $bof) {
153
+        $titre = strtr(
154
+            str_replace("'", '&#8217;', str_replace('"', '&#34;', textebrut($titles[$id]['titre']))),
155
+            "\n\r",
156
+            '  '
157
+        );
158
+
159
+        $ret .= "<div class='highlight off'\nonclick=\"changerhighlight(this); "
160
+            . $onClick
161
+            . "\"\nondblclick=\""
162
+            . $ondbClick
163
+            . $onClick
164
+            . ' "><div'
165
+            . $titles[$id]['atts']
166
+            . " title='$id'>&nbsp; "
167
+            . $titre
168
+            . '</div></div>';
169
+    }
170
+
171
+    return $ret;
172 172
 }
Please login to merge, or discard this patch.