alpha_full/pages/produits/produits.onglets.php
2026-04-06 22:58:51 +02:00

44 lines
1.6 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
function affDetailsPrd($ongActif,$idPrd) {
global $idPrd;
global $nomPrd;
global $lienNotice;
if (isset($nomPrd)) $nomPrd=urlencode($nomPrd);
if (($lienNotice!="") && ($lienNotice!="-")) {
$liensPrd = array( "produits-notice-" .$idPrd. "-".$nomPrd. "-1", "produits-notice-" .$idPrd. "-".$nomPrd. "-2");
$detailOngletsTexte = array( "Description","Notice");
}
else {
$liensPrd = array( "produits-notice-" .$idPrd. "-".$nomPrd. "-1");
$detailOngletsTexte = array( "Description");
}
// informations sur la page
$info = pathinfo($_SERVER['PHP_SELF']);
$test=$info['basename'];
$test ="produits-notice-' .$idPrd. '-' .$nomPrd. '-' .$ongActif. '";
$detailOnglets= '<div><ul id="ongletBarre" class="flexToColumn" >';
// boucle qui parcours les deux tableaux
foreach($liensPrd as $cle=>$lien) {
// si le nom du fichier correspond a celui pointe par l'indice, alors on l'active
if ($test == $lien) {
$detailOnglets=$detailOnglets. '<li id="ongActv" >';
$detailOnglets=$detailOnglets. '<a id="txtActv" href="' .$lien. '">' .$detailOngletsTexte[$cle]. '</a>';
$detailOnglets=$detailOnglets. '</li>';
}
else {
$detailOnglets=$detailOnglets. '<li>';
$detailOnglets=$detailOnglets. '<a href="' .$lien. '">' .$detailOngletsTexte[$cle]. '</a>';
$detailOnglets=$detailOnglets. '</li>';
}
}
$_SESSION['actifOnglet']=$ongActif;
$detailOnglets.= "</ul>\n</div>";
// on renvoie le code xHTML
return $detailOnglets;
}
$detailOnglets= affDetailsPrd($affOngPrd,$idPrd);
?>