Merge branch '10603' into 11000

This commit is contained in:
Fred Tempez 2021-06-04 11:47:56 +02:00
commit 70a3030afc
208 changed files with 536 additions and 1138 deletions

4
.gitignore vendored
View File

@ -1,6 +1,4 @@
# Fichiers de données
# Fichiers du site
site/*
# Dossiers vides dans GitHub

0
.htaccess Executable file → Normal file
View File

View File

@ -1,17 +1,11 @@
# Changelog
## Version 11.0.00
## version 10.6.03
- Correction :
- Module actualités (news), version 3.3, le flux RSS affiche l'ensemble des articles plutôt que ceux de la page courante.
- Modifications :
- Gestion multi-langues
- Traduction rédigée dans une langue européenne
- Traduction automatique dans une langue européenne
- Traduction selon la langue navigateur
- Configuration du site :
- Activation et désactivation de la déconnexion automatique empêchant plusieurs sessions avec le même compte.
- Suppression de l'option articles par pages.
- Suppression de l'option de backup individuel des fichiers de données, pour l'activer manuellement, créez un fichier vide .backup dans site/data
- Nouvelle option permettant de transférer les fichiers de sauvegarde automatiques dans le gestionnaire de fichiers.
- Installation : livraison des fichiers de thème du site de test dans une archive. Désormais, le dossier site ne contiendra que les fichiers de sécurité htaccess. Cette procédure permettra de ne plus différencier les archives d'installation et de mise à jour.
- Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que sur le site.
## version 10.6.03
- Correction :
@ -21,8 +15,8 @@
- Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que par le site.
## version 10.6.02
Correction :
- Bug lors du téléchargement des journaux.
- Correction :
- Débordement lors du téléchargement des fichiers journaux.
## version 10.6.01
Corrections :

0
core/class/.htaccess Executable file → Normal file
View File

0
core/class/autoload.php Executable file → Normal file
View File

0
core/class/helper.class.php Executable file → Normal file
View File

0
core/class/jsondb/Dot.class.php Executable file → Normal file
View File

0
core/class/jsondb/JsonDb.class.php Executable file → Normal file
View File

0
core/class/phpmailer/.htaccess Executable file → Normal file
View File

0
core/class/phpmailer/Exception.class.php Executable file → Normal file
View File

0
core/class/phpmailer/PHPMailer.class.php Executable file → Normal file
View File

0
core/class/phpmailer/SMTP.class.php Executable file → Normal file
View File

0
core/class/sitemap/FileSystem.class.php Executable file → Normal file
View File

0
core/class/sitemap/Runtime.class.php Executable file → Normal file
View File

0
core/class/sitemap/SitemapGenerator.class.php Executable file → Normal file
View File

0
core/class/template.class.php Executable file → Normal file
View File

1
core/core.js.php Executable file → Normal file
View File

@ -482,6 +482,7 @@ $(document).ready(function(){
* Active le système d'aide interne
*
*/
$(".buttonHelp").on({
click: function () {
$(".helpDisplayContent").slideToggle();

0
core/layout/blank.php Executable file → Normal file
View File

View File

@ -29,7 +29,7 @@ body {
}
@media screen and (min-width: 769px) {
@media (min-width: 769px) {
body {
/*margin:0px 10px;*/
margin: 0;
@ -41,7 +41,7 @@ body {
/**
* Petits écrans inférieurs à 768px de largeur, on supprime les marges
*/
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
body {
margin: 0px;
}
@ -65,7 +65,7 @@ body {
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
.siteContainer {
display: flex;
flex-direction: column;
@ -237,12 +237,12 @@ td>.col12 {
}
/* Tableau sur les écrans de petites tailles */
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
.table thead {
font-size: 0.8em;
}
}
@media screen and (max-width: 668px) {
@media (max-width: 668px) {
.table thead {
display:none;
}
@ -408,7 +408,7 @@ td>.col12 {
background-color: rgba(255, 255, 255, 1);
}
@media screen and (min-width: 769px) {
@media (min-width: 769px) {
#bar #barLeft {
float: left;
}
@ -419,7 +419,7 @@ td>.col12 {
}
}
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
#bar {
text-align: center;
padding: 0 1;
@ -455,7 +455,7 @@ td>.col12 {
overflow: hidden;
}
/* Dans theme.css
@media screen and (min-width:768px) {
@media (min-width:768px) {
#site {
margin: 20px auto;
}
@ -464,7 +464,7 @@ td>.col12 {
/* Bannière */
@media screen and (min-width:768px) {
@media (min-width:768px) {
body>header {
margin: 0;
/*-10px;*/
@ -598,13 +598,13 @@ nav::before {
display: flex;
}
@media screen and (min-width: 769px) {
@media (min-width: 769px) {
nav #menu {
display: block;
}
}
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
body>nav {
margin: 0;
}
@ -691,66 +691,41 @@ li .menuSideChild {
/* Container des drapeaux */
#i18nContainerNav, #i18nContainerSite {
#i18nContainer {
z-index: 100;
position: relative ;
float: right;
width: auto;
height: auto;
margin-top: -25px;
}
#i18nContainerNav ul, #i18nContainerSite ul {
#i18nContainer ul {
list-style: none;
}
#i18nContainerNav li, #i18nContainerSite li {
#i18nContainer li {
display: inline-block;
position: relative;
}
#i18nFlag {
width: 70%;
}
#i18nFlagSelected {
width: 100%;
#i18nContainer img {
width: 80%;
}
/*
* Position du bloc dans le site sur les petits écrans
*/
#i18nContainerNav {
display: block;
}
#i18nContainerSite {
display: none;
#i18nContainer img {
margin: 2px;
}
@media screen and (max-width:1024px){
#i18nContainerNav {
display: none;
}
#i18nContainerSite {
display: block;
margin-top: -10px;
}
#i18nFlag {
width: 100%;
padding: 5px;
}
#i18nFlagSelected {
width: 130%;
padding: 5px;
}
}
/* Corps */
@media screen and (min-width:768px) {
@media (min-width:768px) {
section {
padding: 20px;
}
@ -847,7 +822,7 @@ footer #footerbody>div {
}
/* Conserve le pied de page sur une ligne */
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
body>footer {
margin: 0;
}
@ -1056,7 +1031,6 @@ footer #footerSocials .zwiico-github:hover {
user-select: none;
}
/* Lightbox */
.lightbox {
background: #FFF;
@ -1393,7 +1367,7 @@ input[type='checkbox']:disabled+label:before {
display: inline-block;
}
@media screen and (min-width: 769px) {
@media (min-width: 769px) {
.col1 {
width: 8.33333333%;
}
@ -1582,7 +1556,7 @@ th.col12 {
}
/* Tableau sur les écrans de très petites tailles */
@media screen and (max-width: 480px){
@media (max-width: 480px){
.table tr{
display: block;
margin-bottom: 10px;

0
core/layout/light.php Executable file → Normal file
View File

0
core/layout/mail.php Executable file → Normal file
View File

2
core/layout/main.php Executable file → Normal file
View File

@ -59,6 +59,7 @@
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<!-- Bannière dans le fond du site -->
<header>
<?php //$layout->showi18n();?>
<?php
if ($this->getData(['theme','header','linkHomePage'])){
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
@ -152,6 +153,7 @@
<?php endif; ?>
<!-- Corps de page -->
<section>
<?php //$layout->showi18n();?>
<?php
// Gabarit :
// Récupérer la config de la page courante

View File

@ -20,33 +20,21 @@ class addon extends common {
public static $actions = [
'index' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'moduleDelete' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'store' => self::GROUP_ADMIN,
'item' => self::GROUP_ADMIN,
'upload' => self::GROUP_ADMIN,
'uploadItem'=> self::GROUP_ADMIN
'import' => self::GROUP_ADMIN
];
const URL_STORE = 'http://zwiicms.fr/?modules/';
const BASEURL_STORE = 'http://zwiicms.fr/';
// Gestion des modules
public static $modInstal = [];
// pour tests
public static $valeur = [];
// le catalogue
public static $storeList = [];
public static $storeItem = [];
/*
* Effacement d'un module installé et non utilisé
*/
public function delete() {
public function moduleDelete() {
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
@ -84,14 +72,63 @@ class addon extends common {
}
}
/***
* Installation d'un module
* Fonction utilisée par upload et storeUpload
/**
* Gestion des modules
*/
private function install ($moduleName, $checkValid){
public function index() {
// Lister les modules
// $infoModules[nom_module]['realName'], ['version'], ['update'], ['delete'], ['dataDirectory']
$infoModules = helper::getModules();
// Clés moduleIds dans les pages
$inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC');
foreach( $inPages as $key=>$value){
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
}
// Parcourir les données des modules
foreach ($infoModules as $key=>$value) {
// Construire le tableau de sortie
self::$modInstal[] = [
$key,
$infoModules[$key]['realName'],
$infoModules[$key]['version'],
implode(', ', array_keys($inPagesTitle,$key)),
//array_key_exists('delete',$infoModules[$key]) && $infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$key)) === ''
$infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleDelete' . $key, [
'class' => 'moduleDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/moduleDelete/' . $key . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel')
])
: '',
implode(', ',array_keys($inPages,$key)) !== ''
? template::button('moduleExport' . $key, [
'href' => helper::baseUrl(). $this->getUrl(0) . '/export/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download')
])
: '',
implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleExport' . $key, [
'href' => helper::baseUrl(). $this->getUrl(0) . '/import/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('upload')
])
: ''
];
}
// Retour du formulaire ?
if($this->isPost()) {
// Installation d'un module
$success = true;
$checkValidMaj = $this->getInput('configModulesCheck', helper::FILTER_BOOLEAN);
$zipFilename = $this->getInput('configModulesInstallation', helper::FILTER_STRING_SHORT);
if( $zipFilename !== ''){
$tempFolder = 'datamodules';//uniqid();
$zip = new ZipArchive();
if ($zip->open($moduleName) === TRUE) {
if ($zip->open(self::FILE_DIR.'source/'.$zipFilename) === TRUE) {
$notification = 'Archive ouverte';
mkdir (self::TEMP_DIR . $tempFolder);
$zip->extractTo(self::TEMP_DIR . $tempFolder );
@ -134,13 +171,12 @@ class addon extends common {
$update = substr($file, $posdeb + 1, $posend - $posdeb - 1);
}
// Si version actuelle >= version indiquée dans UPDATE la mise à jour est validée
$infoModules = helper::getModules();
if( $infoModules[$moduleName]['update'] >= $update ) $valUpdate = true;
// Module déjà installé ?
$moduleInstal = false;
foreach($infoModules as $key=>$value ){
if($moduleName === $key){
foreach( self::$modInstal as $key=>$value){
if($moduleName === $value[0]){
$moduleInstal = true;
}
}
@ -151,12 +187,12 @@ class addon extends common {
$valInstalVersion = floatval( $infoModules[$moduleName]['version'] );
$newVersion = false;
if( $valNewVersion > $valInstalVersion ) $newVersion = true;
$validMaj = $valUpdate && ( $newVersion || $checkValid);
$validMaj = $valUpdate && ( $newVersion || $checkValidMaj);
// Nouvelle installation ou mise à jour du module
if( ! $moduleInstal || $validMaj ){
// Copie récursive des dossiers
$this->copyDir( self::TEMP_DIR . $tempFolder, './' );
$this -> custom_copy( self::TEMP_DIR . $tempFolder, './' );
$success = true;
if( ! $moduleInstal ){
$notification = 'Module '.$moduleName.' installé';
@ -192,212 +228,18 @@ class addon extends common {
$success = false;
$notification = 'Impossible d\'ouvrir l\'archive';
}
return(['success' => $success,
'notification'=> $notification
]);
}
/***
* Installation d'un module à partir du gestionnaire de fichier
*/
public function upload() {
// Soumission du formulaire
if($this->isPost()) {
// Installation d'un module
$checkValidMaj = $this->getInput('configModulesCheck', helper::FILTER_BOOLEAN);
$zipFilename = $this->getInput('configModulesInstallation', helper::FILTER_STRING_SHORT);
if( $zipFilename !== ''){
$success = [
'success' => false,
'notification'=> ''
];
$state = $this->install(self::FILE_DIR.'source/'.$zipFilename, $checkValidMaj);
}
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => $state['notification'],
'state' => $state['success']
'notification' => $notification,
'state' => $success
]);
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Téléverser un module',
'view' => 'upload'
]);
}
/***
* Installation d'un module par le catalogue
*/
public function uploadItem() {
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'store',
'state' => false,
'notification' => 'Action non autorisée'
]);
} else {
// Récupérer le module en ligne
$moduleName = $this->getUrl(2);
// Informations sur les module en ligne
$store = json_decode(helper::urlGetContents(self::URL_STORE . 'list'), true);
// Url du module à télécharger
$moduleFilePath = $store[$moduleName]['file'];
// Télécharger le fichier
$moduleData = helper::urlGetContents(self::BASEURL_STORE . self::FILE_DIR . 'source/' . $moduleFilePath);
// Extraire de l'arborescence
$d = explode('/',$moduleFilePath);
$moduleFile = $d[count($d)-1];
// Créer le dossier modules
if (!is_dir(self::FILE_DIR . 'source/modules')) {
mkdir (self::FILE_DIR . 'source/modules');
}
// Sauver les données du fichiers
file_put_contents(self::FILE_DIR . 'source/modules/' . $moduleFile, $moduleData);
/**
* $if( $moduleFile !== ''){
* $success = [
* 'success' => false,
* 'notification'=> ''
* ];
* $state = $this->install(self::FILE_DIR.'source/modules/'.$moduleFile, false);
*}
*/
$this->addOutput([
'redirect' => helper::baseUrl() . 'addon/store',
'notification' => $moduleFile . ' téléchargé dans le dossier modules du gestionnaire de fichiers',
'state' => true
]);
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Catalogue de modules',
'view' => 'store'
]);
}
/**
* Catalogue des modules sur le site ZwiiCMS.fr
*/
public function store() {
$store = json_decode(helper::urlGetContents(self::URL_STORE . 'list'), true);
if ($store) {
// Modules installés
$infoModules = helper::getModules();
// Clés moduleIds dans les pages
$inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC');
foreach( $inPages as $key=>$value){
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
}
// Parcourir les données des modules
foreach ($store as $key=>$value) {
// Module non installé
$ico = template::ico('download');
$class = '';
// Le module est installé
if (array_key_exists($key,$infoModules) === true) {
$class = 'buttonGreen';
$ico = template::ico('update');
}
// Le module est installé et utilisé
if (in_array($key,$inPages) === true) {
$class = 'buttonRed';
$ico = template::ico('update');
}
self::$storeList [] = [
'<a href="' . self::URL_STORE . $key . '" target="_blank" >'.$store[$key]['title'].'</a>',
$store[$key]['fileVersion'],
mb_detect_encoding(strftime('%d %B %Y', $store[$key]['fileDate']), 'UTF-8', true)
? strftime('%d %B %Y', $store[$key]['fileDate'])
: utf8_encode(strftime('%d %B %Y', $store[$key]['fileDate'])),
implode(', ', array_keys($inPagesTitle,$key)),
template::button('moduleExport' . $key, [
'class' => $class,
'href' => helper::baseUrl(). $this->getUrl(0) . '/uploadItem/' . $key.'/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre
'value' => $ico
])
];
}
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Catalogue de modules en ligne',
'view' => 'store'
]);
}
/**
* Détail d'un objet du catalogue
*/
public function item() {
$store = json_decode(helper::urlGetContents(self::URL_STORE . 'list'), true);
self::$storeItem = $store [$this->getUrl(2)] ;
self::$storeItem ['fileDate'] = mb_detect_encoding(strftime('%d %B %Y',self::$storeItem ['fileDate']), 'UTF-8', true)
? strftime('%d %B %Y', self::$storeItem ['fileDate'])
: utf8_encode(strftime('%d %B %Y', self::$storeItem ['fileDate']));
// Valeurs en sortie
$this->addOutput([
'title' =>'Module ' . self::$storeItem['title'],
'view' => 'item'
]);
}
/**
* Gestion des modules
*/
public function index() {
// Lister les modules
// $infoModules[nom_module]['realName'], ['version'], ['update'], ['delete'], ['dataDirectory']
$infoModules = helper::getModules();
// Clés moduleIds dans les pages
$inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC');
foreach( $inPages as $key=>$value){
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
}
// Parcourir les données des modules
foreach ($infoModules as $key=>$value) {
// Construire le tableau de sortie
self::$modInstal[] = [
$key,
$infoModules[$key]['realName'],
$infoModules[$key]['version'],
implode(', ', array_keys($inPagesTitle,$key)),
//|| ('delete',$infoModules[$key]) && $infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$key)) === ''
$infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleDelete' . $key, [
'class' => 'moduleDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel')
])
: '',
implode(', ',array_keys($inPages,$key)) !== ''
? template::button('moduleExport' . $key, [
'href' => helper::baseUrl(). $this->getUrl(0) . '/export/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download')
])
: '',
implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleExport' . $key, [
'href' => helper::baseUrl(). $this->getUrl(0) . '/import/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('upload')
])
: ''
];
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Modules installés',
'title' => 'Gestion des modules',
'view' => 'index'
]);
}
@ -462,7 +304,7 @@ class addon extends common {
// Export des données localisées dans le dossier de données du module
if ($infoModules[$this->getUrl(2)]['dataDirectory'] &&
is_dir($infoModules[$this->getUrl(2)]['dataDirectory'])) {
$this->copyDir ($infoModules[$this->getUrl(2)]['dataDirectory'], $tmpFolder . '/' . $moduleDir);
$this->custom_copy ($infoModules[$this->getUrl(2)]['dataDirectory'], $tmpFolder . '/' . $moduleDir);
}
}
// Enregistrement des pages dans le dossier de langue identique à module
@ -473,13 +315,14 @@ class addon extends common {
$fileName = $this->getUrl(2) . '.zip';
$this->makeZip ($fileName, $tmpFolder, []);
if (file_exists($fileName)) {
ob_start();
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName));
ob_clean();
ob_end_flush();
readfile( $fileName);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
unlink($fileName);
$this->removeDir($tmpFolder);
exit();
@ -507,7 +350,7 @@ class addon extends common {
'notification' => 'Action non autorisée'
]);
}
else {
else{
// Soumission du formulaire
if($this->isPost()) {
// Récupérer le fichier et le décompacter
@ -553,7 +396,7 @@ class addon extends common {
}
// Import des fichiers placés ailleurs que dans les dossiers localisés.
$this->copyDir (self::TEMP_DIR . $tempFolder,self::DATA_DIR );
$this->custom_copy (self::TEMP_DIR . $tempFolder,self::DATA_DIR );
// Supprimer le dossier temporaire
$this->removeDir(self::TEMP_DIR . $tempFolder);
@ -581,4 +424,31 @@ class addon extends common {
}
}
/*
* Copie récursive de dossiers
*
*/
private function custom_copy($src, $dst) {
// open the source directory
$dir = opendir($src);
// Make the destination directory if not exist
if (!is_dir($dst)) {
mkdir($dst);
}
// Loop through the files in source directory
while( $file = readdir($dir) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) ){
// Recursively calling custom copy function
// for sub directory
$this -> custom_copy($src . '/' . $file, $dst . '/' . $file);
}
else {
copy($src . '/' . $file, $dst . '/' . $file);
}
}
}
closedir($dir);
}
}

View File

@ -1,4 +1,5 @@
<div class="row">
<?php echo template::formOpen('configModulesGestion'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('configModulesBack', [
'class' => 'buttonGrey',
@ -14,23 +15,43 @@
'value' => 'Aide'
]); ?>
</div>
<div class="col3 offset2">
<?php echo template::button('configStoreUpload', [
'href' => helper::baseUrl() . 'addon/upload',
'value' => 'Téléverser un module'
<div class="col2 offset6">
<?php echo template::submit('configModulesSubmit',[
'value' => 'Valider',
'ico' => 'check'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configModulesStore', [
'href' => helper::baseUrl() . 'addon/store',
'value' => 'Catalogue en ligne'
]); ?>
</div>
</div>
<!-- Aide à propos de la gestion des modules, view index -->
<div class="helpDisplayContent">
<!-- Aide à propos de la gestion des modules, view index -->
<div class="helpDisplayContent">
<?php echo file_get_contents( 'core/module/addon/view/index/index.help.html') ;?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Installer ou mettre à jour un module </h4>
<div class="row">
<div class="col6 offset3">
<?php echo template::file('configModulesInstallation', [
'label' => 'Archive ZIP :',
'type' => 2
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configModulesCheck', true, 'Mise à jour forcée', [
'checked' => false,
'help' => 'Permet de forcer une mise à jour même si la version du module est inférieure ou égale à celle du module installé.',
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<?php if($module::$modInstal): ?>
<?php echo template::table([2, 2, 2, 2, 1, 1, 1], $module::$modInstal, ['Module installé', 'Alias', 'Version', 'Page(s)', 'Supprimer', 'Exporter', 'Importer']); ?>
<?php else: ?>

View File

@ -1,14 +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-2021, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/

View File

@ -1,41 +0,0 @@
<div class="row">
<div class="col9">
<div class="row">
<div class="col12">
<?php echo $module::$storeItem['content']; ?>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php
echo '<img class="downloadItemPicture" src="' . $module::BASEURL_STORE . 'site/file/source/' . $module::$storeItem['picture'] .
'" alt="' . $module::$storeItem['picture'] . '">';
?>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<?php echo 'Version n°' . $module::$storeItem['fileVersion']; ?>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<?php echo ' du ' . $module::$storeItem['fileDate']; ?>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<span>Auteur :
<?php echo $module::$storeItem['fileAuthor']; ?>
</span>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<span>Licence :
<?php echo $module::$storeItem['fileLicense']; ?>
</span>
</div>
</div>
</div>

View File

@ -1,15 +0,0 @@
<div class="row">
<div class="col2">
<?php echo template::button('configStoreBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'addon',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
</div>
<?php if($module::$storeList): ?>
<?php echo template::table([4, 2, 2, 3, 1], $module::$storeList, ['Module', 'Version', 'Date', 'Pages', 'Télécharger']); ?>
<?php else: ?>
<?php echo template::speech('Le catalogue est vide.'); ?>
<?php endif; ?>

View File

@ -1,18 +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-2021, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,6 +0,0 @@
<h3>IMPORTER OU METTRE A JOUR</h3>
<p>Vous avez au préalable chargé le fichier zip du module sur votre serveur en utilisant le 'Catalogue en ligne', écran précédent.</p>
<p>D'autres modules sont également disponibles sur le <a href="https://forum.zwiicms.fr/categories/t%C3%A9l%C3%A9chargements-de-modules" target="_blank" rel="noopener">forum de ZwiiCMS</a>,
téléversez les sur votre serveur avec 'Gérer les fichiers'.</p>
<p>Lors d'une mise à jour Zwii contrôle la version du module à installer, pour réinstaller un module de même numéro de version vous devez cocher 'Mise à jour forcée'.
Il est déconseillé d'installer un module plus ancien.</p>

View File

@ -1,52 +0,0 @@
<?php echo template::formOpen('configModulesUpload'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('configModulesBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'addon',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2">
<?php echo template::button('addonIndexHelp', [
'class' => 'buttonHelp',
'ico' => 'help',
'value' => 'Aide'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('configModulesSubmit',[
'value' => 'Valider',
'ico' => 'check'
]); ?>
</div>
</div>
<!-- Aide à propos de la gestion des modules, view upload -->
<div class="helpDisplayContent">
<?php echo file_get_contents( 'core/module/addon/view/upload/upload.help.html') ;?>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Installer ou mettre à jour un module </h4>
<div class="row">
<div class="col6 offset3">
<?php echo template::file('configModulesInstallation', [
'label' => 'Archive ZIP :',
'type' => 2
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configModulesCheck', true, 'Mise à jour forcée', [
'checked' => false,
'help' => 'Permet de forcer une mise à jour même si la version du module est inférieure ou égale à celle du module installé.',
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

87
core/module/config/config.php Executable file → Normal file
View File

@ -18,19 +18,17 @@ class config extends common {
public static $actions = [
'backup' => self::GROUP_ADMIN,
'copyBackups'=> self::GROUP_ADMIN,
'configMetaImage' => self::GROUP_ADMIN,
'generateFiles' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'advanced' => self::GROUP_ADMIN,
'restore' => self::GROUP_ADMIN,
'manage' => self::GROUP_ADMIN,
'updateBaseUrl' => self::GROUP_ADMIN,
'script' => self::GROUP_ADMIN,
'logReset' => self::GROUP_ADMIN,
'logDownload'=> self::GROUP_ADMIN,
'blacklistReset' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN
];
public static $timezones = [
@ -267,11 +265,11 @@ class config extends common {
/**
* Procédure d'importation
*/
public function restore() {
public function manage() {
// Soumission du formulaire
if($this->isPost()) {
//if ($this->getInput('configRestoreImportFile'))
$fileZip = $this->getInput('configRestoreImportFile');
//if ($this->getInput('configManageImportFile'))
$fileZip = $this->getInput('configManageImportFile');
$file_parts = pathinfo($fileZip);
$folder = date('Y-m-d-h-i-s', time());
$zip = new ZipArchive();
@ -279,7 +277,7 @@ class config extends common {
// Valeurs en sortie erreur
$this->addOutput([
'notification' => 'Le fichier n\'est pas une archive valide',
'redirect' => helper::baseUrl() . 'config/restore',
'redirect' => helper::baseUrl() . 'config/manage',
'state' => false
]);
}
@ -288,7 +286,7 @@ class config extends common {
// Valeurs en sortie erreur
$this->addOutput([
'notification' => 'Impossible de lire l\'archive',
'redirect' => helper::baseUrl() . 'config/restore',
'redirect' => helper::baseUrl() . 'config/manage',
'state' => false
]);
}
@ -313,21 +311,21 @@ class config extends common {
// V10 valide
$version = '10';
// Option active, les users sont stockées
if ($this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ) {
if ($this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true ) {
$users = $this->getData(['user']);
}
} else { // Version invalide
// Valeurs en sortie erreur
$this->addOutput([
'notification' => 'Cette archive n\'est pas une sauvegarde valide',
'redirect' => helper::baseUrl() . 'config/restore',
'redirect' => helper::baseUrl() . 'config/manage',
'state' => false
]);
}
// Préserver les comptes des utilisateurs d'une version 9 si option cochée
// Positionnement d'une variable de session lue au constructeurs
if ($version === '9') {
$_SESSION['KEEP_USERS'] = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN);
$_SESSION['KEEP_USERS'] = $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN);
}
// Extraire le zip ou 'site/'
$success = $zip->extractTo( 'site/' );
@ -337,13 +335,13 @@ class config extends common {
// Restaurer les users originaux d'une v10 si option cochée
if (!empty($users) &&
$version === '10' &&
$this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true) {
$this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) {
$this->setData(['user',$users]);
}
// Message de notification
$notification = $success === true ? 'Restauration réalisée avec succès' : 'Erreur inconnue';
$redirect = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/restore' : helper::baseUrl() . 'user/login/';
$redirect = $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/manage' : helper::baseUrl() . 'user/login/';
// Valeurs en sortie erreur
$this->addOutput([
'notification' => $notification,
@ -355,7 +353,7 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'title' => 'Restaurer',
'view' => 'restore'
'view' => 'manage'
]);
}
@ -398,10 +396,9 @@ class config extends common {
'legalPageId' => $legalPageId,
'searchPageId' => $searchPageId,
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true)
]
]);
$this->setData(['config', 'i18n', 'enabled', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]);
// Générer robots.txt et sitemap
$this->generateFiles();
// Valeurs en sortie
@ -431,11 +428,6 @@ class config extends common {
$this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]);
}
// Eviter déconnexion automatique après son activation
if ( $this->getData(['config','autoDisconnect']) === false
AND $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN) === true ) {
$this->setData(['user',$this->getuser('id'),'accessCsrf',$_SESSION['csrf']]);
}
// Sauvegarder
$this->setData([
'config',
@ -463,7 +455,6 @@ class config extends common {
'proxyUrl' => $this->getInput('configAdvancedProxyUrl'),
'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT),
'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN),
'autoDisconnect' => $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN),
'smtp' => [
'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT),
@ -479,23 +470,22 @@ class config extends common {
'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
],
'i18n' => [
'enabled' => $this->getData(['config', 'i18n', 'enabled']),
'scriptGoogle' => $this->getData(['config', 'i18n', 'scriptGoogle']),
'showCredits' => $this->getData(['config', 'i18n', 'showCredits']),
'autoDetect' => $this->getData(['config', 'i18n', 'autoDetect']),
'admin' => $this->getData(['config', 'i18n', 'admin']),
'fr' => $this->getData(['config', 'i18n', 'fr']),
'de' => $this->getData(['config', 'i18n', 'de']),
'en' => $this->getData(['config', 'i18n', 'en']),
'es' => $this->getData(['config', 'i18n', 'es']),
'it' => $this->getData(['config', 'i18n', 'it']),
'nl' => $this->getData(['config', 'i18n', 'nl']),
'pt' => $this->getData(['config', 'i18n', 'pt']),
]
]
]);
// Efface les fichiers de backup lorsque l'option est désactivée
if ($this->getInput('configAdvancedFileBackup', helper::FILTER_BOOLEAN) === false) {
$path = realpath('site/data');
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename)
{
if (strpos($filename,'backup.json')) {
unlink($filename);
}
}
if (file_exists('site/data/.backup')) unlink('site/data/.backup');
} else {
touch('site/data/.backup');
}
// Notice
if(self::$inputNotices === []) {
// Active la réécriture d'URL
@ -622,7 +612,7 @@ class config extends common {
// Valeurs en sortie
$this->addOutput([
'notification' => $success ? $c3. ' conversion' . ($c3 > 1 ? 's' : '') . ' effectuée' . ($c3 > 1 ? 's' : '') : 'Aucune conversion',
'redirect' => helper::baseUrl() . 'config/restore',
'redirect' => helper::baseUrl() . 'config/manage',
'state' => $success ? true : false
]);
}
@ -739,27 +729,6 @@ class config extends common {
}
}
/**
* Récupération des backups auto dans le gestionnaire de fichiers
*/
public function copyBackups() {
// Créer le répertoire manquant
if (!is_dir(self::FILE_DIR.'source/backup')) {
mkdir(self::FILE_DIR.'source/backup');
}
$success = $this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup' );
// Effacer htaccess
if (file_exists(self::FILE_DIR.'source/backup/.htaccess')) {
unlink(self::FILE_DIR.'source/backup/.htaccess');
}
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/advanced',
'notification' => $success ? 'Copie terminée avec succès' : 'Echec de la copie',
'state' => $success
]);
}
/**
* Fonction de parcours des données de module

View File

@ -27,28 +27,25 @@
<div class="col12">
<div class="block">
<h4>Maintenance</h4>
<div class="row">
<div class="col4">
<div class="col3">
<?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::button('configBackupButton', [
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder',
'ico' => 'download-cloud'
'ico' => 'download'
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::button('configRestoreButton', [
'href' => helper::baseUrl() . 'config/restore',
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/manage',
'value' => 'Restaurer',
'ico' => 'upload-cloud'
'ico' => 'upload'
]); ?>
</div>
</div>
</div>
</div>
</div>
@ -56,6 +53,7 @@
<div class="col12">
<div class="block">
<h4>Réglages</h4>
<?php $error = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::file('configAdvancedFavicon', [
@ -82,44 +80,36 @@
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAdvancedCookieConsent', true, 'Message de consentement aux cookies', [
'checked' => $this->getData(['config', 'cookieConsent']),
'help' => 'Activation obligatoire selon les lois françaises sauf si vous utilisez votre propre système de consentement.'
<div class="col4">
<?php echo template::checkbox('configAdvancedCookieConsent', true, 'Consentement aux cookies', [
'checked' => $this->getData(['config', 'cookieConsent'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('rewrite', true, 'URL intelligentes', [
'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur autorise l\'URL rewriting (ce qui n\'est pas le cas chez Free).'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAdvancedCaptchaStrong', true, 'Captcha complexe', [
<div class="col4">
<?php echo template::checkbox('configAdvancedCaptchaStrong', true, 'Captcha renforcé', [
'checked' => $this->getData(['config','captchaStrong']),
'help' => 'Option recommandée pour sécuriser la connexion. S\'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.'
'help' => 'Option recommandée pour sécuriser la connexion. S\'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha renforcé utilise quatre opérations de nombres de 0 à 20.'
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('configAdvancedAutoDisconnect', true, 'Déconnexion automatique de la session', [
'checked' => $this->getData(['config','autoDisconnect']),
'help' => 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.'
<div class="col4">
<?php echo template::checkbox('rewrite', true, 'Réécriture d\'URL', [
'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur l\'autorise : ce n\'est pas le cas chez Free.'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAdvancedAutoBackup', true, 'Sauvegarde automatique quotidienne du site', [
<div class="col4">
<?php echo template::checkbox('configAdvancedAutoBackup', true, 'Sauvegarde quotidienne', [
'checked' => $this->getData(['config', 'autoBackup']),
'help' => 'Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours puis effacée.</p><p>Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.'
'help' => '<p>Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.</p><p>Les fichiers du site ne sont pas sauvegardés automatiquement.</p>'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configBackupCopyButton', [
'href' => helper::baseUrl() . 'config/copyBackups',
'value' => 'Backups Auto &#10140; FileManager'
<div class="col4">
<?php echo template::checkbox('configAdvancedFileBackup', true, 'Copie de sauvegarde', [
'checked' => file_exists('site/data/.backup'),
'help' => '<p>Un fichier .backup.json est généré à chaque édition ou effacement d\'une donnée. La désactivation entraîne la suppression de ces fichiers.</p>'
]); ?>
</div>
</div>
@ -133,26 +123,26 @@
<?php $updateError = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::checkbox('configAdvancedAutoUpdate', true, 'Rechercher une mise à jour en ligne', [
<?php echo template::checkbox('configAdvancedAutoUpdate', true, 'Mise à jour en ligne', [
'checked' => $this->getData(['config', 'autoUpdate']),
'help' => 'La vérification est quotidienne. Option désactivée si la configuration du serveur ne le permet pas.',
'disabled' => !$updateError
'help' => 'Vérifie une fois par jour l\'existence d\'une mise à jour.',
'disabled' => !$error
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configAdvancedAutoUpdateHtaccess', true, 'Préserver le fichier htaccess racine', [
<div class="col4 ">
<?php echo template::checkbox('configAdvancedAutoUpdateHtaccess', true, 'Préserver htaccess', [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.',
'disabled' => !$updateError
'disabled' => !$error
]); ?>
</div>
<div class="col4">
<div class="col4 ">
<?php echo template::button('configAdvancedUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
'value' => 'Mise à jour manuelle',
'class' => 'buttonRed',
'disabled' => !$updateError
'disabled' => !$error
]); ?>
</div>
</div>
@ -330,7 +320,7 @@
</div>
</div>
<div class="row">
<div class="col6">
<div class="col3">
<?php echo template::checkbox('configAdvancedConnectCaptcha', true, 'Captcha à la connexion', [
'checked' => $this->getData(['config', 'connect','captcha'])
]); ?>

0
core/module/config/view/backup/backup.js.php Executable file → Normal file
View File

2
core/module/config/view/backup/backup.php Executable file → Normal file
View File

@ -18,7 +18,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres de la sauvegarde</h4>
<h4>Paramètre</h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('configBackupOption', true, 'Inclure le contenu du gestionnaire de fichiers', [

22
core/module/config/view/index/index.php Executable file → Normal file
View File

@ -15,10 +15,10 @@
'value' => 'Aide'
]); ?>
</div>
<div class="col3 offset3">
<div class="col2 offset4">
<?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'config/advanced',
'value' => 'Configuration avancée',
'value' => 'Avancée',
'ico' => 'cog-alt',
]); ?>
</div>
@ -62,21 +62,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Langues étrangères</h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('configI18n', true, 'Activer la gestion des langues étrangères', [
'checked' => $this->getData(['config', 'i18n', 'enabled']),
'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.'
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
@ -116,7 +101,7 @@
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [
'label' => 'Recherche dans le site',
'selected' => $this->getData(['locale', 'searchPageId']),
'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.'
'help' => 'Sélectionner la page "Recherche" ou une page contenant le module "Recherche". Une option du pied de page ajoute un lien discret vers cette page.'
]); ?>
</div>
</div>
@ -146,7 +131,6 @@
]); ?>
</div>
</div>
<p>Lorsque les langues étrangères sont activées, il convient d'adapter les pages spéciales.</p>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('configRestoreForm'); ?>
<?php echo template::formOpen('configManageForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('configRestoreBack', [
<?php echo template::button('configManageBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
@ -9,7 +9,7 @@
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('configRestoreSubmit',[
<?php echo template::submit('configManageSubmit',[
'value' => 'Restaurer'
]); ?>
</div>
@ -17,18 +17,18 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Archive à restaurer</h4>
<h4>Paramètres</h4>
<div class="row">
<div class="col10 offset1">
<div class="row">
<?php echo template::file('configRestoreImportFile', [
<?php echo template::file('configManageImportFile', [
'label' => 'Sélectionnez une archive 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 class="row">
<?php echo template::checkbox('configRestoreImportUser', true, 'Préserver les comptes des utilisateurs déjà installés', [
<?php echo template::checkbox('configManageImportUser', true, 'Préserver les comptes des utilisateurs déjà installés', [
'checked' => true
]); ?>
</div>
@ -40,7 +40,7 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Conversion après la restauration<?php echo template::help('Conversion des URL des ressources multimédia entre deux sites aux arborescences différentes.');?></h4>
<h4>Conversion des URL <?php echo template::help('Conversion des URL des ressources multimédia après le transfert d\'une archive entre deux sites aux adresses différentes.');?></h4>
<div class="row">
<div class="col4 offset1">
<?php
@ -54,22 +54,23 @@
$baseUrlValue = str_replace('?','',$this->getData(['core', 'baseUrl']));
$buttonClass = helper::baseUrl(false,false) !== $baseUrlValue ? '' : 'disabled';
}
echo template::text('configRestoreBaseURLToConvert', [
echo template::text('configManageBaseURLToConvert', [
'label' => 'Dossier de l\'archive' ,
'value' => $baseUrlValue,
'readonly' => true,
'help' => 'Le dossier de base du site est stockée dans la sauvegarde.'
'help' => 'Dossier de base du site stockée dans la sauvegarde.'
]); ?>
</div>
<div class="col4">
<?php echo template::text('configRestoreCurrentURL', [
<?php echo template::text('configManageCurrentURL', [
'label' => 'Dossier du site actuel',
'value' => helper::baseUrl(false,false),
'readonly' => true
'readonly' => true,
'help' => 'Dossier du base site actuel.'
]); ?>
</div>
<div class="col2 verticalAlignMiddle">
<?php echo template::button('configRestoreUpdateBaseURLButton', [
<?php echo template::button('configManageUpdateBaseURLButton', [
'href' => helper::baseUrl() . 'config/updateBaseUrl',
'class' => $buttonClass,
'value' => 'convertir'

View File

@ -1,18 +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-2021, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

0
core/module/config/view/script/script.php Executable file → Normal file
View File

View File

@ -42,8 +42,6 @@ class install extends common {
// Soumission du formulaire
if($this->isPost()) {
$success = true;
// Nettoyer le cookie de langue dans le cas d'une réinstallation
helper::deleteCookie('ZWII_I18N_SITE');
// Double vérification pour le mot de passe
if($this->getInput('installPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('installConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
self::$inputNotices['installConfirmPassword'] = 'Incorrect';
@ -117,8 +115,8 @@ class install extends common {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl(false),
'notification' => ($sent === true ? 'Installation terminée' : $sent),
'state' => ($sent === true ? true : null)
'notification' => $sent === true ? 'Installation terminée' : $sent,
'state' => ($sent === true && $success === true) ? true : null
]);
}
}

0
core/module/install/ressource/.htaccess Executable file → Normal file
View File

33
core/module/install/ressource/defaultdata.php Executable file → Normal file
View File

@ -32,24 +32,10 @@ class init extends common {
'attempt' => 3,
'log' => false,
'captcha' => true
],
'i18n' => [
'enabled' => false,
'scriptGoogle' => false,
'showCredits' => false,
'autoDetect' => false,
'admin' => false,
'fr' => false,
'de' => false,
'en' => false,
'es' => false,
'it' => false,
'nl' => false,
'pt' => false
],
]
],
'core' => [
'dataVersion' => 11000,
'dataVersion' => 10602,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
@ -97,6 +83,19 @@ class init extends common {
],
'module' => [],
'user' => [],
'translate' => [
'scriptGoogle' => false,
'showCredits' => false,
'autoDetect' => false,
'admin' => false,
'fr' => 'none',
'de' => 'none',
'en' => 'none',
'es' => 'none',
'it' => 'none',
'nl' => 'none',
'pt' => 'none'
],
'theme' => [
'body' => [
'backgroundColor' => 'rgba(236, 239, 241, 1)',
@ -140,7 +139,7 @@ class init extends common {
'fontSize' => '2em',
'fontWeight' => 'normal',
'height' => '150px',
'image' => 'banniere/zwii_banniere_norvege-960px.jpg',
'image' => 'banniere960.jpg',
'imagePosition' => 'center center',
'imageRepeat' => 'no-repeat',
'margin' => false,

0
core/module/install/view/index/index.js.php Executable file → Normal file
View File

0
core/module/install/view/index/index.php Executable file → Normal file
View File

0
core/module/install/view/update/update.js.php Executable file → Normal file
View File

0
core/module/install/view/update/update.php Executable file → Normal file
View File

0
core/module/maintenance/maintenance.php Executable file → Normal file
View File

0
core/module/maintenance/view/index/index.php Executable file → Normal file
View File

2
core/module/page/page.php Executable file → Normal file
View File

@ -417,7 +417,7 @@ class page extends common {
'displayMenu' => $this->getinput('pageEditDisplayMenu'),
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN),
'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN)
'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN),
]
]);
// Barre renommée : changement le nom de la barre dans les pages mères

2
core/module/page/view/edit/edit.js.php Executable file → Normal file
View File

@ -540,6 +540,8 @@ pageTypeMenuDOM.on("change", function() {
});
/**
* Soumission du formulaire pour éditer le module
*/

0
core/module/page/view/edit/edit.php Executable file → Normal file
View File

0
core/module/sitemap/sitemap.php Executable file → Normal file
View File

0
core/module/sitemap/view/index/index.php Executable file → Normal file
View File

0
core/module/theme/theme.php Executable file → Normal file
View File

0
core/module/theme/view/admin/admin.js.php Executable file → Normal file
View File

0
core/module/theme/view/admin/admin.php Executable file → Normal file
View File

0
core/module/theme/view/advanced/advanced.js.php Executable file → Normal file
View File

0
core/module/theme/view/advanced/advanced.php Executable file → Normal file
View File

0
core/module/theme/view/body/body.js.php Executable file → Normal file
View File

0
core/module/theme/view/body/body.php Executable file → Normal file
View File

0
core/module/theme/view/footer/footer.js.php Executable file → Normal file
View File

0
core/module/theme/view/footer/footer.php Executable file → Normal file
View File

0
core/module/theme/view/header/header.js.php Executable file → Normal file
View File

0
core/module/theme/view/header/header.php Executable file → Normal file
View File

0
core/module/theme/view/index/index.js.php Executable file → Normal file
View File

0
core/module/theme/view/index/index.php Executable file → Normal file
View File

0
core/module/theme/view/manage/manage.js.php Executable file → Normal file
View File

0
core/module/theme/view/manage/manage.php Executable file → Normal file
View File

0
core/module/theme/view/menu/menu.js.php Executable file → Normal file
View File

0
core/module/theme/view/menu/menu.php Executable file → Normal file
View File

0
core/module/theme/view/site/site.js.php Executable file → Normal file
View File

0
core/module/theme/view/site/site.php Executable file → Normal file
View File

170
core/module/translate/translate.php Executable file → Normal file
View File

@ -17,77 +17,10 @@ class translate extends common {
public static $actions = [
/*'config' => self::GROUP_MODERATOR,*/
'index' => self::GROUP_ADMIN,
'copy' => self::GROUP_ADMIN,
'index' => self::GROUP_MODERATOR,
'language' => self::GROUP_VISITOR
];
public static $translateOptions = [];
// Liste des langues installées
public static $languagesInstalled = [];
// Liste des langues cibles
public static $languagesTarget = [];
// Activation du bouton de copie
public static $siteTranslate = true;
/**
* Configuration avancée des langues
*/
public function copy() {
// Soumission du formulaire
if ($this->isPost()) {
// Initialisation
$success = false;
$copyFrom = $this->getInput('translateFormCopySource');
$toCreate = $this->getInput('translateFormCopyTarget');
if ($copyFrom !== $toCreate) {
// Création du dossier
if (is_dir(self::DATA_DIR . $toCreate) === false ) { // Si le dossier est déjà créé
$success = mkdir (self::DATA_DIR . $toCreate);
} else {
$success = true;
}
// Copier les données par défaut avec gestion des erreurs
$success = (copy (self::DATA_DIR . $copyFrom . '/locale.json', self::DATA_DIR . $toCreate . '/locale.json') === true && $success === true) ? true : false;
$success = (copy (self::DATA_DIR . $copyFrom . '/module.json', self::DATA_DIR . $toCreate . '/module.json') === true && $success === true) ? true : false;
$success = (copy (self::DATA_DIR . $copyFrom . '/page.json', self::DATA_DIR . $toCreate . '/page.json') === true && $success === true) ? true : false;
// Enregistrer la langue
if ($success) {
$this->setData(['config', 'i18n', $toCreate, 'site' ]);
$notification = 'Données ' . self::$i18nList[$copyFrom] . ' copiées vers ' . self::$i18nList[$toCreate];
} else {
$notification = "Quelque chose n\'a pas fonctionné, vérifiez les permissions.";
}
} else {
$success = false;
$notification = 'Les langues doivent être différentes.';
}
// Valeurs en sortie
$this->addOutput([
'notification' => $notification,
'title' => 'Utilitaire de copie',
'view' => 'index',
'state' => $success
]);
}
// Tableau des langues installées
foreach (self::$i18nList as $key => $value) {
if ($this->getData(['config','i18n', $key]) === 'site') {
self::$languagesTarget[$key] = $value;
}
}
// Langues cibles fr en plus
self::$languagesInstalled = array_merge(['fr' => 'Français (fr)'],self::$languagesTarget);
// Valeurs en sortie
$this->addOutput([
'title' => 'Utilitaire de copie',
'view' => 'copy'
]);
}
/**
* Configuration
*/
@ -95,26 +28,19 @@ class translate extends common {
// Soumission du formulaire
if($this->isPost()) {
// Désactivation du script Google
if ($this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) === false) {
setrawcookie('googtrans', '/fr/fr', time() + 3600, helper::baseUrl(false,false));
$_SESSION['googtrans'] = '/fr/fr';
}
$script = $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN);
// Edition des langues
// Edtion des langues
foreach (self::$i18nList as $keyi18n => $value) {
if ($keyi18n === 'fr') {continue;}
// Effacement d'une langue installée
// Effacement d'une langue installée (dossier plus option désactivée précédemment)
if ( is_dir( self::DATA_DIR . $keyi18n ) === true
AND $this->getInput('translate' . strtoupper($keyi18n)) === 'delete')
AND $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === false )
{
$this->removeDir( self::DATA_DIR . $keyi18n);
}
// Installation d'une langue
if ( $this->getInput('translate' . strtoupper($keyi18n)) === 'site'
AND is_dir(self::DATA_DIR . $keyi18n) === false )
if ( $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === true )
{
// Créer les données absentes
// Créer le dossier
if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
mkdir( self::DATA_DIR . $keyi18n);
}
@ -132,27 +58,29 @@ class translate extends common {
$e->save();
}
}
// Active le script si une langue est en trad auto
if ($script === false
AND $this->getInput('translate'. strtoupper($keyi18n)) === 'script') {
$script = true;
}
}
// Enregistrement des données
$this->setData(['config','i18n', [
'enabled' => $this->getData(['config', 'i18n', 'enabled']),
'scriptGoogle' => $script,
'showCredits' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false,
'admin' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAdmin', helper::FILTER_BOOLEAN) : false,
'fr' => $this->getInput('translateFR'),
'de' => $this->getInput('translateDE'),
'en' => $this->getInput('translateEN'),
'es' => $this->getInput('translateES'),
'it' => $this->getInput('translateIT'),
'nl' => $this->getInput('translateNL'),
'pt' => $this->getInput('translatePT')
// Enregistrement des données
$this->setData(['config','translate', [
'scriptGoogle' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN),
'showCredits' => $this->getInput('translateCredits', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
'autoDetect' => $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN),
'admin' => $this->getInput('translateAdmin', helper::FILTER_BOOLEAN),
'scriptFR' => $this->getInput('translateScriptFlagFR', helper::FILTER_BOOLEAN),
'scriptDE' => $this->getInput('translateScriptFlagDE', helper::FILTER_BOOLEAN),
'scriptEN' => $this->getInput('translateScriptFlagEN', helper::FILTER_BOOLEAN),
'scriptES' => $this->getInput('translateScriptFlagES', helper::FILTER_BOOLEAN),
'scriptIT' => $this->getInput('translateScriptFlagIT', helper::FILTER_BOOLEAN),
'scriptNL' => $this->getInput('translateScriptFlagNL', helper::FILTER_BOOLEAN),
'scriptPT' => $this->getInput('translateScriptFlagPT', helper::FILTER_BOOLEAN),
'site' => $this->getInput('translateSite', helper::FILTER_BOOLEAN),
'siteFR' => $this->getInput('translateSiteFlagFR', helper::FILTER_BOOLEAN),
'siteDE' => $this->getInput('translateSiteFlagDE', helper::FILTER_BOOLEAN),
'siteEN' => $this->getInput('translateSiteFlagEN', helper::FILTER_BOOLEAN),
'siteES' => $this->getInput('translateSiteFlagES', helper::FILTER_BOOLEAN),
'siteIT' => $this->getInput('translateSiteFlagIT', helper::FILTER_BOOLEAN),
'siteNL' => $this->getInput('translateSiteFlagNL', helper::FILTER_BOOLEAN),
'sitePT' => $this->getInput('translateSiteFlagPT', helper::FILTER_BOOLEAN)
]]);
// Valeurs en sortie
$this->addOutput([
@ -161,54 +89,22 @@ class translate extends common {
'state' => true
]);
}
// Modification des options de suppression de la langue installée.
foreach (self::$i18nList as $key => $value) {
if ($this->getData(['config','i18n',$key]) === 'site') {
self::$translateOptions [$key] = [
'none' => 'Drapeau masqué',
'script' => 'Traduction automatique',
'site' => 'Traduction rédigée',
'delete' => 'Supprimer la traduction'
];
self::$siteTranslate = $key !== 'fr' ? false : true;
} else {
self::$translateOptions [$key] = [
'none' => 'Drapeau masqué',
'script' => 'Traduction automatique',
'site' => 'Traduction rédigée'
];
}
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Gestion des langues',
'title' => 'Paramètres',
'view' => 'index'
]);
}
/*
* Traitement du changement de langue
* Fonction utilisée par le noyau
* Traitement du changement de langues
*/
public function language() {
// Activation du drapeau
if ( $this->getInput('ZWII_I18N_' . strtoupper($this->getUrl(3))) !== $this->getUrl(2) ) {
// Nettoyer et stocker le choix de l'utilisateur
helper::deleteCookie('ZWII_I18N_SITE');
helper::deleteCookie('ZWII_I18N_SCRIPT');
// Sélectionner
setcookie('ZWII_I18N_' . strtoupper($this->getUrl(3)) , $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
// Désactivation du drapeau, langue FR par défaut
} else {
setcookie('ZWII_I18N_SITE' , 'fr', time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
helper::deleteCookie('ZWII_I18N_SCRIPT');
}
// Valeurs en sortie
// Transmettre le choix au noyau
setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
// Valeurs en sortie sans post
$this->addOutput([
'redirect' => helper::baseUrl()
'redirect' => helper::baseUrl() . $this->getUrl(3)
]);
}
}

View File

@ -1,20 +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.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,34 +0,0 @@
<?php echo template::formOpen('translateFormCopy'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('translateFormCopyBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'translate',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('translateFormCopySubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Copie de site (traductions rédigées)</h4>
<div class="row">
<div class="col6">
<?php echo template::select('translateFormCopySource', $module::$languagesInstalled, [
'label' => 'Pages et les modules de'
]); ?>
</div>
<div class="col6">
<?php echo template::select('translateFormCopyTarget', $module::$languagesTarget, [
'label' => 'Vers'
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -1,68 +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
* @authorFré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(){
/*
* Active le script Google quand une langue est traduite automatiquement
*/
$("form :input").change(function() {
$(this).closest('form').data('changed', true);
if($(this).closest('form').data('changed')) {
if( $(this).val() === "script"
|| $(this).val() === "script"
|| $(this).val() === "script"
|| $(this).val() === "script"
|| $(this).val() === "script"
|| $(this).val() === "script" ) {
$("#translateScriptGoogle").prop("checked", true);
}
}
});
/**
* Désactive la traduction auto des langues lorsque le script est désélectionné
*/
$("#translateScriptGoogle").on("change", function() {
if ( $("input[name=translateScriptGoogle]").is(':not(:checked)') ) {
if ($("#translateDE :selected").val() === "script" ) {
$("#translateDE").val("none");
}
if ($("#translateEN :selected").val() === "script" ) {
$("#translateEN").val("none");
}
if ($("#translateES :selected").val() === "script" ) {
$("#translateEs").val("none");
}
if ($("#translateIT :selected").val() === "script" ) {
$("#translateIT").val("none");
}
if ($("#translateNL :selected").val() === "script" ) {
$("#translateNL").val("none");
}
if ($("#translatePT :selected").val() === "script" ) {
$("#translatePT").val("none");
}
$(".translateGoogleScriptOption").prop("checked", false);
}
});
/**
* Active le script quand une option est activée
*/
$(".translateGoogleScriptOption").on("change", function() {
$("#translateScriptGoogle").prop("checked", true);
});
});

170
core/module/translate/view/index/index.php Executable file → Normal file
View File

@ -8,116 +8,112 @@
'value' => 'Retour'
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'translate/copy',
'value' => 'Utilitaire de copie',
'ico' => 'cog-alt',
'disabled' => $module::$siteTranslate
]); ?>
</div>
<div class="col2">
<div class="col2 offset8">
<?php echo template::submit('translateFormSubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Traduction automatique
<span class="helpDisplayButton">
<?php echo template::ico('help', 'left');?>
</span>
</h4>
<h4>Langues supportées</h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
'checked' => $this->getData(['config','i18n', 'scriptGoogle']),
'help' => 'Le script Google Translate assure la traduction automatique du site.'
<b>Traduction automatique :</b>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagDE', true, 'Allemand', [
'checked' => $this->getData(['config','translate', 'scriptDE'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagEN', true, 'Anglais', [
'checked' => $this->getData(['config','translate', 'scriptEN'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagES', true, 'Espagnol', [
'checked' => $this->getData(['config','translate', 'scriptES'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagIT', true, 'Italien', [
'checked' => $this->getData(['config','translate', 'scriptIT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagNL', true, 'Néerlandais', [
'checked' => $this->getData(['config','translate', 'scriptNL'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateScriptFlagPT', true, 'Portugais', [
'checked' => $this->getData(['config','translate', 'scriptPT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateAutoDetect', true, 'Détection automatique', [
'checked' => $this->getData(['config','translate', 'autoDetect']),
'help' => 'Détecte la langue du navigateur.'
]); ?>
</div>
</div>
<div class="col6">
<?php echo template::checkbox('translateAutoDetect', true, 'Détection automatique de la langue du navigateur', [
'checked' => $this->getData(['config','i18n', 'autoDetect']),
'class' => 'translateGoogleScriptOption',
'help' => 'Détecte la langue du navigateur, dans ce mode il n\'est pas nécessaire d\'afficher les drapeaux.'
<b>Traduction rédigée :</b>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagEN', true, 'Anglais', [
'checked' => $this->getData(['config', 'translate', 'siteEN'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
'checked' => $this->getData(['config','i18n', 'showCredits']),
'class' => 'translateGoogleScriptOption',
'help' => 'Option recommandée pour le respect du droit d\'auteur'
<div class="col12">
<?php echo template::checkbox('translateSiteFlagDE', true, 'Allemand', [
'checked' => $this->getData(['config', 'translate', 'siteDE'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('translateAdmin', true, 'Traduction en mode connecté', [
'checked' => $this->getData(['config','i18n', 'admin']),
'class' => 'translateGoogleScriptOption',
'help' => 'Traduit le site et l\'interface de ZwiiCMS quand un utilisateur est connecté'
<div class="col12">
<?php echo template::checkbox('translateSiteFlagES', true, 'Espagnol', [
'checked' => $this->getData(['config', 'translate', 'siteES'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagIT', true, 'Italien', [
'checked' => $this->getData(['config', 'translate', 'siteIT'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagNL', true, 'Néerlandais', [
'checked' => $this->getData(['config', 'translate', 'siteNL'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagPT', true, 'Portugais', [
'checked' => $this->getData(['config', 'translate', 'sitePT'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="flagsWrapper">
<h4>Mode de traduction et affichage des drapeaux</h4>
<div class="block">
<h4>Paramètres de traduction automatique</h4>
<div class="row">
<div class="col4 offset4">
<?php echo template::select('translateFR', ['none'=>'Drapeau masqué','site'=>'Drapeau affiché'], [
'label' => 'Français',
'selected' => $this->getData(['config', 'i18n' , 'fr'])
<div class="col4">
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
'checked' => $this->getData(['config','translate', 'scriptGoogle'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div class="col8 offset2">
<?php echo template::select('translateDE', $module::$translateOptions['de'], [
'label' => 'Allemand',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'de'])
<div class="col4">
<?php echo template::checkbox('translateAdmin', true, 'Mode connexion', [
'checked' => $this->getData(['config','translate', 'admin']),
'help' => 'Traduction automatique du site et de l\'interface du CMS'
]); ?>
</div>
<div class="col8 offset2">
<?php echo template::select('translateEN', $module::$translateOptions['en'], [
'label' => 'Anglais',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'en'])
]); ?>
</div>
<div class="col8 offset2">
<?php echo template::select('translateES', $module::$translateOptions['es'], [
'label' => 'Espagnol',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'es'])
]); ?>
</div>
</div>
<div class="col6">
<div class="col8 offset2">
<?php echo template::select('translateIT', $module::$translateOptions['it'], [
'label' => 'Italien',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'it'])
]); ?>
</div>
<div class="col8 offset2">
<?php echo template::select('translateNL', $module::$translateOptions['nl'], [
'label' => 'Néerlandais',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'nl'])
]); ?>
</div>
<div class="col8 offset2">
<?php echo template::select('translatePT', $module::$translateOptions['pt'], [
'label' => 'Portugais',
'class' => 'translateFlagSelect',
'selected' => $this->getData(['config', 'i18n' , 'pt'])
<div class="col4">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
'checked' => $this->getData(['config','translate', 'showCredits']),
'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
]); ?>
</div>
</div>
@ -125,14 +121,4 @@
</div>
</div>
</div>
<div class="col10 helpDisplayContent">
<p>Vous avez le choix entre une traduction automatique réalisée avec le script Google Traduction ou une traduction rédigée. La traduction automatique offre deux possibilités, la détection automatique de la langue du navigateur même celle-ci n'est pas
matérialisée par un drapeau. Le clic sur un drapeau forcera la traduction dans cette langue, pour cela sélectionnez le drapeau puis l'option de "Traduction automatique".
La traduction automatique est réalisée à partir du site en version française.</p>
<p>Avec l'option "Traduction rédigée", une nouveau sité est généré, seule la page d'accueil est crée, il faut alors rédiger les pages dans la langue sélectionnée.
Il est possible de copier les pages et les modules d'une langue vers une autre à l'aide de l'utilitaire de copie.
Quand un drapeau est masqué, la traduction est effacée, pensez à sauvegarder.
Afficher le drapeau français pour revenir à la traduction dans la langue originale.</p>
</div>
<?php echo template::formClose(); ?>

0
core/module/user/ressource/.htaccess Executable file → Normal file
View File

20
core/module/user/user.php Executable file → Normal file
View File

@ -83,11 +83,11 @@ class user extends common {
'signature' => $this->getInput('userAddSignature', helper::FILTER_INT, true),
'mail' => $userMail,
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
'connectFail' => null,
'connectTimeout' => null,
'accessUrl' => null,
'accessTimer' => null,
'accessCsrf' => null
"connectFail" => null,
"connectTimeout" => null,
"accessUrl" => null,
"accessTimer" => null,
"accessCsrf" => null
]
]);
@ -656,11 +656,11 @@ class user extends common {
'pseudo' => $item['prenom'],
'signature' => 1, // Pseudo
'password' => uniqid(), // A modifier à la première connexion
'connectFail' => null,
'connectTimeout' => null,
'accessUrl' => null,
'accessTimer' => null,
'accessCsrf' => null
"connectFail" => null,
"connectTimeout" => null,
"accessUrl" => null,
"accessTimer" => null,
"accessCsrf" => null
]]);
// Icône de notification
$item['notification'] = $create ? template::ico('check') : template::ico('cancel');

0
core/module/user/view/add/add.js.php Executable file → Normal file
View File

0
core/module/user/view/add/add.php Executable file → Normal file
View File

0
core/module/user/view/edit/edit.js.php Executable file → Normal file
View File

0
core/module/user/view/edit/edit.php Executable file → Normal file
View File

0
core/module/user/view/forgot/forgot.php Executable file → Normal file
View File

0
core/module/user/view/import/import.php Executable file → Normal file
View File

0
core/module/user/view/index/index.js.php Executable file → Normal file
View File

0
core/module/user/view/index/index.php Executable file → Normal file
View File

0
core/module/user/view/login/login.php Executable file → Normal file
View File

0
core/module/user/view/reset/reset.php Executable file → Normal file
View File

0
core/vendor/filemanager/UploadHandler.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/ajax_calls.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/config/.htaccess vendored Executable file → Normal file
View File

0
core/vendor/filemanager/config/config.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/dialog.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/execute.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/force_download.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/include/FtpClient.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/include/FtpException.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/include/FtpWrapper.php vendored Executable file → Normal file
View File

0
core/vendor/filemanager/include/Response.php vendored Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More