Browse Source

#12 Merger vers Master

pull/19/head
pierretux 2 months ago
parent
commit
cdffea5ae2
  1. 20
      tarteaucitron_pipelines.php

20
tarteaucitron_pipelines.php

@ -45,23 +45,33 @@ function tarteaucitron_insert_head($flux) {
* @param string $flux
* @return mixed
*/
function tarteaucitron_affichage_final($page) {
if ($GLOBALS['html'] and !test_espace_prive() and tarteaucitron_actif()) {
function tarteaucitron_affichage_final($html) {
if (!test_espace_prive() and tarteaucitron_actif()) {
$objet = $id_objet = $recherche = '';
$page = 'sommaire';
$resultat_page = '0';
foreach($GLOBALS['contexte'] as $k => &$v) {
if (preg_match(',^id_(\w+)$,S', $k, $r)
AND ($id = intval($v))>0
) {
$objet = 'id_'.$r[1];
$id_objet = $id;
$page = '';
} elseif (in_array($k, array('type-page', 'page'))) {
$page = $v;
} elseif ($k === 'recherche') {
$recherche = $v;
} elseif ($k === 'max') {
$resultat_page = $v;
}
}
$ajouter_services = '<script type="text/javascript">';
$ajouter_services .= tarteaucitron_liste_services_actifs($objet, $id_objet);
$ajouter_services .= tarteaucitron_liste_services_actifs($objet, $id_objet, $page, $recherche, $resultat_page);
$ajouter_services .= '</script>';
if ($ajouter_services) {
$page = str_replace('</body>', $ajouter_services. '</body>', $page);
$html = str_replace('</body>', $ajouter_services. '</body>', $html);
}
}
return $page;
return $html;
}
Loading…
Cancel
Save