Completed
Pull Request — master (#36)
by
unknown
06:08
created
index.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <?php
2
-	# appel SPIP
3
-	include('spip.php');
2
+    # appel SPIP
3
+    include('spip.php');
Please login to merge, or discard this patch.
prive/objets/liste/objets-trad_fonctions.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,24 +11,24 @@
 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 lister_traductions($id_trad, $objet) {
18
-	$table_objet_sql = table_objet_sql($objet);
19
-	$primary = id_table_objet($objet);
18
+    $table_objet_sql = table_objet_sql($objet);
19
+    $primary = id_table_objet($objet);
20 20
 
21
-	$select = "$primary as id,lang";
22
-	$where = 'id_trad=' . intval($id_trad);
23
-	$trouver_table = charger_fonction('trouver_table','base');
24
-	$desc = $trouver_table($table_objet_sql);
25
-	if (isset($desc['field']['statut'])) {
26
-		$select .= ',statut';
27
-		$where .= ' AND statut!='.sql_quote('poubelle');
28
-	}
21
+    $select = "$primary as id,lang";
22
+    $where = 'id_trad=' . intval($id_trad);
23
+    $trouver_table = charger_fonction('trouver_table','base');
24
+    $desc = $trouver_table($table_objet_sql);
25
+    if (isset($desc['field']['statut'])) {
26
+        $select .= ',statut';
27
+        $where .= ' AND statut!='.sql_quote('poubelle');
28
+    }
29 29
 
30
-	$rows = sql_allfetsel($select, $table_objet_sql, $where);
31
-	lang_select();
30
+    $rows = sql_allfetsel($select, $table_objet_sql, $where);
31
+    lang_select();
32 32
 
33
-	return $rows;
33
+    return $rows;
34 34
 }
Please login to merge, or discard this patch.
prive/objets/liste/auteurs_lies_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 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('prive/objets/liste/auteurs_fonctions');
Please login to merge, or discard this patch.
prive/objets/liste/objets-en-edition_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 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/drapeau_edition');
Please login to merge, or discard this patch.
prive/objets/liste/auteurs_fonctions.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Fonctions
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -29,29 +29,29 @@  discard block
 block discarded – undo
29 29
  * @param <type> $left
30 30
  */
31 31
 function critere_compteur_articles_filtres_dist($idb, &$boucles, $crit, $left = false) {
32
-	$boucle = &$boucles[$idb];
32
+    $boucle = &$boucles[$idb];
33 33
 
34
-	$_statut = calculer_liste($crit->param[0], array(), $boucles, $boucle->id_parent);
34
+    $_statut = calculer_liste($crit->param[0], array(), $boucles, $boucle->id_parent);
35 35
 
36
-	$not = '';
37
-	if ($crit->not) {
38
-		$not = ", 'NOT'";
39
-	}
40
-	$boucle->from['LAA'] = 'spip_auteurs_liens';
41
-	$boucle->from_type['LAA'] = 'left';
42
-	$boucle->join['LAA'] = array("'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''");
36
+    $not = '';
37
+    if ($crit->not) {
38
+        $not = ", 'NOT'";
39
+    }
40
+    $boucle->from['LAA'] = 'spip_auteurs_liens';
41
+    $boucle->from_type['LAA'] = 'left';
42
+    $boucle->join['LAA'] = array("'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''");
43 43
 
44
-	$boucle->from['articles'] = 'spip_articles';
45
-	$boucle->from_type['articles'] = 'left';
46
-	$boucle->join['articles'] = array(
47
-		"'LAA'",
48
-		"'id_article'",
49
-		"'id_objet'",
50
-		"'(articles.statut IS NULL OR '.sql_in('articles.statut',_q($_statut)$not).')'"
51
-	);
44
+    $boucle->from['articles'] = 'spip_articles';
45
+    $boucle->from_type['articles'] = 'left';
46
+    $boucle->join['articles'] = array(
47
+        "'LAA'",
48
+        "'id_article'",
49
+        "'id_objet'",
50
+        "'(articles.statut IS NULL OR '.sql_in('articles.statut',_q($_statut)$not).')'"
51
+    );
52 52
 
53
-	$boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles';
54
-	$boucle->group[] = 'auteurs.id_auteur';
53
+    $boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles';
54
+    $boucle->group[] = 'auteurs.id_auteur';
55 55
 }
56 56
 
57 57
 /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  *     Pile complétée par le code à générer
70 70
  */
71 71
 function balise_COMPTEUR_ARTICLES_dist($p) {
72
-	return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres');
72
+    return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres');
73 73
 }
74 74
 
75 75
 
@@ -85,42 +85,42 @@  discard block
 block discarded – undo
85 85
  * @return <type>
86 86
  */
87 87
 function afficher_initiale($url, $initiale, $compteur, $debut, $pas) {
88
-	static $memo = null;
89
-	static $res = array();
90
-	$out = '';
91
-	if (!$memo
92
-		or (!$initiale and !$url)
93
-		or ($initiale !== $memo['initiale'])
94
-	) {
95
-		$newcompt = intval(floor(($compteur - 1) / $pas) * $pas);
96
-		// si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien
97
-		if (!$initiale and !$url and !$memo['compteur']) {
98
-			$memo = null;
99
-		}
100
-		if ($memo) {
101
-			$on = (($memo['compteur'] <= $debut)
102
-				and (
103
-					$newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur'])
104
-				));
105
-			$res[] = lien_ou_expose($memo['url'], $memo['initiale'], $on, 'lien_pagination');
106
-		}
107
-		if ($initiale) {
108
-			$memo = array(
109
-				'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0,
110
-				'initiale' => $initiale,
111
-				'url' => parametre_url($url, 'i', $initiale),
112
-				'compteur' => $newcompt
113
-			);
114
-		}
115
-	}
116
-	if (!$initiale and !$url) {
117
-		if (count($res) > 1) {
118
-			$out = implode(' ', $res);
119
-		}
120
-		$memo = $res = null;
121
-	}
88
+    static $memo = null;
89
+    static $res = array();
90
+    $out = '';
91
+    if (!$memo
92
+        or (!$initiale and !$url)
93
+        or ($initiale !== $memo['initiale'])
94
+    ) {
95
+        $newcompt = intval(floor(($compteur - 1) / $pas) * $pas);
96
+        // si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien
97
+        if (!$initiale and !$url and !$memo['compteur']) {
98
+            $memo = null;
99
+        }
100
+        if ($memo) {
101
+            $on = (($memo['compteur'] <= $debut)
102
+                and (
103
+                    $newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur'])
104
+                ));
105
+            $res[] = lien_ou_expose($memo['url'], $memo['initiale'], $on, 'lien_pagination');
106
+        }
107
+        if ($initiale) {
108
+            $memo = array(
109
+                'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0,
110
+                'initiale' => $initiale,
111
+                'url' => parametre_url($url, 'i', $initiale),
112
+                'compteur' => $newcompt
113
+            );
114
+        }
115
+    }
116
+    if (!$initiale and !$url) {
117
+        if (count($res) > 1) {
118
+            $out = implode(' ', $res);
119
+        }
120
+        $memo = $res = null;
121
+    }
122 122
 
123
-	return $out;
123
+    return $out;
124 124
 }
125 125
 
126 126
 /**
@@ -139,23 +139,23 @@  discard block
 block discarded – undo
139 139
  * @return string
140 140
  */
141 141
 function auteur_lien_messagerie($id_auteur, $en_ligne, $statut, $imessage, $email = '') {
142
-	static $time = null;
143
-	if (!in_array($statut, array('0minirezo', '1comite'))) {
144
-		return '';
145
-	}
142
+    static $time = null;
143
+    if (!in_array($statut, array('0minirezo', '1comite'))) {
144
+        return '';
145
+    }
146 146
 
147
-	if (is_null($time)) {
148
-		$time = time();
149
-	}
150
-	$parti = (($time - strtotime($en_ligne)) > 15 * 60);
147
+    if (is_null($time)) {
148
+        $time = time();
149
+    }
150
+    $parti = (($time - strtotime($en_ligne)) > 15 * 60);
151 151
 
152
-	if ($imessage != 'non' and !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ?
153
-		and $GLOBALS['meta']['messagerie_agenda'] != 'non'
154
-	) {
155
-		return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self());
156
-	} elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) {
157
-		return 'mailto:' . $email;
158
-	} else {
159
-		return '';
160
-	}
152
+    if ($imessage != 'non' and !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ?
153
+        and $GLOBALS['meta']['messagerie_agenda'] != 'non'
154
+    ) {
155
+        return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self());
156
+    } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) {
157
+        return 'mailto:' . $email;
158
+    } else {
159
+        return '';
160
+    }
161 161
 }
Please login to merge, or discard this patch.
prive/objets/liste/articles_fonctions.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,40 +11,40 @@
 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 defaut_tri_defined($defaut) {
18
-	if (!defined('_TRI_ARTICLES_RUBRIQUE')) {
19
-		return $defaut;
20
-	}
18
+    if (!defined('_TRI_ARTICLES_RUBRIQUE')) {
19
+        return $defaut;
20
+    }
21 21
 
22
-	$sens = 1;
23
-	$tri = trim(_TRI_ARTICLES_RUBRIQUE);
24
-	$tri = explode(' ', $tri);
25
-	if (strncasecmp(end($tri), 'DESC', 4) == 0) {
26
-		$sens = -1;
27
-		array_pop($tri);
28
-	} elseif (strncasecmp(end($tri), 'ASC', 3) == 0) {
29
-		$sens = 1;
30
-		array_pop($tri);
31
-	}
32
-	$tri = implode(' ', $tri);
33
-	$tri = array($tri => $sens);
34
-	foreach ($defaut as $n => $s) {
35
-		if (!isset($tri[$n])) {
36
-			$tri[$n] = $s;
37
-		}
38
-	}
22
+    $sens = 1;
23
+    $tri = trim(_TRI_ARTICLES_RUBRIQUE);
24
+    $tri = explode(' ', $tri);
25
+    if (strncasecmp(end($tri), 'DESC', 4) == 0) {
26
+        $sens = -1;
27
+        array_pop($tri);
28
+    } elseif (strncasecmp(end($tri), 'ASC', 3) == 0) {
29
+        $sens = 1;
30
+        array_pop($tri);
31
+    }
32
+    $tri = implode(' ', $tri);
33
+    $tri = array($tri => $sens);
34
+    foreach ($defaut as $n => $s) {
35
+        if (!isset($tri[$n])) {
36
+            $tri[$n] = $s;
37
+        }
38
+    }
39 39
 
40
-	return $tri;
40
+    return $tri;
41 41
 }
42 42
 
43 43
 function defaut_tri_par($par, $defaut) {
44
-	if (!defined('_TRI_ARTICLES_RUBRIQUE')) {
45
-		return $par;
46
-	}
47
-	$par = array_keys($defaut);
44
+    if (!defined('_TRI_ARTICLES_RUBRIQUE')) {
45
+        return $par;
46
+    }
47
+    $par = array_keys($defaut);
48 48
 
49
-	return reset($par);
49
+    return reset($par);
50 50
 }
Please login to merge, or discard this patch.
prive/ajax_item_pick_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!defined('_ECRIRE_INC_VERSION')) {
4
-	return;
4
+    return;
5 5
 }
6 6
 
7 7
 include_spip('formulaires/selecteur/selecteur_fonctions');
Please login to merge, or discard this patch.
prive/formulaires/inc-instituer_auteur_fonctions.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package SPIP\Core\Formulaires
7 7
  **/
8 8
 if (!defined('_ECRIRE_INC_VERSION')) {
9
-	return;
9
+    return;
10 10
 }
11 11
 
12 12
 /**
@@ -23,31 +23,31 @@  discard block
 block discarded – undo
23 23
  *     Code HTML et javascript
24 24
  */
25 25
 function choisir_rubriques_admin_restreint(
26
-	$id_auteur,
27
-	$label = '',
28
-	$sel_css = '#liste_rubriques_restreintes',
29
-	$img_remove = ''
26
+    $id_auteur,
27
+    $label = '',
28
+    $sel_css = '#liste_rubriques_restreintes',
29
+    $img_remove = ''
30 30
 ) {
31
-	global $spip_lang;
32
-	$res = '';
33
-	// Ajouter une rubrique a un administrateur restreint
34
-	if ($chercher_rubrique = charger_fonction('chercher_rubrique', 'inc')
35
-		and $a = $chercher_rubrique(0, 'auteur', false)
36
-	) {
37
-		if ($img_remove) {
38
-			$img_remove = addslashes("<a href=\"#\" onclick=\"jQuery(this).parent().remove();return false;\" class=\"removelink\">$img_remove</a>");
39
-		}
31
+    global $spip_lang;
32
+    $res = '';
33
+    // Ajouter une rubrique a un administrateur restreint
34
+    if ($chercher_rubrique = charger_fonction('chercher_rubrique', 'inc')
35
+        and $a = $chercher_rubrique(0, 'auteur', false)
36
+    ) {
37
+        if ($img_remove) {
38
+            $img_remove = addslashes("<a href=\"#\" onclick=\"jQuery(this).parent().remove();return false;\" class=\"removelink\">$img_remove</a>");
39
+        }
40 40
 
41
-		$res =
42
-			"\n<div id='ajax_rubrique'>\n"
43
-			. "<label>$label</label>\n"
44
-			. "<input name='id_auteur' value='$id_auteur' type='hidden' />\n"
45
-			. $a
46
-			. "</div>\n"
41
+        $res =
42
+            "\n<div id='ajax_rubrique'>\n"
43
+            . "<label>$label</label>\n"
44
+            . "<input name='id_auteur' value='$id_auteur' type='hidden' />\n"
45
+            . $a
46
+            . "</div>\n"
47 47
 
48
-			// onchange = pour le menu
49
-			// l'evenement doit etre provoque a la main par le selecteur ajax
50
-			. "<script type='text/javascript'>/*<![CDATA[*/
48
+            // onchange = pour le menu
49
+            // l'evenement doit etre provoque a la main par le selecteur ajax
50
+            . "<script type='text/javascript'>/*<![CDATA[*/
51 51
 jQuery(function($){
52 52
 	$('#id_parent').on('change', function(){
53 53
 		var id_parent = parseInt(this.value);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	.attr('name','noname');
67 67
 });
68 68
 /*]]>*/</script>";
69
-	}
69
+    }
70 70
 
71
-	return $res;
71
+    return $res;
72 72
 }
Please login to merge, or discard this patch.
prive/formulaires/selecteur/generique_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  */
5 5
 
6 6
 if (!defined('_ECRIRE_INC_VERSION')) {
7
-	return;
7
+    return;
8 8
 }
9 9
 
10 10
 include_spip('inc/filtres_selecteur_generique');
Please login to merge, or discard this patch.