From 424d98244b41469450a33f03588e70d8a868d3f2 Mon Sep 17 00:00:00 2001 From: chankalan Date: Mon, 25 Oct 2021 21:52:16 +0200 Subject: [PATCH] =?UTF-8?q?bouton=20"importer=20l'=C3=A9mission"=20seuleme?= =?UTF-8?q?nt=20si=20composition=20=C3=A9mission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libreavous_pipelines.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libreavous_pipelines.php b/libreavous_pipelines.php index c7ef6bc..1ed51a2 100644 --- a/libreavous_pipelines.php +++ b/libreavous_pipelines.php @@ -94,10 +94,14 @@ function libreavous_affiche_milieu($flux) { $texte = ''; $e = trouver_objet_exec($flux['args']['exec']); - if ($e and !$e['edition'] and in_array($e['type'], array('article')) ) { - $texte .= recuperer_fond('prive/squelettes/inclure/importer_emission', array( - 'id_article' => $flux['args'][$e['id_table_objet']] - )); + if ( $e and !$e['edition'] and in_array($e['type'], array('article')) ) { + // pour retrouver la composition, utiliser une fonction existante du plugin "compositions" (cf compositions_fonctions.php) + $compo = compositions_heriter('article', $flux['args'][$e['id_table_objet']]); + if ($compo == 'emission') { + $texte .= recuperer_fond('prive/squelettes/inclure/importer_emission', array( + 'id_article' => $flux['args'][$e['id_table_objet']] + )); + } } if ($texte) {