forked from ZwiiCMS-Team/ZwiiCMS
init + améliorer la notification finale.
This commit is contained in:
parent
b54f2ed9bc
commit
54b5efd1d8
@ -346,8 +346,8 @@ core.start = function() {
|
||||
var ratio = width / height;
|
||||
if ( ($(window).width() / ratio) <= height) {
|
||||
$("header").height( $(window).width() / ratio );
|
||||
$("header").css("line-height", $(window).width() / ratio + "px");
|
||||
}
|
||||
$("header").css("line-height", $(window).width() / ratio + "px");
|
||||
}
|
||||
}
|
||||
}).trigger("resize");
|
||||
|
||||
@ -389,7 +389,7 @@ core.relativeLuminanceW3C = function(rgba) {
|
||||
|
||||
$(document).ready(function(){
|
||||
/**
|
||||
* Affiche le sous-menu quand il est sticky
|
||||
* Affiche le sous-menu quand il est sticky
|
||||
*/
|
||||
$("nav").mouseenter(function(){
|
||||
$("#navfixedlogout .navLevel2").css({ 'pointer-events' : 'auto' });
|
||||
@ -414,7 +414,7 @@ $(document).ready(function(){
|
||||
// on récupère la valeur data-speed si elle existe
|
||||
var toggleSpeed = accordion.attr('data-speed') || 100;
|
||||
|
||||
// fonction pour afficher un élément
|
||||
// fonction pour afficher un élément
|
||||
function open(item, speed) {
|
||||
// on récupère tous les éléments, on enlève l'élément actif de ce résultat, et on les cache
|
||||
accordion.find('.accordion-item').not(item).removeClass('active')
|
||||
@ -428,32 +428,32 @@ $(document).ready(function(){
|
||||
.find('.accordion-content').slideUp(speed);
|
||||
}
|
||||
|
||||
// on initialise l'accordéon, sans animation
|
||||
// on initialise l'accordéon, sans animation
|
||||
open(accordion.find('.active:first'), 0);
|
||||
|
||||
// au clic sur un titre...
|
||||
accordion.on('click', '.accordion-title', function(ev) {
|
||||
ev.preventDefault();
|
||||
ev.preventDefault();
|
||||
// Masquer l'élément déjà actif
|
||||
if ($(this).closest('.accordion-item').hasClass('active')) {
|
||||
close($(this).closest('.accordion-item'), toggleSpeed);
|
||||
} else {
|
||||
// ...on lance l'affichage de l'élément, avec animation
|
||||
open($(this).closest('.accordion-item'), toggleSpeed);
|
||||
// ...on lance l'affichage de l'élément, avec animation
|
||||
open($(this).closest('.accordion-item'), toggleSpeed);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Icône du Menu Burger
|
||||
* Icône du Menu Burger
|
||||
*/
|
||||
$("#toggle").click(function() {
|
||||
$("#toggle").click(function() {
|
||||
var changeIcon = $('#toggle').children("span");
|
||||
if ( $(changeIcon).hasClass('zwiico-menu') ) {
|
||||
$(changeIcon).removeClass('zwiico-menu').addClass('zwiico-cancel');
|
||||
}
|
||||
else {
|
||||
else {
|
||||
$(changeIcon).addClass('zwiico-menu');
|
||||
};
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -455,7 +455,7 @@ header .container {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* Menu
|
||||
/* Menu
|
||||
body > nav {
|
||||
margin: 0 -10px;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* * @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @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.com/
|
||||
@ -246,8 +246,12 @@ class config extends common {
|
||||
// Creation du ZIP
|
||||
$filter = $this->getInput('configBackupOption',helper::FILTER_BOOLEAN) === true ? ['backup','tmp'] : ['backup','tmp','file'];
|
||||
$fileName = helper::autoBackup(self::TEMP_DIR,$filter);
|
||||
if (!is_dir(self::FILE_DIR.'source/backup')) {
|
||||
mkdir(self::FILE_DIR.'source/backup');
|
||||
}
|
||||
copy (self::TEMP_DIR . $fileName , self::FILE_DIR.'source/backup/' . $fileName);
|
||||
|
||||
// Téléchargement du ZIP
|
||||
/*// Téléchargement du ZIP // NE marche pas avec le spinner
|
||||
header('Content-Type: application/zip');
|
||||
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
||||
header('Content-Length: ' . filesize(self::TEMP_DIR . $fileName));
|
||||
@ -256,6 +260,7 @@ class config extends common {
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_RAW
|
||||
]);
|
||||
*/
|
||||
unlink(self::TEMP_DIR . $fileName);
|
||||
} else {
|
||||
// Valeurs en sortie
|
||||
|
@ -12,4 +12,38 @@
|
||||
* @link http://zwiicms.com/
|
||||
*/
|
||||
|
||||
@import url("site/data/admin.css");
|
||||
@import url("site/data/admin.css");
|
||||
|
||||
/**
|
||||
* Effet d'animation
|
||||
*/
|
||||
/* Start by setting display:none to make this hidden.
|
||||
Then we position it in relation to the viewport window
|
||||
with position:fixed. Width, height, top and left speak
|
||||
for themselves. Background we set to 80% white with
|
||||
our animation centered, and no-repeating */
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: rgba( 255, 255, 255, .2 )
|
||||
url('core/vendor/zwiico/img/ajax-loader.gif')
|
||||
50% 50%
|
||||
no-repeat;
|
||||
}
|
||||
|
||||
/* When the body has the loading class, we turn
|
||||
the scrollbar off with overflow:hidden */
|
||||
body.loading .modal {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Anytime the body has the loading class, our
|
||||
modal element will be visible */
|
||||
body.loading .modal {
|
||||
display: block;
|
||||
}
|
31
core/module/config/view/backup/backup.js.php
Normal file
31
core/module/config/view/backup/backup.js.php
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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.com/
|
||||
*/
|
||||
|
||||
$( document).ready(function() {
|
||||
$("#configBackupForm").submit( function(e){
|
||||
console.log('click');
|
||||
e.preventDefault();
|
||||
$("body").addClass("loading");
|
||||
var url = "<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: $("form").serialize(),
|
||||
complete: function(r, s){
|
||||
$("body").removeClass("loading");
|
||||
$("body").append("<div id='notification' class='notificationSuccess'>Sauvegarde générée avec succès !</div>");
|
||||
$("#notification").delay("3000").fadeOut("1000");
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -10,10 +10,11 @@
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('configBackupSubmit',[
|
||||
'value' => 'Valider',
|
||||
'ico' => 'check'
|
||||
]); ?>
|
||||
'value' => 'Sauvegarder',
|
||||
'ico' => 'download-cloud'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="modal"><!-- Emplacement pour l'animation --></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
@ -26,6 +27,9 @@
|
||||
'help' => 'Cette option n\'est pas recommandée lorsque le contenu du gestionnaire de fichiers est très volumineux.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<em>Le fichier de sauvegarde est généré dans <a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=backup&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity>le dossier Backup</a> du gestionnaire de fichiers.</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,8 +10,8 @@
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('configManageSubmit',[
|
||||
'value' => 'Valider',
|
||||
'ico' => 'check'
|
||||
'value' => 'Restaurer',
|
||||
'ico' => 'upload'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* 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 Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @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.com/
|
||||
*/
|
||||
|
||||
@import url("site/data/admin.css");
|
@ -1,85 +0,0 @@
|
||||
<?php echo template::formOpen('configRestoreForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('configRestoreBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'config',
|
||||
'ico' => 'left',
|
||||
'value' => 'Retour'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('configRestoreSubmit',[
|
||||
'value' => 'Restaurer',
|
||||
'ico' => 'upload'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Restauration ou transfert d'un site</h4>
|
||||
<div class="row">
|
||||
<div class="col8 offset2">
|
||||
<?php echo template::file('configRestoreImportFile', [
|
||||
'label' => 'Sélectionnez une sauvegarde au format ZIP',
|
||||
'type' => 2,
|
||||
'help' => 'L\'archive a été déposée dans le gestionnaire de fichiers. Les archives inférieures à la version 9 ne sont pas acceptées.'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col8 offset2">
|
||||
<?php echo template::checkbox('configRestoreImportUser', true, 'Préserver les comptes des utilisateurs', [
|
||||
'checked' => true,
|
||||
'help' => 'Les données des utilisateurs installés ne sont pas écrasés par la restauration quand l\'option est active.'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Conversion des URL après transfert de site</h4>
|
||||
<div class="row">
|
||||
<div class="col5">
|
||||
<?php
|
||||
if (is_null($this->getData(['core', 'baseUrl'])) ) {
|
||||
$baseUrlValue = 'Pas de donnée dans la sauvegarde';
|
||||
$buttonClass = 'disabled';
|
||||
} elseif ($this->getData(['core', 'baseUrl']) === '') {
|
||||
$baseUrlValue = '/';
|
||||
$buttonClass = (helper::baseUrl(true,false) !== $this->getData(['core', 'baseUrl']) ) ? '' : 'disabled';
|
||||
} else {
|
||||
$baseUrlValue = $this->getData(['core', 'baseUrl']);
|
||||
$buttonClass = (helper::baseUrl(true,false) !== $this->getData(['core', 'baseUrl']) ) ? '' : 'disabled';
|
||||
}
|
||||
echo template::text('configRestoreBaseURLToConvert', [
|
||||
'label' => 'Dossier d\'installation de l\'archive' ,
|
||||
'value' => $baseUrlValue,
|
||||
'readonly' => true,
|
||||
'help' => 'Lors de la restauration d\'un backup d\'une version 9.2.10 ou supérieure, l\'URL de base est stockée dans la configuration sinon cette donnée est vide.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::text('configRestoreCurrentURL', [
|
||||
'label' => 'Dossier du site actuel',
|
||||
'value' => helper::baseUrl(true,false),
|
||||
'readonly' => true,
|
||||
'help' => 'Dossier du site installé.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 verticalAlignBottom">
|
||||
<?php echo template::button('configRestoreUpdateBaseURLButton', [
|
||||
'href' => helper::baseUrl() . 'config/updateBaseUrl',
|
||||
'class' => $buttonClass,
|
||||
'value' => 'convertir'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
@ -669,7 +669,7 @@ class theme extends common {
|
||||
unlink (self::TEMP_DIR . $zipFilename);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => 'Archive <b>'.$zipFilename.'</b> sauvegardée dans fichiers',
|
||||
'notification' => 'Archive <b>'.$zipFilename.'</b> sauvegardée avec succès',
|
||||
'redirect' => helper::baseUrl() . 'theme/manage',
|
||||
'state' => true
|
||||
]);
|
||||
|
@ -26,7 +26,7 @@
|
||||
<?php echo template::submit('themeImportSubmit', [
|
||||
'value' => 'Appliquer'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -49,6 +49,11 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<em>Le fichier de sauvegarde est généré dans <a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=theme&type=0&akey=<?php echo md5_file(self::DATA_DIR.'core.json'); ?>" data-lity>le dossier Thème</a> du gestionnaire de fichiers.</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block">
|
||||
<h4>Télécharger le thème</h4>
|
||||
@ -59,16 +64,16 @@
|
||||
'ico' => 'download',
|
||||
'value' => 'Thème site'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::button('themeExport', [
|
||||
'href' => helper::baseUrl() . 'theme/export/admin',
|
||||
'ico' => 'download',
|
||||
'value' => 'Thème administration'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
|
BIN
core/vendor/zwiico/img/ajax-loader.gif
vendored
Normal file
BIN
core/vendor/zwiico/img/ajax-loader.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 673 B |
Loading…
Reference in New Issue
Block a user