<?php 
$im=new thumbnail_tool(CHEMIN,CACHE_VIGNETTES,APP."images/");
$im->set_source(IMPORTS_URL.$item->getFile('illustration'));
$de=$item->getDescription('illustration');
?>
<div id="fw" class="px-3 pt-0">
    <div id="fw-visual">
        <div id="fw-image">
            <img src="<?= $im->vignette(FULLSIZE_W,FULLSIZE_H,false); ?>" alt="<?= $de ?>">
            <div class="fw-nav fw-prev" onclick="yc_vieweshowimage(-1)"></div>
            <div class="fw-nav fw-next" onclick="yc_vieweshowimage(1)"></div>
            <div class="fw-description ff-bold-secondary fs-small"><?php
    if($de){
        echo "<span>".$de."</span>";
    }
                ?></div>
        </div>
    </div>
    <div id="fw-infos" class="p-3">

        <div class="grid grid-reg2 grid-fap-3 mt-4">
            <div class="">
                <h2 class="fs-big"><?= $item->get("prenom") ?> <?= $item->get("nom") ?>

                    <?php
    if($item->get("usuel",false)){
        echo "<br>( ".$item->get("usuel")." )";

    }
                    ?>
                </h2>
                <div class="fs-medium my-3">
                    <?php
                    if($item->get("option",false)){
                        echo "<div class='fs-medium ff-bold-primary'>".$item->getpropre("option")."</div>";
                    }

                    if($item->get("pole",false)){
                        echo "<div class='fs-medium ff-bold-primary'>".$item->getpropre("pole")."</div>";
                    }

                    ?>
                </div>
                <div class="my-3">
                    <?= $item->get("remarques","Pas de remarques"); ?>
                </div>
            </div>
            <div>
                <?php
                $liste=$item->getFilledValues();

                $liste=$item->getFilledValues();
                foreach($liste as $id => $val){
                    if(strpos($id, "rv_") === 0){
                        if($item->getpropre($id,false)){
                            echo "<div class='mb-3'><div class='ff-bold-secondary'>".$item->getParam($id,"label")."</div>";
                            echo "<div>".$item->get($id)."</div></div>";
                        }
                    }
                }

                unset($liste['illustration']);
                unset($liste['prenom']);    
                unset($liste['nom']);    
                unset($liste['usuel']);    
                unset($liste['pole']);    
                unset($liste['option']);  
                unset($liste['remarques']);  


                foreach($liste as $id => $val){
                    if($item->getParam($id,"snippet")){
                        $snippet=getSnippetFile("display_".$item->getParam($id,"snippet").".php");
                        include($snippet);
                    } else {
                        // voir s'il existe un snippet spécifique
                        $type=$item->getParam($id,"type");
                        $snippet=getSnippetFile("display_part_".$type.".php");
                        if(!file_exists($snippet)){
                            $snippet=getSnippetFile("display_part_default.php");
                        } 
                        include($snippet);
                    }
                }
                foreach(MODULES['insert_item'] as $insert){
                    include(CHEMIN.$insert);
                }
                ?>
            </div>
        </div>


        <img onclick="yc_vieweshowclickimage(this)" class="img-object-fit aspectratio-1 mb-2" data-slideshow data-slideshowsrc="<?= $im->vignette(FULLSIZE_W,FULLSIZE_H,false) ?>" src="<?= $im->vignette(VIGNETTE_W,VIGNETTE_H,false) ?>" title="<?= $item->getDescription('illustration') ?>">



    </div>
</div>