Completed
Push — master ( 164984...4573fe )
by cam
05:19
created
ecrire/inc/plonger.php 2 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('inc/texte');
@@ -19,98 +19,98 @@  discard block
 block discarded – undo
19 19
 // https://code.spip.net/@inc_plonger_dist
20 20
 function inc_plonger_dist($id_rubrique, $idom = "", $list = array(), $col = 1, $exclu = 0, $do = 'aff') {
21 21
 
22
-	if ($list) {
23
-		$id_rubrique = $list[$col - 1];
24
-	}
22
+    if ($list) {
23
+        $id_rubrique = $list[$col - 1];
24
+    }
25 25
 
26
-	$ret = '';
26
+    $ret = '';
27 27
 
28
-	# recherche les filles et petites-filles de la rubrique donnee
29
-	# en excluant une eventuelle rubrique interdite (par exemple, lorsqu'on
30
-	# deplace une rubrique, on peut la deplacer partout a partir de la
31
-	# racine... sauf vers elle-meme ou sa propre branche)
32
-	$ordre = array();
33
-	$rub = array();
28
+    # recherche les filles et petites-filles de la rubrique donnee
29
+    # en excluant une eventuelle rubrique interdite (par exemple, lorsqu'on
30
+    # deplace une rubrique, on peut la deplacer partout a partir de la
31
+    # racine... sauf vers elle-meme ou sa propre branche)
32
+    $ordre = array();
33
+    $rub = array();
34 34
 
35
-	$res = sql_select("rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant",
36
-		"spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)",
37
-		"rub1.id_parent = " . sql_quote($id_rubrique) . "
35
+    $res = sql_select("rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant",
36
+        "spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)",
37
+        "rub1.id_parent = " . sql_quote($id_rubrique) . "
38 38
 			AND rub1.id_rubrique!=" . sql_quote($exclu) . "
39 39
 			AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=" . sql_quote($exclu) . ")", "", "0+rub1.titre,rub1.titre");
40 40
 
41
-	while ($row = sql_fetch($res)) {
42
-		if (autoriser('voir', 'rubrique', $row['id_rubrique'])) {
43
-			$rub[$row['id_rubrique']]['enfants'] = $row['id_enfant'];
44
-			if ($row['id_parent'] == $id_rubrique) {
45
-				$t = trim(typo(supprimer_numero($row['titre'])));
46
-				if ($row['langue_choisie'] != 'oui') {
47
-					$t .= ' <small title="'
48
-						. traduire_nom_langue($row['lang'])
49
-						. '">[' . $row['lang'] . ']</small>';
50
-				}
51
-				$ordre[$row['id_rubrique']] = $t;
52
-			}
53
-		}
54
-	}
55
-	$next = isset($list[$col]) ? $list[$col] : 0;
56
-	if ($ordre) {
57
-		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1));
58
-		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
59
-		$args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event";
41
+    while ($row = sql_fetch($res)) {
42
+        if (autoriser('voir', 'rubrique', $row['id_rubrique'])) {
43
+            $rub[$row['id_rubrique']]['enfants'] = $row['id_enfant'];
44
+            if ($row['id_parent'] == $id_rubrique) {
45
+                $t = trim(typo(supprimer_numero($row['titre'])));
46
+                if ($row['langue_choisie'] != 'oui') {
47
+                    $t .= ' <small title="'
48
+                        . traduire_nom_langue($row['lang'])
49
+                        . '">[' . $row['lang'] . ']</small>';
50
+                }
51
+                $ordre[$row['id_rubrique']] = $t;
52
+            }
53
+        }
54
+    }
55
+    $next = isset($list[$col]) ? $list[$col] : 0;
56
+    if ($ordre) {
57
+        $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1));
58
+        $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
59
+        $args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event";
60 60
 
61
-		foreach ($ordre as $id => $titrebrut) {
62
-			$titre = supprimer_numero($titrebrut);
61
+        foreach ($ordre as $id => $titrebrut) {
62
+            $titre = supprimer_numero($titrebrut);
63 63
 
64
-			$classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : "petit-secteur");
65
-			if (isset($rub[$id]["enfants"])) {
66
-				$classe2 = " class='rub-ouverte'";
67
-				$url = "\nhref='$rec&amp;id=$id'";
68
-			} else {
69
-				$classe2 = $url = '';
70
-				$url = "\nhref='javascript:void(0)'";
71
-			}
64
+            $classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : "petit-secteur");
65
+            if (isset($rub[$id]["enfants"])) {
66
+                $classe2 = " class='rub-ouverte'";
67
+                $url = "\nhref='$rec&amp;id=$id'";
68
+            } else {
69
+                $classe2 = $url = '';
70
+                $url = "\nhref='javascript:void(0)'";
71
+            }
72 72
 
73
-			$js_func = $do . '_selection_titre';
74
-			$click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn "
75
-				. (!is_array($list) ? ' false'
76
-					: "aff_selection_provisoire($id,$args)")
73
+            $js_func = $do . '_selection_titre';
74
+            $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn "
75
+                . (!is_array($list) ? ' false'
76
+                    : "aff_selection_provisoire($id,$args)")
77 77
 # ce lien provoque la selection (directe) de la rubrique cliquee
78 78
 # et l'affichage de son titre dans le bandeau
79
-				. "\"\nondblclick=\""
80
-				. "$js_func(this."
81
-				. "firstChild.nodeValue,"
82
-				. $id
83
-				. ",'selection_rubrique','id_parent');"
84
-				. "\nreturn aff_selection_provisoire($id,$args);"
85
-				. "\"";
79
+                . "\"\nondblclick=\""
80
+                . "$js_func(this."
81
+                . "firstChild.nodeValue,"
82
+                . $id
83
+                . ",'selection_rubrique','id_parent');"
84
+                . "\nreturn aff_selection_provisoire($id,$args);"
85
+                . "\"";
86 86
 
87
-			$ret .= "<div class='"
88
-				. (($id == $next) ? "item on" : "item")
89
-				. "'><div class='"
90
-				. $classe1
91
-				. "'><div$classe2><a"
92
-				. $url
93
-				. $click
94
-				. ">"
95
-				. $titre
96
-				. "</a></div></div></div>";
97
-		}
98
-	}
87
+            $ret .= "<div class='"
88
+                . (($id == $next) ? "item on" : "item")
89
+                . "'><div class='"
90
+                . $classe1
91
+                . "'><div$classe2><a"
92
+                . $url
93
+                . $click
94
+                . ">"
95
+                . $titre
96
+                . "</a></div></div></div>";
97
+        }
98
+    }
99 99
 
100
-	$idom2 = $idom . "_col_" . ($col + 1);
101
-	$left = ($col * 250);
100
+    $idom2 = $idom . "_col_" . ($col + 1);
101
+    $left = ($col * 250);
102 102
 
103
-	return http_img_pack("loader.svg", "",
104
-		"class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ": "
105
-		. ($left - 30)
106
-		. "px; top: 2px; z-index: 2;' id='img_$idom2'")
107
-	. "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ": "
108
-	. ($left - 250)
109
-	. "px;'>"
110
-	. $ret
111
-	. "\n</div>\n<div id='$idom2'>"
112
-	. ($next
113
-		? inc_plonger_dist($id_rubrique, $idom, $list, $col + 1, $exclu)
114
-		: "")
115
-	. "\n</div>";
103
+    return http_img_pack("loader.svg", "",
104
+        "class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ": "
105
+        . ($left - 30)
106
+        . "px; top: 2px; z-index: 2;' id='img_$idom2'")
107
+    . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ": "
108
+    . ($left - 250)
109
+    . "px;'>"
110
+    . $ret
111
+    . "\n</div>\n<div id='$idom2'>"
112
+    . ($next
113
+        ? inc_plonger_dist($id_rubrique, $idom, $list, $col + 1, $exclu)
114
+        : "")
115
+    . "\n</div>";
116 116
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 
35 35
 	$res = sql_select("rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant",
36 36
 		"spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)",
37
-		"rub1.id_parent = " . sql_quote($id_rubrique) . "
38
-			AND rub1.id_rubrique!=" . sql_quote($exclu) . "
39
-			AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=" . sql_quote($exclu) . ")", "", "0+rub1.titre,rub1.titre");
37
+		"rub1.id_parent = ".sql_quote($id_rubrique)."
38
+			AND rub1.id_rubrique!=" . sql_quote($exclu)."
39
+			AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=" . sql_quote($exclu).")", "", "0+rub1.titre,rub1.titre");
40 40
 
41 41
 	while ($row = sql_fetch($res)) {
42 42
 		if (autoriser('voir', 'rubrique', $row['id_rubrique'])) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 				if ($row['langue_choisie'] != 'oui') {
47 47
 					$t .= ' <small title="'
48 48
 						. traduire_nom_langue($row['lang'])
49
-						. '">[' . $row['lang'] . ']</small>';
49
+						. '">['.$row['lang'].']</small>';
50 50
 				}
51 51
 				$ordre[$row['id_rubrique']] = $t;
52 52
 			}
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 	$next = isset($list[$col]) ? $list[$col] : 0;
56 56
 	if ($ordre) {
57
-		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1));
57
+		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=".($col + 1));
58 58
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
59
-		$args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event";
59
+		$args = "'$idom',this,$col,'".$GLOBALS['spip_lang_left']."','$info',event";
60 60
 
61 61
 		foreach ($ordre as $id => $titrebrut) {
62 62
 			$titre = supprimer_numero($titrebrut);
63 63
 
64
-			$classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : "petit-secteur");
64
+			$classe1 = 'petit-item '.($id_rubrique ? 'petite-rubrique' : "petit-secteur");
65 65
 			if (isset($rub[$id]["enfants"])) {
66 66
 				$classe2 = " class='rub-ouverte'";
67 67
 				$url = "\nhref='$rec&amp;id=$id'";
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$url = "\nhref='javascript:void(0)'";
71 71
 			}
72 72
 
73
-			$js_func = $do . '_selection_titre';
73
+			$js_func = $do.'_selection_titre';
74 74
 			$click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn "
75 75
 				. (!is_array($list) ? ' false'
76 76
 					: "aff_selection_provisoire($id,$args)")
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 		}
98 98
 	}
99 99
 
100
-	$idom2 = $idom . "_col_" . ($col + 1);
100
+	$idom2 = $idom."_col_".($col + 1);
101 101
 	$left = ($col * 250);
102 102
 
103 103
 	return http_img_pack("loader.svg", "",
104
-		"class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ": "
104
+		"class='loader' style='visibility: hidden; position: absolute; ".$GLOBALS['spip_lang_left'].": "
105 105
 		. ($left - 30)
106 106
 		. "px; top: 2px; z-index: 2;' id='img_$idom2'")
107
-	. "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ": "
107
+	. "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; ".$GLOBALS['spip_lang_left'].": "
108 108
 	. ($left - 250)
109 109
 	. "px;'>"
110 110
 	. $ret
Please login to merge, or discard this patch.
ecrire/inc/selectionner.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('inc/filtres');
@@ -46,47 +46,47 @@  discard block
 block discarded – undo
46 46
  **/
47 47
 function inc_selectionner_dist($sel, $idom = "", $exclus = 0, $aff_racine = false, $recur = true, $do = 'aff') {
48 48
 
49
-	if ($recur) {
50
-		$recur = mini_hier($sel);
51
-	} else {
52
-		$sel = 0;
53
-	}
49
+    if ($recur) {
50
+        $recur = mini_hier($sel);
51
+    } else {
52
+        $sel = 0;
53
+    }
54 54
 
55
-	if ($aff_racine) {
56
-		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
57
-		$idom3 = $idom . "_selection";
55
+    if ($aff_racine) {
56
+        $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
57
+        $idom3 = $idom . "_selection";
58 58
 
59
-		$onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;";
59
+        $onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;";
60 60
 
61
-		$ondbClick = strtr(str_replace("'", "&#8217;",
62
-			str_replace('"', "&#34;",
63
-				textebrut(_T('info_racine_site')))),
64
-			"\n\r", "  ");
61
+        $ondbClick = strtr(str_replace("'", "&#8217;",
62
+            str_replace('"', "&#34;",
63
+                textebrut(_T('info_racine_site')))),
64
+            "\n\r", "  ");
65 65
 
66
-		$js_func = $do . '_selection_titre';
67
-		$ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');";
66
+        $js_func = $do . '_selection_titre';
67
+        $ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');";
68 68
 
69
-		$aff_racine = "<div class='petit-item petite-racine item'>"
70
-			. "<a href='#'"
71
-			. "onclick=\""
72
-			. $onClick
73
-			. "\"\nondbclick=\""
74
-			. $ondbClick
75
-			. $onClick
76
-			. "\">"
77
-			. _T("info_racine_site")
78
-			. "</a></div>";
79
-	}
69
+        $aff_racine = "<div class='petit-item petite-racine item'>"
70
+            . "<a href='#'"
71
+            . "onclick=\""
72
+            . $onClick
73
+            . "\"\nondbclick=\""
74
+            . $ondbClick
75
+            . $onClick
76
+            . "\">"
77
+            . _T("info_racine_site")
78
+            . "</a></div>";
79
+    }
80 80
 
81
-	$url_init = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclus&id=0&col=1&do=$do");
81
+    $url_init = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclus&id=0&col=1&do=$do");
82 82
 
83
-	$plonger = charger_fonction('plonger', 'inc');
84
-	$plonger_r = $plonger($sel, $idom, $recur, 1, $exclus, $do);
83
+    $plonger = charger_fonction('plonger', 'inc');
84
+    $plonger_r = $plonger($sel, $idom, $recur, 1, $exclus, $do);
85 85
 
86
-	// url completee par la fonction JS onkeypress_rechercher
87
-	$url = generer_url_ecrire('rechercher', "exclus=$exclus&rac=$idom&do=$do&type=");
86
+    // url completee par la fonction JS onkeypress_rechercher
87
+    $url = generer_url_ecrire('rechercher', "exclus=$exclus&rac=$idom&do=$do&type=");
88 88
 
89
-	return construire_selectionner_hierarchie($idom, $plonger_r, $aff_racine, $url, 'id_parent', $url_init);
89
+    return construire_selectionner_hierarchie($idom, $plonger_r, $aff_racine, $url, 'id_parent', $url_init);
90 90
 }
91 91
 
92 92
 /**
@@ -104,55 +104,55 @@  discard block
 block discarded – undo
104 104
  **/
105 105
 function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '') {
106 106
 
107
-	$idom1 = $idom . "_champ_recherche";
108
-	$idom2 = $idom . "_principal";
109
-	$idom3 = $idom . "_selection";
110
-	$idom4 = $idom . "_col_1";
111
-	$idom5 = 'img_' . $idom4;
112
-	$idom6 = $idom . "_fonc";
113
-
114
-	return "<div id='$idom'>"
115
-	. "<a id='$idom6' style='visibility: hidden;'"
116
-	. ($url_init ? "\nhref='$url_init'" : '')
117
-	. "></a>"
118
-	. "<div class='recherche_rapide_parent formulaire_recherche'>"
119
-	. http_img_pack("loader.svg", "",
120
-		"class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'")
121
-	. ""
122
-	. "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'"
123
-	// eliminer Return car il provoque la soumission (balise unique)
124
-	// et eliminer Tab pour la navigation au clavier
125
-	// ce serait encore mieux de ne le faire que s'il y a encore plusieurs
126
-	// resultats retournes par la recherche
127
-	. "\nonkeypress=\"k=event.keyCode;if (k==13 || k==3 || k==9){return false;}\""
128
-	// lancer la recherche apres le filtrage ci-dessus sauf sur le tab (navigation au clavier)
129
-	. "\nonkeyup=\"if(event.keyCode==9){return false;};return onkey_rechercher(this.value,"
130
-	// la destination de la recherche
131
-	. "'$idom4'"
107
+    $idom1 = $idom . "_champ_recherche";
108
+    $idom2 = $idom . "_principal";
109
+    $idom3 = $idom . "_selection";
110
+    $idom4 = $idom . "_col_1";
111
+    $idom5 = 'img_' . $idom4;
112
+    $idom6 = $idom . "_fonc";
113
+
114
+    return "<div id='$idom'>"
115
+    . "<a id='$idom6' style='visibility: hidden;'"
116
+    . ($url_init ? "\nhref='$url_init'" : '')
117
+    . "></a>"
118
+    . "<div class='recherche_rapide_parent formulaire_recherche'>"
119
+    . http_img_pack("loader.svg", "",
120
+        "class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'")
121
+    . ""
122
+    . "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'"
123
+    // eliminer Return car il provoque la soumission (balise unique)
124
+    // et eliminer Tab pour la navigation au clavier
125
+    // ce serait encore mieux de ne le faire que s'il y a encore plusieurs
126
+    // resultats retournes par la recherche
127
+    . "\nonkeypress=\"k=event.keyCode;if (k==13 || k==3 || k==9){return false;}\""
128
+    // lancer la recherche apres le filtrage ci-dessus sauf sur le tab (navigation au clavier)
129
+    . "\nonkeyup=\"if(event.keyCode==9){return false;};return onkey_rechercher(this.value,"
130
+    // la destination de la recherche
131
+    . "'$idom4'"
132 132
 #	. "this.parentNode.parentNode.parentNode.parentNode.nextSibling.firstChild.id"
133
-	. ",'"
134
-	// l'url effectuant la recherche
135
-	. $url
136
-	. "',"
137
-	// le noeud contenant un gif anime
138
-	// . "'idom5'"
139
-	. "this.parentNode.previousSibling.firstChild"
140
-	. ",'"
141
-	// la valeur de l'attribut Name a remplir
142
-	. $name
143
-	. "','"
144
-	// noeud invisible memorisant l'URL initiale (pour re-initialisation)
145
-	. $idom6
146
-	. "')\""
147
-	. " />"
148
-	. "\n</div>"
149
-	. ($racine ? "<div>$racine</div>" : "")
150
-	. "<div id='"
151
-	. $idom2
152
-	. "'><div id='$idom4'"
153
-	. " class=''>"
154
-	. $liste
155
-	. "</div></div>\n<div id='$idom3'></div></div>\n";
133
+    . ",'"
134
+    // l'url effectuant la recherche
135
+    . $url
136
+    . "',"
137
+    // le noeud contenant un gif anime
138
+    // . "'idom5'"
139
+    . "this.parentNode.previousSibling.firstChild"
140
+    . ",'"
141
+    // la valeur de l'attribut Name a remplir
142
+    . $name
143
+    . "','"
144
+    // noeud invisible memorisant l'URL initiale (pour re-initialisation)
145
+    . $idom6
146
+    . "')\""
147
+    . " />"
148
+    . "\n</div>"
149
+    . ($racine ? "<div>$racine</div>" : "")
150
+    . "<div id='"
151
+    . $idom2
152
+    . "'><div id='$idom4'"
153
+    . " class=''>"
154
+    . $liste
155
+    . "</div></div>\n<div id='$idom3'></div></div>\n";
156 156
 }
157 157
 
158 158
 /**
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
  **/
165 165
 function mini_hier($id_rubrique) {
166 166
 
167
-	$liste = $id_rubrique;
168
-	$id_rubrique = intval($id_rubrique);
169
-	while ($id_rubrique = sql_getfetsel("id_parent", "spip_rubriques", "id_rubrique = " . $id_rubrique)) {
170
-		$liste = $id_rubrique . ",$liste";
171
-	}
167
+    $liste = $id_rubrique;
168
+    $id_rubrique = intval($id_rubrique);
169
+    while ($id_rubrique = sql_getfetsel("id_parent", "spip_rubriques", "id_rubrique = " . $id_rubrique)) {
170
+        $liste = $id_rubrique . ",$liste";
171
+    }
172 172
 
173
-	return explode(',', "0,$liste");
173
+    return explode(',', "0,$liste");
174 174
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 	if ($aff_racine) {
56 56
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
57
-		$idom3 = $idom . "_selection";
57
+		$idom3 = $idom."_selection";
58 58
 
59 59
 		$onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;";
60 60
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				textebrut(_T('info_racine_site')))),
64 64
 			"\n\r", "  ");
65 65
 
66
-		$js_func = $do . '_selection_titre';
66
+		$js_func = $do.'_selection_titre';
67 67
 		$ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');";
68 68
 
69 69
 		$aff_racine = "<div class='petit-item petite-racine item'>"
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
  **/
105 105
 function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '') {
106 106
 
107
-	$idom1 = $idom . "_champ_recherche";
108
-	$idom2 = $idom . "_principal";
109
-	$idom3 = $idom . "_selection";
110
-	$idom4 = $idom . "_col_1";
111
-	$idom5 = 'img_' . $idom4;
112
-	$idom6 = $idom . "_fonc";
107
+	$idom1 = $idom."_champ_recherche";
108
+	$idom2 = $idom."_principal";
109
+	$idom3 = $idom."_selection";
110
+	$idom4 = $idom."_col_1";
111
+	$idom5 = 'img_'.$idom4;
112
+	$idom6 = $idom."_fonc";
113 113
 
114 114
 	return "<div id='$idom'>"
115 115
 	. "<a id='$idom6' style='visibility: hidden;'"
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 	. "></a>"
118 118
 	. "<div class='recherche_rapide_parent formulaire_recherche'>"
119 119
 	. http_img_pack("loader.svg", "",
120
-		"class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'")
120
+		"class='loader' style='visibility: hidden;float:".$GLOBALS['spip_lang_right']."' id='$idom5'")
121 121
 	. ""
122
-	. "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'"
122
+	. "<input style='width: 10em;float:".$GLOBALS['spip_lang_right'].";' type='text' class='text search' id='$idom1' placeholder='"._T('info_rechercher')."'"
123 123
 	// eliminer Return car il provoque la soumission (balise unique)
124 124
 	// et eliminer Tab pour la navigation au clavier
125 125
 	// ce serait encore mieux de ne le faire que s'il y a encore plusieurs
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 
167 167
 	$liste = $id_rubrique;
168 168
 	$id_rubrique = intval($id_rubrique);
169
-	while ($id_rubrique = sql_getfetsel("id_parent", "spip_rubriques", "id_rubrique = " . $id_rubrique)) {
170
-		$liste = $id_rubrique . ",$liste";
169
+	while ($id_rubrique = sql_getfetsel("id_parent", "spip_rubriques", "id_rubrique = ".$id_rubrique)) {
170
+		$liste = $id_rubrique.",$liste";
171 171
 	}
172 172
 
173 173
 	return explode(',', "0,$liste");
Please login to merge, or discard this patch.