push initial du projet par Stéphane
This commit is contained in:
70
inc/inc-ajax-form-collection.php
Executable file
70
inc/inc-ajax-form-collection.php
Executable file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
require("../config/config.php");
|
||||
require(CHEMIN."inc/inc-functions.php");
|
||||
require(CHEMIN."inc/inc-display-functions.php");
|
||||
require(CHEMIN."inc/classe_xml.php");
|
||||
$xml=new classe_xml(MODELE_COLLECTION);
|
||||
fix_exists_dir(CHEMIN.DOSSIER_COLLECTION);
|
||||
|
||||
if(isset($_GET['xml'])){
|
||||
$url=CHEMIN.DOSSIER_COLLECTION.$_GET['xml'];
|
||||
$xml->lire_xml($url);
|
||||
$action=array(
|
||||
"titre"=>"Updater une collection",
|
||||
"action"=>"updater_collection",
|
||||
"addtop"=>"<div class='my-2'>Sélectionnez les items de cette collection en cliquant sur les items à gauche.<br>Réordonnez-les par drag and drop.</div>",
|
||||
"submit"=>"Updater",
|
||||
"delete"=>"oui"
|
||||
);
|
||||
$retour=$xml->traiter_formulaire(true);
|
||||
|
||||
if($retour=="delete"){
|
||||
echo "delete";
|
||||
} if($retour=="update"){
|
||||
display_mosaique_collection($xml,false);
|
||||
}
|
||||
|
||||
} else {
|
||||
$action=array(
|
||||
"titre"=>"Ajouter une collection",
|
||||
"action"=>"ajouter_collection",
|
||||
"addtop"=>"<div class='my-2'>Sélectionnez les items de cette collection en cliquant sur les items à gauche.</div>",
|
||||
"submit"=>"Ajouter"
|
||||
);
|
||||
$retour=$xml->traiter_formulaire(false);
|
||||
|
||||
if($retour=="insert"){
|
||||
$nom_page=$xml->stripAccents($xml->get('titre')).".xml";
|
||||
$xml->fichier_seul=$nom_page;
|
||||
$xml->fichier = CHEMIN.DOSSIER_COLLECTION.$nom_page;
|
||||
$xml->ecrit_xml();
|
||||
|
||||
display_mosaique_collection($xml,false);
|
||||
}
|
||||
}
|
||||
|
||||
//print_r($xml->messages);
|
||||
|
||||
if($retour=="none"){
|
||||
echo "<div class=\"container-buttons collection-form-button\"><div class=\"buttons-left\"></div><div class=\"buttons-right\"><div class=\"button button-close ml-3\" onclick=\"close_viewer();destroy_multi_select();\"><span class=\"titre-tiny\">Close</span> <i class=\"fas fa-chevron-right\"></i></div></div></div></div></div>";
|
||||
echo $xml->deployer_formulaire($action);
|
||||
|
||||
/*echo "<div class='mt-3 pt-2 border-top'>
|
||||
<div class='mt-1 d-inline-block mr-4 fat' >
|
||||
Ajouter des éléments par simple clic
|
||||
</div>
|
||||
<div class='mt-1 d-inline-block mr-4 pointer' onclick='collection_items_filtre(\"cochertout\")'>
|
||||
Tout cocher
|
||||
</div>
|
||||
<div class='mt-1 d-inline-block mr-4 pointer' onclick='collection_items_filtre(\"cocherrien\")'>
|
||||
Tout décocher
|
||||
</div>
|
||||
<div class='mt-1 d-inline-block mr-4 pointer' onclick='collection_items_filtre(\"showselect\")'>
|
||||
Ne montrer que la sélection
|
||||
</div>
|
||||
<div class='mt-1 d-inline-block mr-4 pointer' onclick='collection_items_filtre(\"showall\")'>
|
||||
Montrer tout
|
||||
</div>
|
||||
</div>";*/
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user