3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2016 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined('_ECRIRE_INC_VERSION')) return;
15 // http://doc.spip.org/@inc_chercher_logo_dist
16 function inc_chercher_logo_dist($id, $_id_objet, $mode='on') {
17 global $formats_logos;
18 # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
20 $type = type_du_logo($_id_objet);
21 $nom = $type . $mode . intval($id);
23 foreach ($formats_logos as $format) {
24 if (@file_exists
($d = (_DIR_LOGOS
. $nom . '.' . $format))) {
25 return array($d, _DIR_LOGOS
, $nom, $format, @filemtime
($d));
28 # coherence de type pour servir comme filtre (formulaire_login)
32 // http://doc.spip.org/@type_du_logo
33 function type_du_logo($_id_objet) {
34 return isset($GLOBALS['table_logos'][$_id_objet])
35 ?
$GLOBALS['table_logos'][$_id_objet]
36 : objet_type(preg_replace(',^id_,','',$_id_objet));
39 // Exceptions standards (historique)
42 'id_article' => 'art',
44 'id_rubrique' => 'rub',
45 'id_groupe' => 'groupe',