<?php 
$im=new thumbnail_tool(CHEMIN,CACHE_VIGNETTES,APP."images/");
$im->set_source(IMPORTS_URL.$item->getFile('illustration'));
$de=$item->getDescription('illustration');
?>

<div class="py-3 container">

    <img class="item-illu img-object-fit" src="<?= $im->vignette(600,600,false); ?>" alt="<?= $de ?>">
    <div class="fw-description ff-bold-secondary fs-small"><?php
    if($de){
        echo "<span>".$de."</span>";
    }
        ?></div>

    <div id="fw-infos" class='mt-3' >
        <div class='item-content-gallery flex justify-content-center flex-gap-2'>
            <?php    
            $supported_image = array('gif','jpg','jpeg','png','webp');

            foreach($item->getFileList() as $file){

                $ext = strtolower(pathinfo(IMPORTS_URL.$file['file'], PATHINFO_EXTENSION));
                if (in_array($ext, $supported_image)) {
                    echo "<div class=''>";
                    echo "<img onclick=\"yc_vieweshowclickimage(this)\" data-slideshow data-slideshowsrc=\"";
                    $im->set_source(IMPORTS_URL.$file['file']); 
                    echo $im->vignette(FULLSIZE_W,FULLSIZE_H,false);
                    echo "\" src=\"".$im->vignette(60,60,true)
                        ."\" class=\"item-gal img-object-fit aspectratio-1 \" title=\"".$file['description']."\">";
                    echo "</div>";
                } 
            }
            ?>
        </div>
    </div>

    <div  class="p-3">

        <h2 class="fs-big ff-bold-primary mb-2 text-center"><?= $item->get('titre') ?></h2>
        <div class=" fs-small item-info mb-3 py-2 text-center border-top border-bottom">
            <span class="item-techspecs"><?= $item->getPropre("techspecs") ?></span> —  
            <span class="item-date_oeuvre" ><?= formate_date($item->get("date_oeuvre"),"year") ?></span>
        </div>

        <div class="item-info item-texte fs-medium ff-secondary">
            <?= $item->get("texte") ?>
        </div>

        <div>
            <?php
    if($item->get("docs",false)){
        $id="docs";
        $snippet=getSnippetFile("display_part_docs.php");
        include($snippet);
    }
            ?>
        </div>
        <div class="mt-3">
            <?php
            if($item->get("lien",false)){
                $parts=parse_url($item->get("lien"));
                echo "Lien vers <a href=\"".$item->get("lien")."\">".$parts['host']."</a>";

            }
            ?>
        </div>
        <?php
        foreach(MODULES['insert_item'] as $insert){
            include(CHEMIN.$insert);
        }
        ?>
    </div>
</div>