<?php 
// A toutes fins utiles (dans tool affichage et tool search) charger la descritption d'item
$itemdescr=new yamlReadwriter();
$itemdescr->loadYaml(getTemplate("structure_item.yaml")); // charger la structure complète


$tools=array();
if($site->bool("tool_search")){
    $tools["Rechercher"]="tool_search.php";
}
if($site->bool("tool_filtrer")){
    $tools["Filtrer"] = "tool_filtrer.php";
}

if($site->bool("tool_affichage")){
    $tools["Infos"] = "tool_affichage.php";
}
if($site->bool("tool_mosaique")){
    $tools["Disposition"]="tool_mosaique.php";
}
if($site->bool("tool_tri")){
    $tools["Ordre"] = "tool_tri.php";
}

if($site->bool("tool_collections") && ($site->get("param_mode_visiteur")=="fullopen" || STATUS=="admin")){
    $tools["Collections"] = "tool_collections.php";
}
?>
<section id="tools" class="ff-secondary py-2 border-top border-bottom  print-none">
    <div id="toolbarrow">
        <div id="toolbar" class="flex flex-gap-3">
            <?php
            foreach($tools as $tool => $file){
                echo "<div id=\"title-".makeid($tool)."\"><div data-toggle-button=\"".makeid($tool)."\" class=\"link-behavior\" data-toggle-unique='tools'>".$tool."</div></div>";
            }
            ?>
        </div>
        <div id="tooladmin" class="link-behavior text-right" onclick="yc_loadform('admin')">Admin</div>
    </div>
    <div id="toolcontainer">
        <?php
        foreach($tools as $tool => $file){
            if(file_exists(APP."snippets/".$file)){
                echo "<div data-toggle-target=\"".makeid($tool)."\" data-toggle-state=\"hide\" data-toggle-unique=\"tools\" class=\"pt-3 pb-2\">";
                include(APP."snippets/".$file);
                echo "</div>";
            } else {
                echo "<div data-toggle-content=\"".makeid($tool)."\">".APP."snippets/".$file." existe pas</div>";
            }
        }
        ?>
    </div>
</section>