Completed
Push — master ( 81dae8...186694 )
by cam
04:17
created
ecrire/inc/chercher_logo.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Logos
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -37,33 +37,33 @@  discard block
 block discarded – undo
37 37
  **/
38 38
 function inc_chercher_logo_dist($id, $_id_objet, $mode = 'on', $compat_old_logos = true) {
39 39
 
40
-	$mode = preg_replace(",\W,", '', $mode);
41
-	if ($mode) {
42
-		// chercher dans la base
43
-		$mode_document = 'logo' . $mode;
44
-		$objet = objet_type($_id_objet);
45
-		$doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', "D.mode=".sql_quote($mode_document)." AND L.objet=".sql_quote($objet)." AND id_objet=".intval($id));
46
-		if ($doc) {
47
-			$d = get_spip_doc($doc['fichier']);
48
-			return array($d, _DIR_IMG, basename($d), $doc['extension'], @filemtime($d), $doc);
49
-		}
40
+    $mode = preg_replace(",\W,", '', $mode);
41
+    if ($mode) {
42
+        // chercher dans la base
43
+        $mode_document = 'logo' . $mode;
44
+        $objet = objet_type($_id_objet);
45
+        $doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', "D.mode=".sql_quote($mode_document)." AND L.objet=".sql_quote($objet)." AND id_objet=".intval($id));
46
+        if ($doc) {
47
+            $d = get_spip_doc($doc['fichier']);
48
+            return array($d, _DIR_IMG, basename($d), $doc['extension'], @filemtime($d), $doc);
49
+        }
50 50
 
51
-		# deprecated TODO remove
52
-		if ($compat_old_logos) {
53
-			# attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
54
-			$type = type_du_logo($_id_objet);
55
-			$nom = $type . $mode . intval($id);
51
+        # deprecated TODO remove
52
+        if ($compat_old_logos) {
53
+            # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
54
+            $type = type_du_logo($_id_objet);
55
+            $nom = $type . $mode . intval($id);
56 56
 
57
-			foreach ($GLOBALS['formats_logos'] as $format) {
58
-				if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
59
-					return array($d, _DIR_LOGOS, $nom, $format, @filemtime($d));
60
-				}
61
-			}
62
-		}
63
-	}
57
+            foreach ($GLOBALS['formats_logos'] as $format) {
58
+                if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
59
+                    return array($d, _DIR_LOGOS, $nom, $format, @filemtime($d));
60
+                }
61
+            }
62
+        }
63
+    }
64 64
 
65
-	# coherence de type pour servir comme filtre (formulaire_login)
66
-	return array();
65
+    # coherence de type pour servir comme filtre (formulaire_login)
66
+    return array();
67 67
 }
68 68
 
69 69
 /**
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
  * @deprecated MAIS NE PAS SUPPRIMER CAR SERT POUR L'UPGRADE des logos et leur mise en base
83 83
  **/
84 84
 function type_du_logo($_id_objet) {
85
-	return isset($GLOBALS['table_logos'][$_id_objet])
86
-		? $GLOBALS['table_logos'][$_id_objet]
87
-		: objet_type(preg_replace(',^id_,', '', $_id_objet));
85
+    return isset($GLOBALS['table_logos'][$_id_objet])
86
+        ? $GLOBALS['table_logos'][$_id_objet]
87
+        : objet_type(preg_replace(',^id_,', '', $_id_objet));
88 88
 }
89 89
 
90 90
 // Exceptions standards (historique)
91 91
 $GLOBALS['table_logos'] = array(
92
-	'id_article' => 'art',
93
-	'id_auteur' => 'aut',
94
-	'id_rubrique' => 'rub',
95
-	'id_groupe' => 'groupe',
92
+    'id_article' => 'art',
93
+    'id_auteur' => 'aut',
94
+    'id_rubrique' => 'rub',
95
+    'id_groupe' => 'groupe',
96 96
 );
Please login to merge, or discard this patch.