<?php
// suppression d'items.
$items=new yamlReadwriter(); 
$items->setType("items_order"); // important

switch($_POST['action']){
    case "loadform":
        $menu_edit= array();
        include(APP."snippets/menu-viewer.php");
        
        $items->addHidden("action","submitform");
        $items->addHidden("endaction","yc_destroyOrderitems yc_closeViewer");         

        $items->setSnippetFolder(APP."form_parts/");
        $items->form_title="Organiser la mosaïque";
        $items->form_comment="Déplacez les items par drag & drop, puis validez le résultat obtenu.";
        $items->form_submit="Valider";
        $items->writeForm();

        break;

    case "submitform":
        $files=$_POST['sources'];
        supprimer_cache();
        create_mosaique_order($files);

        break;
}