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 du site
# Fichiers de données
site/* site/*
# Dossiers vides dans GitHub # Dossiers vides dans GitHub

0
.htaccess Executable file → Normal file
View File

View File

@ -1,17 +1,11 @@
# Changelog # Changelog
## version 10.6.03
## Version 11.0.00 - 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 : - Modifications :
- Gestion multi-langues - 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.
- Traduction rédigée dans une langue européenne - Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que sur le site.
- 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.
## version 10.6.03 ## version 10.6.03
- Correction : - Correction :
@ -21,14 +15,14 @@
- Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que par le site. - Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que par le site.
## version 10.6.02 ## version 10.6.02
Correction : - Correction :
- Bug lors du téléchargement des journaux. - Débordement lors du téléchargement des fichiers journaux.
## version 10.6.01 ## version 10.6.01
Corrections : Corrections :
- Champs de formulaire, uniformisation de la hauteur (select, input, etc) identique à celle des boutons à 9px. - Champs de formulaire, uniformisation de la hauteur (select, input, etc) identique à celle des boutons à 9px.
- Module search : texte d'aide dans la zone de saisie non pris en compte. - Module search : texte d'aide dans la zone de saisie non pris en compte.
Modifications : Modifications :
- News 3.2 : ajout au sélecteur de date d'un bouton d'effacement identique à celui du sélecteur de fichiers. - News 3.2 : ajout au sélecteur de date d'un bouton d'effacement identique à celui du sélecteur de fichiers.
- News 3.2 : décoloration du texte, modification de l'effet blur. - News 3.2 : décoloration du texte, modification de l'effet blur.

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

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

@ -482,6 +482,7 @@ $(document).ready(function(){
* Active le système d'aide interne * Active le système d'aide interne
* *
*/ */
$(".buttonHelp").on({ $(".buttonHelp").on({
click: function () { click: function () {
$(".helpDisplayContent").slideToggle(); $(".helpDisplayContent").slideToggle();
@ -495,7 +496,7 @@ $(document).ready(function(){
}); });
/** /**
* Remove ID Facebook from URL * Remove ID Facebook from URL
*/ */
if(/^\?fbclid=/.test(location.search)) if(/^\?fbclid=/.test(location.search))
location.replace(location.href.replace(/\?fbclid.+/, "")); location.replace(location.href.replace(/\?fbclid.+/, ""));

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

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

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

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

@ -36,7 +36,7 @@
<?php <?php
if ( $this->getData(['theme', 'menu', 'position']) === 'top' if ( $this->getData(['theme', 'menu', 'position']) === 'top'
AND $this->getData(['theme', 'menu', 'fixed']) === true AND $this->getData(['theme', 'menu', 'fixed']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD',true) AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD',true)
AND $this->getUser('group') > self::GROUP_MEMBER) { AND $this->getUser('group') > self::GROUP_MEMBER) {
echo '<nav id="navfixedconnected" >'; echo '<nav id="navfixedconnected" >';
} else { } else {
@ -59,6 +59,7 @@
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?> <?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<!-- Bannière dans le fond du site --> <!-- Bannière dans le fond du site -->
<header> <header>
<?php //$layout->showi18n();?>
<?php <?php
if ($this->getData(['theme','header','linkHomePage'])){ if ($this->getData(['theme','header','linkHomePage'])){
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?> echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
@ -152,6 +153,7 @@
<?php endif; ?> <?php endif; ?>
<!-- Corps de page --> <!-- Corps de page -->
<section> <section>
<?php //$layout->showi18n();?>
<?php <?php
// Gabarit : // Gabarit :
// Récupérer la config de la page courante // Récupérer la config de la page courante

View File

@ -20,33 +20,21 @@ class addon extends common {
public static $actions = [ public static $actions = [
'index' => self::GROUP_ADMIN, 'index' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN, 'moduleDelete' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN, 'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN, 'import' => self::GROUP_ADMIN
'store' => self::GROUP_ADMIN,
'item' => self::GROUP_ADMIN,
'upload' => self::GROUP_ADMIN,
'uploadItem'=> self::GROUP_ADMIN
]; ];
const URL_STORE = 'http://zwiicms.fr/?modules/';
const BASEURL_STORE = 'http://zwiicms.fr/';
// Gestion des modules // Gestion des modules
public static $modInstal = []; public static $modInstal = [];
// pour tests // pour tests
public static $valeur = []; public static $valeur = [];
// le catalogue
public static $storeList = [];
public static $storeItem = [];
/* /*
* Effacement d'un module installé et non utilisé * Effacement d'un module installé et non utilisé
*/ */
public function delete() { public function moduleDelete() {
// Jeton incorrect // Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) { if ($this->getUrl(3) !== $_SESSION['csrf']) {
@ -84,270 +72,6 @@ class addon extends common {
} }
} }
/***
* Installation d'un module
* Fonction utilisée par upload et storeUpload
*/
private function install ($moduleName, $checkValid){
$tempFolder = 'datamodules';//uniqid();
$zip = new ZipArchive();
if ($zip->open($moduleName) === TRUE) {
$notification = 'Archive ouverte';
mkdir (self::TEMP_DIR . $tempFolder);
$zip->extractTo(self::TEMP_DIR . $tempFolder );
// Archive de module ?
$success = false;
$notification = 'Ce n\'est pas l\'archive d\'un module !';
$moduleDir = self::TEMP_DIR . $tempFolder . '/module';
$moduleName = '';
if ( is_dir( $moduleDir )) {
// Lire le nom du module
if ($dh = opendir( $moduleDir )) {
while ( false !== ($file = readdir($dh)) ) {
if ($file != "." && $file != "..") {
$moduleName = $file;
}
}
closedir($dh);
}
// Module normalisé ?
if( is_file( $moduleDir.'/'.$moduleName.'/'.$moduleName.'.php' ) AND is_file( $moduleDir.'/'.$moduleName.'/view/index/index.php' ) ){
// Lecture de la version et de la validation d'update du module pour validation de la mise à jour
// Pour une version <= version installée l'utilisateur doit cocher 'Mise à jour forcée'
$version = '0.0';
$update = '0.0';
$valUpdate = false;
$file = file_get_contents( $moduleDir.'/'.$moduleName.'/'.$moduleName.'.php');
$file = str_replace(' ','',$file);
$file = str_replace("\t",'',$file);
$pos1 = strpos($file, 'constVERSION');
if( $pos1 !== false){
$posdeb = strpos($file, "'", $pos1);
$posend = strpos($file, "'", $posdeb + 1);
$version = substr($file, $posdeb + 1, $posend - $posdeb - 1);
}
$pos1 = strpos($file, 'constUPDATE');
if( $pos1 !== false){
$posdeb = strpos($file, "'", $pos1);
$posend = strpos($file, "'", $posdeb + 1);
$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){
$moduleInstal = true;
}
}
// Validation de la maj si autorisation du concepteur du module ET
// ( Version plus récente OU Check de forçage )
$valNewVersion = floatval($version);
$valInstalVersion = floatval( $infoModules[$moduleName]['version'] );
$newVersion = false;
if( $valNewVersion > $valInstalVersion ) $newVersion = true;
$validMaj = $valUpdate && ( $newVersion || $checkValid);
// Nouvelle installation ou mise à jour du module
if( ! $moduleInstal || $validMaj ){
// Copie récursive des dossiers
$this->copyDir( self::TEMP_DIR . $tempFolder, './' );
$success = true;
if( ! $moduleInstal ){
$notification = 'Module '.$moduleName.' installé';
}
else{
$notification = 'Module '.$moduleName.' mis à jour';
}
}
else{
$success = false;
if( $valNewVersion == $valInstalVersion){
$notification = ' Version détectée '.$version.' = à celle installée '.$infoModules[$moduleName]['version'];
}
else{
$notification = ' Version détectée '.$version.' < à celle installée '.$infoModules[$moduleName]['version'];
}
if( $valUpdate === false){
if( $infoModules[$moduleName]['update'] === $update ){
$notification = ' Mise à jour par ce procédé interdite par le concepteur du module';
}
else{
$notification = ' Mise à jour par ce procédé interdite, votre version est trop ancienne';
}
}
}
}
}
// Supprimer le dossier temporaire même si le module est invalide
$this->removeDir(self::TEMP_DIR . $tempFolder);
$zip->close();
} else {
// erreur à l'ouverture
$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']
]);
}
// 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 * Gestion des modules
@ -372,11 +96,11 @@ class addon extends common {
$infoModules[$key]['realName'], $infoModules[$key]['realName'],
$infoModules[$key]['version'], $infoModules[$key]['version'],
implode(', ', array_keys($inPagesTitle,$key)), implode(', ', array_keys($inPagesTitle,$key)),
//|| ('delete',$infoModules[$key]) && $infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$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)) === '' $infoModules[$key]['delete'] === true && implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleDelete' . $key, [ ? template::button('moduleDelete' . $key, [
'class' => 'moduleDelete buttonRed', 'class' => 'moduleDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/moduleDelete/' . $key . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel') 'value' => template::ico('cancel')
]) ])
: '', : '',
@ -395,9 +119,127 @@ class addon extends common {
]; ];
} }
// 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(self::FILE_DIR.'source/'.$zipFilename) === TRUE) {
$notification = 'Archive ouverte';
mkdir (self::TEMP_DIR . $tempFolder);
$zip->extractTo(self::TEMP_DIR . $tempFolder );
// Archive de module ?
$success = false;
$notification = 'Ce n\'est pas l\'archive d\'un module !';
$moduleDir = self::TEMP_DIR . $tempFolder . '/module';
$moduleName = '';
if ( is_dir( $moduleDir )) {
// Lire le nom du module
if ($dh = opendir( $moduleDir )) {
while ( false !== ($file = readdir($dh)) ) {
if ($file != "." && $file != "..") {
$moduleName = $file;
}
}
closedir($dh);
}
// Module normalisé ?
if( is_file( $moduleDir.'/'.$moduleName.'/'.$moduleName.'.php' ) AND is_file( $moduleDir.'/'.$moduleName.'/view/index/index.php' ) ){
// Lecture de la version et de la validation d'update du module pour validation de la mise à jour
// Pour une version <= version installée l'utilisateur doit cocher 'Mise à jour forcée'
$version = '0.0';
$update = '0.0';
$valUpdate = false;
$file = file_get_contents( $moduleDir.'/'.$moduleName.'/'.$moduleName.'.php');
$file = str_replace(' ','',$file);
$file = str_replace("\t",'',$file);
$pos1 = strpos($file, 'constVERSION');
if( $pos1 !== false){
$posdeb = strpos($file, "'", $pos1);
$posend = strpos($file, "'", $posdeb + 1);
$version = substr($file, $posdeb + 1, $posend - $posdeb - 1);
}
$pos1 = strpos($file, 'constUPDATE');
if( $pos1 !== false){
$posdeb = strpos($file, "'", $pos1);
$posend = strpos($file, "'", $posdeb + 1);
$update = substr($file, $posdeb + 1, $posend - $posdeb - 1);
}
// Si version actuelle >= version indiquée dans UPDATE la mise à jour est validée
if( $infoModules[$moduleName]['update'] >= $update ) $valUpdate = true;
// Module déjà installé ?
$moduleInstal = false;
foreach( self::$modInstal as $key=>$value){
if($moduleName === $value[0]){
$moduleInstal = true;
}
}
// Validation de la maj si autorisation du concepteur du module ET
// ( Version plus récente OU Check de forçage )
$valNewVersion = floatval($version);
$valInstalVersion = floatval( $infoModules[$moduleName]['version'] );
$newVersion = false;
if( $valNewVersion > $valInstalVersion ) $newVersion = true;
$validMaj = $valUpdate && ( $newVersion || $checkValidMaj);
// Nouvelle installation ou mise à jour du module
if( ! $moduleInstal || $validMaj ){
// Copie récursive des dossiers
$this -> custom_copy( self::TEMP_DIR . $tempFolder, './' );
$success = true;
if( ! $moduleInstal ){
$notification = 'Module '.$moduleName.' installé';
}
else{
$notification = 'Module '.$moduleName.' mis à jour';
}
}
else{
$success = false;
if( $valNewVersion == $valInstalVersion){
$notification = ' Version détectée '.$version.' = à celle installée '.$infoModules[$moduleName]['version'];
}
else{
$notification = ' Version détectée '.$version.' < à celle installée '.$infoModules[$moduleName]['version'];
}
if( $valUpdate === false){
if( $infoModules[$moduleName]['update'] === $update ){
$notification = ' Mise à jour par ce procédé interdite par le concepteur du module';
}
else{
$notification = ' Mise à jour par ce procédé interdite, votre version est trop ancienne';
}
}
}
}
}
// Supprimer le dossier temporaire même si le module est invalide
$this->removeDir(self::TEMP_DIR . $tempFolder);
$zip->close();
} else {
// erreur à l'ouverture
$success = false;
$notification = 'Impossible d\'ouvrir l\'archive';
}
}
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => $notification,
'state' => $success
]);
}
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Modules installés', 'title' => 'Gestion des modules',
'view' => 'index' 'view' => 'index'
]); ]);
} }
@ -462,7 +304,7 @@ class addon extends common {
// Export des données localisées dans le dossier de données du module // Export des données localisées dans le dossier de données du module
if ($infoModules[$this->getUrl(2)]['dataDirectory'] && if ($infoModules[$this->getUrl(2)]['dataDirectory'] &&
is_dir($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 // Enregistrement des pages dans le dossier de langue identique à module
@ -473,13 +315,14 @@ class addon extends common {
$fileName = $this->getUrl(2) . '.zip'; $fileName = $this->getUrl(2) . '.zip';
$this->makeZip ($fileName, $tmpFolder, []); $this->makeZip ($fileName, $tmpFolder, []);
if (file_exists($fileName)) { if (file_exists($fileName)) {
ob_start();
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"'); header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName)); header('Content-Length: ' . filesize($fileName));
ob_clean();
ob_end_flush();
readfile( $fileName); readfile( $fileName);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
unlink($fileName); unlink($fileName);
$this->removeDir($tmpFolder); $this->removeDir($tmpFolder);
exit(); exit();
@ -507,7 +350,7 @@ class addon extends common {
'notification' => 'Action non autorisée' 'notification' => 'Action non autorisée'
]); ]);
} }
else { else{
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
// Récupérer le fichier et le décompacter // 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. // 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 // Supprimer le dossier temporaire
$this->removeDir(self::TEMP_DIR . $tempFolder); $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,36 +1,57 @@
<div class="row"> <?php echo template::formOpen('configModulesGestion'); ?>
<div class="col2"> <div class="row">
<?php echo template::button('configModulesBack', [ <div class="col2">
'class' => 'buttonGrey', <?php echo template::button('configModulesBack', [
'href' => helper::baseUrl(), 'class' => 'buttonGrey',
'ico' => 'left', 'href' => helper::baseUrl(),
'value' => 'Retour' '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 index -->
<div class="helpDisplayContent">
<?php echo file_get_contents( 'core/module/addon/view/index/index.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> </div>
<div class="col2"> <?php echo template::formClose(); ?>
<?php echo template::button('addonIndexHelp', [
'class' => 'buttonHelp',
'ico' => 'help',
'value' => 'Aide'
]); ?>
</div>
<div class="col3 offset2">
<?php echo template::button('configStoreUpload', [
'href' => helper::baseUrl() . 'addon/upload',
'value' => 'Téléverser un module'
]); ?>
</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">
<?php echo file_get_contents( 'core/module/addon/view/index/index.help.html') ;?>
</div>
<?php if($module::$modInstal): ?> <?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 echo template::table([2, 2, 2, 2, 1, 1, 1], $module::$modInstal, ['Module installé', 'Alias', 'Version', 'Page(s)', 'Supprimer', 'Exporter', 'Importer']); ?>
<?php else: ?> <?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(); ?>

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

@ -18,19 +18,17 @@ class config extends common {
public static $actions = [ public static $actions = [
'backup' => self::GROUP_ADMIN, 'backup' => self::GROUP_ADMIN,
'copyBackups'=> self::GROUP_ADMIN,
'configMetaImage' => self::GROUP_ADMIN, 'configMetaImage' => self::GROUP_ADMIN,
'generateFiles' => self::GROUP_ADMIN, 'generateFiles' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN, 'index' => self::GROUP_ADMIN,
'advanced' => self::GROUP_ADMIN, 'advanced' => self::GROUP_ADMIN,
'restore' => self::GROUP_ADMIN, 'manage' => self::GROUP_ADMIN,
'updateBaseUrl' => self::GROUP_ADMIN, 'updateBaseUrl' => self::GROUP_ADMIN,
'script' => self::GROUP_ADMIN, 'script' => self::GROUP_ADMIN,
'logReset' => self::GROUP_ADMIN, 'logReset' => self::GROUP_ADMIN,
'logDownload'=> self::GROUP_ADMIN, 'logDownload'=> self::GROUP_ADMIN,
'blacklistReset' => self::GROUP_ADMIN, 'blacklistReset' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN, 'blacklistDownload' => self::GROUP_ADMIN
]; ];
public static $timezones = [ public static $timezones = [
@ -267,11 +265,11 @@ class config extends common {
/** /**
* Procédure d'importation * Procédure d'importation
*/ */
public function restore() { public function manage() {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
//if ($this->getInput('configRestoreImportFile')) //if ($this->getInput('configManageImportFile'))
$fileZip = $this->getInput('configRestoreImportFile'); $fileZip = $this->getInput('configManageImportFile');
$file_parts = pathinfo($fileZip); $file_parts = pathinfo($fileZip);
$folder = date('Y-m-d-h-i-s', time()); $folder = date('Y-m-d-h-i-s', time());
$zip = new ZipArchive(); $zip = new ZipArchive();
@ -279,7 +277,7 @@ class config extends common {
// Valeurs en sortie erreur // Valeurs en sortie erreur
$this->addOutput([ $this->addOutput([
'notification' => 'Le fichier n\'est pas une archive valide', 'notification' => 'Le fichier n\'est pas une archive valide',
'redirect' => helper::baseUrl() . 'config/restore', 'redirect' => helper::baseUrl() . 'config/manage',
'state' => false 'state' => false
]); ]);
} }
@ -288,7 +286,7 @@ class config extends common {
// Valeurs en sortie erreur // Valeurs en sortie erreur
$this->addOutput([ $this->addOutput([
'notification' => 'Impossible de lire l\'archive', 'notification' => 'Impossible de lire l\'archive',
'redirect' => helper::baseUrl() . 'config/restore', 'redirect' => helper::baseUrl() . 'config/manage',
'state' => false 'state' => false
]); ]);
} }
@ -313,21 +311,21 @@ class config extends common {
// V10 valide // V10 valide
$version = '10'; $version = '10';
// Option active, les users sont stockées // 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']); $users = $this->getData(['user']);
} }
} else { // Version invalide } else { // Version invalide
// Valeurs en sortie erreur // Valeurs en sortie erreur
$this->addOutput([ $this->addOutput([
'notification' => 'Cette archive n\'est pas une sauvegarde valide', 'notification' => 'Cette archive n\'est pas une sauvegarde valide',
'redirect' => helper::baseUrl() . 'config/restore', 'redirect' => helper::baseUrl() . 'config/manage',
'state' => false 'state' => false
]); ]);
} }
// Préserver les comptes des utilisateurs d'une version 9 si option cochée // Préserver les comptes des utilisateurs d'une version 9 si option cochée
// Positionnement d'une variable de session lue au constructeurs // Positionnement d'une variable de session lue au constructeurs
if ($version === '9') { 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/' // Extraire le zip ou 'site/'
$success = $zip->extractTo( 'site/' ); $success = $zip->extractTo( 'site/' );
@ -337,13 +335,13 @@ class config extends common {
// Restaurer les users originaux d'une v10 si option cochée // Restaurer les users originaux d'une v10 si option cochée
if (!empty($users) && if (!empty($users) &&
$version === '10' && $version === '10' &&
$this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true) { $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) {
$this->setData(['user',$users]); $this->setData(['user',$users]);
} }
// Message de notification // Message de notification
$notification = $success === true ? 'Restauration réalisée avec succès' : 'Erreur inconnue'; $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 // Valeurs en sortie erreur
$this->addOutput([ $this->addOutput([
'notification' => $notification, 'notification' => $notification,
@ -355,7 +353,7 @@ class config extends common {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Restaurer', 'title' => 'Restaurer',
'view' => 'restore' 'view' => 'manage'
]); ]);
} }
@ -398,10 +396,9 @@ class config extends common {
'legalPageId' => $legalPageId, 'legalPageId' => $legalPageId,
'searchPageId' => $searchPageId, 'searchPageId' => $searchPageId,
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true), '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 // Générer robots.txt et sitemap
$this->generateFiles(); $this->generateFiles();
// Valeurs en sortie // Valeurs en sortie
@ -431,11 +428,6 @@ class config extends common {
$this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) { $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]); $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 // Sauvegarder
$this->setData([ $this->setData([
'config', 'config',
@ -463,7 +455,6 @@ class config extends common {
'proxyUrl' => $this->getInput('configAdvancedProxyUrl'), 'proxyUrl' => $this->getInput('configAdvancedProxyUrl'),
'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT), 'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT),
'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN), 'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN),
'autoDisconnect' => $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN),
'smtp' => [ 'smtp' => [
'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN), 'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT), 'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT),
@ -479,23 +470,22 @@ class config extends common {
'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT), 'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN), 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
'captcha' => $this->getInput('configAdvancedConnectCaptcha',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 // Notice
if(self::$inputNotices === []) { if(self::$inputNotices === []) {
// Active la réécriture d'URL // Active la réécriture d'URL
@ -622,7 +612,7 @@ class config extends common {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => $success ? $c3. ' conversion' . ($c3 > 1 ? 's' : '') . ' effectuée' . ($c3 > 1 ? 's' : '') : 'Aucune conversion', '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 'state' => $success ? true : false
]); ]);
} }
@ -659,14 +649,14 @@ class config extends common {
/** /**
* Télécharger le fichier de log * Télécharger le fichier de log
*/ */
public function logDownload() { public function logDownload() {
$fileName = self::DATA_DIR . 'journal.log'; $fileName = self::DATA_DIR . 'journal.log';
if (file_exists($fileName)) { if (file_exists($fileName)) {
ob_start(); ob_start();
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"'); header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName)); header('Content-Length: ' . filesize($fileName));
ob_clean(); ob_clean();
ob_end_flush(); ob_end_flush();
readfile( $fileName); readfile( $fileName);
exit(); exit();
@ -701,7 +691,7 @@ class config extends common {
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"'); header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName)); header('Content-Length: ' . filesize($fileName));
ob_clean(); ob_clean();
ob_end_flush(); ob_end_flush();
readfile( $fileName); readfile( $fileName);
unlink(self::TEMP_DIR . 'blacklist.log'); unlink(self::TEMP_DIR . 'blacklist.log');
@ -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 * Fonction de parcours des données de module

View File

@ -27,27 +27,24 @@
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Maintenance</h4> <h4>Maintenance</h4>
<div class="row"> <div class="col3">
<div class="col4"> <?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [
<?php echo template::checkbox('configAdvancedMaintenance', true, 'Site en maintenance', [ 'checked' => $this->getData(['config', 'maintenance'])
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
<div class="col3 offset1">
<?php echo template::button('configBackupButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => 'Sauvegarder',
'ico' => 'download-cloud'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset1"> <div class="col3 offset1">
<?php echo template::button('configRestoreButton', [ <?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/restore', 'href' => helper::baseUrl() . 'config/backup',
'value' => 'Restaurer', 'value' => 'Sauvegarder',
'ico' => 'upload-cloud' 'ico' => 'download'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset1">
<?php echo template::button('configManageButton', [
'href' => helper::baseUrl() . 'config/manage',
'value' => 'Restaurer',
'ico' => 'upload'
]); ?>
</div> </div>
</div> </div>
</div> </div>
@ -56,6 +53,7 @@
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Réglages</h4> <h4>Réglages</h4>
<?php $error = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::file('configAdvancedFavicon', [ <?php echo template::file('configAdvancedFavicon', [
@ -82,45 +80,37 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col4">
<?php echo template::checkbox('configAdvancedCookieConsent', true, 'Message de consentement aux cookies', [ <?php echo template::checkbox('configAdvancedCookieConsent', true, 'Consentement aux cookies', [
'checked' => $this->getData(['config', 'cookieConsent']), 'checked' => $this->getData(['config', 'cookieConsent'])
'help' => 'Activation obligatoire selon les lois françaises sauf si vous utilisez votre propre système de consentement.'
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col4">
<?php echo template::checkbox('rewrite', true, 'URL intelligentes', [ <?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 renforcé utilise quatre opérations de nombres de 0 à 20.'
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('rewrite', true, 'Réécriture d\'URL', [
'checked' => helper::checkRewrite(), 'checked' => helper::checkRewrite(),
'help' => 'Vérifiez d\'abord que votre serveur autorise l\'URL rewriting (ce qui n\'est pas le cas chez Free).' 'help' => 'Vérifiez d\'abord que votre serveur l\'autorise : ce n\'est pas le cas chez Free.'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col4">
<?php echo template::checkbox('configAdvancedCaptchaStrong', true, 'Captcha complexe', [ <?php echo template::checkbox('configAdvancedAutoBackup', true, 'Sauvegarde quotidienne', [
'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.'
]); ?>
</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>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAdvancedAutoBackup', true, 'Sauvegarde automatique quotidienne du site', [
'checked' => $this->getData(['config', 'autoBackup']), '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>
<div class="col3"> <div class="col4">
<?php echo template::button('configBackupCopyButton', [ <?php echo template::checkbox('configAdvancedFileBackup', true, 'Copie de sauvegarde', [
'href' => helper::baseUrl() . 'config/copyBackups', 'checked' => file_exists('site/data/.backup'),
'value' => 'Backups Auto &#10140; FileManager' '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>
</div> </div>
</div> </div>
@ -133,26 +123,26 @@
<?php $updateError = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');?> <?php $updateError = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');?>
<div class="row"> <div class="row">
<div class="col4"> <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']), 'checked' => $this->getData(['config', 'autoUpdate']),
'help' => 'La vérification est quotidienne. Option désactivée si la configuration du serveur ne le permet pas.', 'help' => 'Vérifie une fois par jour l\'existence d\'une mise à jour.',
'disabled' => !$updateError 'disabled' => !$error
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4 ">
<?php echo template::checkbox('configAdvancedAutoUpdateHtaccess', true, 'Préserver le fichier htaccess racine', [ <?php echo template::checkbox('configAdvancedAutoUpdateHtaccess', true, 'Préserver htaccess', [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']), 'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.', 'help' => 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.',
'disabled' => !$updateError 'disabled' => !$error
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4 ">
<?php echo template::button('configAdvancedUpdateForced', [ <?php echo template::button('configAdvancedUpdateForced', [
'ico' => 'download-cloud', 'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update', 'href' => helper::baseUrl() . 'install/update',
'value' => 'Mise à jour manuelle', 'value' => 'Mise à jour manuelle',
'class' => 'buttonRed', 'class' => 'buttonRed',
'disabled' => !$updateError 'disabled' => !$error
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -330,7 +320,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col3">
<?php echo template::checkbox('configAdvancedConnectCaptcha', true, 'Captcha à la connexion', [ <?php echo template::checkbox('configAdvancedConnectCaptcha', true, 'Captcha à la connexion', [
'checked' => $this->getData(['config', 'connect','captcha']) '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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Paramètres de la sauvegarde</h4> <h4>Paramètre</h4>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::checkbox('configBackupOption', true, 'Inclure le contenu du gestionnaire de fichiers', [ <?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' 'value' => 'Aide'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset3"> <div class="col2 offset4">
<?php echo template::button('configAdvancedButton', [ <?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'config/advanced', 'href' => helper::baseUrl() . 'config/advanced',
'value' => 'Configuration avancée', 'value' => 'Avancée',
'ico' => 'cog-alt', 'ico' => 'cog-alt',
]); ?> ]); ?>
</div> </div>
@ -62,21 +62,6 @@
</div> </div>
</div> </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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
@ -116,7 +101,7 @@
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [ <?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [
'label' => 'Recherche dans le site', 'label' => 'Recherche dans le site',
'selected' => $this->getData(['locale', 'searchPageId']), '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>
</div> </div>
@ -146,7 +131,6 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<p>Lorsque les langues étrangères sont activées, il convient d'adapter les pages spéciales.</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('configRestoreForm'); ?> <?php echo template::formOpen('configManageForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('configRestoreBack', [ <?php echo template::button('configManageBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'config/advanced', 'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left', 'ico' => 'left',
@ -9,7 +9,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo template::submit('configRestoreSubmit',[ <?php echo template::submit('configManageSubmit',[
'value' => 'Restaurer' 'value' => 'Restaurer'
]); ?> ]); ?>
</div> </div>
@ -17,18 +17,18 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Archive à restaurer</h4> <h4>Paramètres</h4>
<div class="row"> <div class="row">
<div class="col10 offset1"> <div class="col10 offset1">
<div class="row"> <div class="row">
<?php echo template::file('configRestoreImportFile', [ <?php echo template::file('configManageImportFile', [
'label' => 'Sélectionnez une archive au format ZIP', 'label' => 'Sélectionnez une archive au format ZIP',
'type' => 2, '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.' '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="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 'checked' => true
]); ?> ]); ?>
</div> </div>
@ -40,7 +40,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <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="row">
<div class="col4 offset1"> <div class="col4 offset1">
<?php <?php
@ -54,22 +54,23 @@
$baseUrlValue = str_replace('?','',$this->getData(['core', 'baseUrl'])); $baseUrlValue = str_replace('?','',$this->getData(['core', 'baseUrl']));
$buttonClass = helper::baseUrl(false,false) !== $baseUrlValue ? '' : 'disabled'; $buttonClass = helper::baseUrl(false,false) !== $baseUrlValue ? '' : 'disabled';
} }
echo template::text('configRestoreBaseURLToConvert', [ echo template::text('configManageBaseURLToConvert', [
'label' => 'Dossier de l\'archive' , 'label' => 'Dossier de l\'archive' ,
'value' => $baseUrlValue, 'value' => $baseUrlValue,
'readonly' => true, '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>
<div class="col4"> <div class="col4">
<?php echo template::text('configRestoreCurrentURL', [ <?php echo template::text('configManageCurrentURL', [
'label' => 'Dossier du site actuel', 'label' => 'Dossier du site actuel',
'value' => helper::baseUrl(false,false), 'value' => helper::baseUrl(false,false),
'readonly' => true 'readonly' => true,
'help' => 'Dossier du base site actuel.'
]); ?> ]); ?>
</div> </div>
<div class="col2 verticalAlignMiddle"> <div class="col2 verticalAlignMiddle">
<?php echo template::button('configRestoreUpdateBaseURLButton', [ <?php echo template::button('configManageUpdateBaseURLButton', [
'href' => helper::baseUrl() . 'config/updateBaseUrl', 'href' => helper::baseUrl() . 'config/updateBaseUrl',
'class' => $buttonClass, 'class' => $buttonClass,
'value' => 'convertir' '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 // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
$success = true; $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 // 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)) { if($this->getInput('installPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('installConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
self::$inputNotices['installConfirmPassword'] = 'Incorrect'; self::$inputNotices['installConfirmPassword'] = 'Incorrect';
@ -117,8 +115,8 @@ class install extends common {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl(false), 'redirect' => helper::baseUrl(false),
'notification' => ($sent === true ? 'Installation terminée' : $sent), 'notification' => $sent === true ? 'Installation terminée' : $sent,
'state' => ($sent === true ? true : null) '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, 'attempt' => 3,
'log' => false, 'log' => false,
'captcha' => true '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' => [ 'core' => [
'dataVersion' => 11000, 'dataVersion' => 10602,
'lastBackup' => 0, 'lastBackup' => 0,
'lastClearTmp' => 0, 'lastClearTmp' => 0,
'lastAutoUpdate' => 0, 'lastAutoUpdate' => 0,
@ -97,6 +83,19 @@ class init extends common {
], ],
'module' => [], 'module' => [],
'user' => [], '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' => [ 'theme' => [
'body' => [ 'body' => [
'backgroundColor' => 'rgba(236, 239, 241, 1)', 'backgroundColor' => 'rgba(236, 239, 241, 1)',
@ -140,7 +139,7 @@ class init extends common {
'fontSize' => '2em', 'fontSize' => '2em',
'fontWeight' => 'normal', 'fontWeight' => 'normal',
'height' => '150px', 'height' => '150px',
'image' => 'banniere/zwii_banniere_norvege-960px.jpg', 'image' => 'banniere960.jpg',
'imagePosition' => 'center center', 'imagePosition' => 'center center',
'imageRepeat' => 'no-repeat', 'imageRepeat' => 'no-repeat',
'margin' => false, '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'), 'displayMenu' => $this->getinput('pageEditDisplayMenu'),
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN), 'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', 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 // 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 * 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

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

@ -17,77 +17,10 @@ class translate extends common {
public static $actions = [ public static $actions = [
/*'config' => self::GROUP_MODERATOR,*/ /*'config' => self::GROUP_MODERATOR,*/
'index' => self::GROUP_ADMIN, 'index' => self::GROUP_MODERATOR,
'copy' => self::GROUP_ADMIN,
'language' => self::GROUP_VISITOR '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 * Configuration
*/ */
@ -95,26 +28,19 @@ class translate extends common {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
// Désactivation du script Google // Edtion des langues
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
foreach (self::$i18nList as $keyi18n => $value) { foreach (self::$i18nList as $keyi18n => $value) {
if ($keyi18n === 'fr') {continue;} 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 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); $this->removeDir( self::DATA_DIR . $keyi18n);
} }
// Installation d'une langue // Installation d'une langue
if ( $this->getInput('translate' . strtoupper($keyi18n)) === 'site' if ( $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === true )
AND is_dir(self::DATA_DIR . $keyi18n) === false )
{ {
// Créer les données absentes // Créer le dossier
if (is_dir( self::DATA_DIR . $keyi18n ) === false ) { if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
mkdir( self::DATA_DIR . $keyi18n); mkdir( self::DATA_DIR . $keyi18n);
} }
@ -132,27 +58,29 @@ class translate extends common {
$e->save(); $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 // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -161,54 +89,22 @@ class translate extends common {
'state' => true '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 // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Gestion des langues', 'title' => 'Paramètres',
'view' => 'index' 'view' => 'index'
]); ]);
} }
/*
/* * Traitement du changement de langues
* Traitement du changement de langue */
* Fonction utilisée par le noyau
*/
public function language() { public function language() {
// Transmettre le choix au noyau
// Activation du drapeau setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
if ( $this->getInput('ZWII_I18N_' . strtoupper($this->getUrl(3))) !== $this->getUrl(2) ) { // Valeurs en sortie sans post
// 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
$this->addOutput([ $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);
});
});

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

@ -8,116 +8,112 @@
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset5"> <div class="col2 offset8">
<?php echo template::button('configAdvancedButton', [
'href' => helper::baseUrl() . 'translate/copy',
'value' => 'Utilitaire de copie',
'ico' => 'cog-alt',
'disabled' => $module::$siteTranslate
]); ?>
</div>
<div class="col2">
<?php echo template::submit('translateFormSubmit'); ?> <?php echo template::submit('translateFormSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Traduction automatique <h4>Langues supportées</h4>
<span class="helpDisplayButton">
<?php echo template::ico('help', 'left');?>
</span>
</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [ <b>Traduction automatique :</b>
'checked' => $this->getData(['config','i18n', 'scriptGoogle']), <div class="col12">
'help' => 'Le script Google Translate assure la traduction automatique du site.' <?php echo template::checkbox('translateScriptFlagDE', true, 'Allemand', [
]); ?> 'checked' => $this->getData(['config','translate', 'scriptDE'])
</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.'
]); ?> ]); ?>
</div> </div>
</div> <div class="col12">
<div class="row"> <?php echo template::checkbox('translateScriptFlagEN', true, 'Anglais', [
<div class="col6"> 'checked' => $this->getData(['config','translate', 'scriptEN'])
<?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>
<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>
<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">
<b>Traduction rédigée :</b>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagEN', true, 'Anglais', [
'checked' => $this->getData(['config', 'translate', 'siteEN'])
]); ?>
</div>
<div class="col12">
<?php echo template::checkbox('translateSiteFlagDE', true, 'Allemand', [
'checked' => $this->getData(['config', 'translate', 'siteDE'])
]); ?>
</div>
<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>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block" id="flagsWrapper"> <div class="block">
<h4>Mode de traduction et affichage des drapeaux</h4> <h4>Paramètres de traduction automatique</h4>
<div class="row"> <div class="row">
<div class="col4 offset4"> <div class="col4">
<?php echo template::select('translateFR', ['none'=>'Drapeau masqué','site'=>'Drapeau affiché'], [ <?php echo template::checkbox('translateScriptGoogle', true, 'Active le script de traduction automatique', [
'label' => 'Français', 'checked' => $this->getData(['config','translate', 'scriptGoogle'])
'selected' => $this->getData(['config', 'i18n' , 'fr']) ]); ?>
]); ?>
</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> </div>
<div class="col8 offset2"> <div class="col4">
<?php echo template::select('translateEN', $module::$translateOptions['en'], [ <?php echo template::checkbox('translateAdmin', true, 'Mode connexion', [
'label' => 'Anglais', 'checked' => $this->getData(['config','translate', 'admin']),
'class' => 'translateFlagSelect', 'help' => 'Traduction automatique du site et de l\'interface du CMS'
'selected' => $this->getData(['config', 'i18n' , 'en']) ]); ?>
]); ?>
</div> </div>
<div class="col8 offset2"> <div class="col4">
<?php echo template::select('translateES', $module::$translateOptions['es'], [ <?php echo template::checkbox('translateCredits', true, 'Afficher les crédits du script Google', [
'label' => 'Espagnol', 'checked' => $this->getData(['config','translate', 'showCredits']),
'class' => 'translateFlagSelect', 'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
'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> </div>
</div> </div>
@ -125,14 +121,4 @@
</div> </div>
</div> </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(); ?> <?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), 'signature' => $this->getInput('userAddSignature', helper::FILTER_INT, true),
'mail' => $userMail, 'mail' => $userMail,
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true), 'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
'connectFail' => null, "connectFail" => null,
'connectTimeout' => null, "connectTimeout" => null,
'accessUrl' => null, "accessUrl" => null,
'accessTimer' => null, "accessTimer" => null,
'accessCsrf' => null "accessCsrf" => null
] ]
]); ]);
@ -656,11 +656,11 @@ class user extends common {
'pseudo' => $item['prenom'], 'pseudo' => $item['prenom'],
'signature' => 1, // Pseudo 'signature' => 1, // Pseudo
'password' => uniqid(), // A modifier à la première connexion 'password' => uniqid(), // A modifier à la première connexion
'connectFail' => null, "connectFail" => null,
'connectTimeout' => null, "connectTimeout" => null,
'accessUrl' => null, "accessUrl" => null,
'accessTimer' => null, "accessTimer" => null,
'accessCsrf' => null "accessCsrf" => null
]]); ]]);
// Icône de notification // Icône de notification
$item['notification'] = $create ? template::ico('check') : template::ico('cancel'); $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