ZwiiCMS/core/module/config/view/backup/backup.js.php

40 lines
1.4 KiB
PHP
Raw Normal View History

/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
$( document).ready(function() {
$("#configBackupForm").submit( function(e){
2020-08-09 18:11:49 +02:00
$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
e.preventDefault();
$("body").addClass("loading");
2020-08-09 18:32:16 +02:00
$(".modal").addClass("alertMessage");
var url = "<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup";
$.ajax({
type: "POST",
url: url,
data: $("form").serialize(),
2020-08-09 12:00:29 +02:00
success: function(data){
$("body").removeClass("loading");
2020-08-09 12:00:29 +02:00
core.alert("La sauvegarde a été générée avec succès.");
},
error: function(data){
$("body").removeClass("loading");
core.alert("Une erreur s'est produite, la sauvegarde n'a pas été générée !");
2020-08-09 18:11:49 +02:00
},
complete: function(){
$("#configBackupSubmit").removeClass("disabled").prop("disabled", false);
2020-08-09 18:32:16 +02:00
$(".modal").removeClass("alertMessage");
}
});
});
});