services->get(AssetsManager::class)->AddCSSFile('custom/templates/bazar/assets/activites.css'); if (empty($_GET['print']) || $_GET['print'] != 1) { $renderedEntry = ''; foreach ($form['prepared'] as $field) { $renderedEntry .= $field->renderStaticIfPermitted($fiche, $GLOBALS['wiki']->GetUsername()); } echo $renderedEntry; echo ' Imprimer cette fiche'; } else { $imgwidth = $imgheight = 600; $imgCarree = ''; if (isset($fiche['imagebf_image']) && $fiche['imagebf_image']!='') { $imgCarree = ''; } $imgCarree2 = ''; if (isset($fiche['imagebf_image1']) && $fiche['imagebf_image1']!='') { $imgCarree2 = ''; } else { $imgCarree2 = $imgCarree; $fiche['bf_credit2'] = $fiche['bf_credit']; } $qrcode = ''.$GLOBALS['wiki']->format('{{qrcode text="' . $GLOBALS['wiki']->href('', $fiche['id_fiche']) . '"}}').''; $qrcodeurl = ''; if (!empty($fiche['bf_url'])) { $qrcodeurl = ''.$GLOBALS['wiki']->format('{{qrcode text="'.$fiche['bf_url'].'"}}').''; } else { $qrcodeurl = $qrcode; } $structure = !empty($fiche['bf_structure']) ? $fiche['bf_structure'] : $fiche['bf_nom_contributeur']; echo << {$fiche['bf_titre']} {$html['bf_description']} {$imgCarree} {$fiche['bf_credit']} ressource proposée par {$structure} {$qrcodeurl} {$html['bf_reponse']} {$imgCarree2} {$fiche['bf_credit2']} {$qrcode} Imprimer cette fiche TEMPLATE; if (!empty($_GET['returnTo'])) { echo << document.addEventListener('DOMContentLoaded', function(event) { window.onafterprint = function () { window.location.href = "{$_GET['returnTo']}"; } const goBack = () => { window.location.href = "{$_GET['returnTo']}"; window.removeEventListener('focus', goBack); }; window.addEventListener('focus', goBack); window.print() }) JS; } } ?>