diff --git a/ecrire/inc/chercher_logo.php b/ecrire/inc/chercher_logo.php index 0937d8260add96272e4a892fd4ef4091511f9975..e5696c85dc6c805356ca0bd928b1b542a4f069f7 100644 --- a/ecrire/inc/chercher_logo.php +++ b/ecrire/inc/chercher_logo.php @@ -37,18 +37,35 @@ if (!defined('_ECRIRE_INC_VERSION')) { **/ function inc_chercher_logo_dist($id, $_id_objet, $mode = 'on') { # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval() - + + $infos_logo = array(); $type = type_du_logo($_id_objet); $nom = $type . $mode . intval($id); - + foreach ($GLOBALS['formats_logos'] as $format) { if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) { - return array($d, _DIR_LOGOS, $nom, $format, @filemtime($d)); + $infos_logo = array($d, _DIR_LOGOS, $nom, $format, @filemtime($d)); + break; // On sort au premier logo trouvé } } - + + // On passe dans un pipeline + $infos_logo = pipeline( + 'chercher_logo', + array( + 'args' => array( + 'id_objet' => $id, + 'objet' => objet_type($_id_objet), + 'cle_objet' => $_id_objet, + 'type' => $type, + 'mode' => $mode, + ), + 'data' => $infos_logo, + ) + ); + # coherence de type pour servir comme filtre (formulaire_login) - return array(); + return $infos_logo; } /** diff --git a/ecrire/paquet.xml b/ecrire/paquet.xml index e589d7e9a30c006e463a7c8446b53bff9ec0d1eb..af9a84a6388bfc73555e4a020e5ec0cfb6437556 100644 --- a/ecrire/paquet.xml +++ b/ecrire/paquet.xml @@ -57,6 +57,7 @@ <pipeline nom="ajouter_onglets" action="" /> <pipeline nom="body_prive" action="" /> <pipeline nom="calculer_rubriques" action="" /> + <pipeline nom="chercher_logo" action="" /> <pipeline nom="configurer_liste_metas" action="" /> <pipeline nom="compter_contributions_auteur" action="" /> <pipeline nom="declarer_filtres_squelettes" action="" />