<?php
echo "<div class='mb-3 lateral_field lateral_field_$id' >\n";
echo "<div class='fs-regular ff-bold-primary pb-2'>\n";
echo $item->getParam($id,"label");
echo "</div>\n<div class='item-content-$id'>";

foreach($item->getFilearray($id) as $num => $val){
    $file=$val['file'];
    $description=$val['description'];
   
    $ext=pathinfo(IMPORTS.$file, PATHINFO_EXTENSION);
    switch($ext){
        case "mp4":
        case "ogg": 
        case "webm":
            echo "<div id=\"video".uniqid()."\" class=\"lecteur_video fs-tiny ff-secondary mb-3\">";
            echo "<video controls class='yc_videoreader'><source src='".IMPORTS_URL.$file."' type='video/$ext'>Your browser does not support the video  tag.</video>";
            echo "</div>";
            break; 
        case "mp3":
        case "ogg":
            echo "<div class=\"lecteur_audio fs-tiny ff-secondary mb-3\">";
            echo "<audio controls class='yc_audioreader'><source src='".IMPORTS_URL.$file."' type='audio/$ext' />Mettez à jour votre navigateur</audio>";
            echo "</div>";
            break;
            
        default:
            echo "<div class='flex flex-gap-3 align-items-center'>";
            // ici l'icone et le poids 
            echo "<div class=''><a href='".IMPORTS_URL.$file."' download class='fs-small'><img class='f-sm-icon' src='".get_file_icon(IMPORTS.$file)."'></a></div>";
            $size=human_filesize(filesize(IMPORTS.$file),2);
            echo "<div class='f-info mb-1'>";
            
            echo "<a href=\"".IMPORTS_URL.$file."\" download class='fs-small'>".$description."</a>";
            
            echo "<div class='fs-tiny text-maj'>".pathinfo(IMPORTS.$file, PATHINFO_EXTENSION)." - ".$size."</div>";
            echo "</div>\n";
            echo "</div>\n";
    } 
}
echo "</div></div>";

?>