12308 ZWII_UI and Install

This commit is contained in:
Fred Tempez 2023-04-12 21:38:12 +02:00
parent b30a0037fc
commit 095cab701a
5 changed files with 102 additions and 72 deletions

View File

@ -312,7 +312,7 @@ class common
}
// Extraction de la sesion
$this->input['_SESSION'] = $_SESSION;
// $this->input['_SESSION'] = $_SESSION;
// Déterminer la langue du contenu du site
if (isset($_SESSION['ZWII_CONTENT'])) {
@ -356,7 +356,7 @@ class common
: self::$i18nUI;
} else {
// Installation
self::$i18nUI = $this->getInput('ZWII_UI') ? $this->getInput('ZWII_UI') : 'fr_FR';
self::$i18nUI = $_SESSION['ZWII_UI'] ? $_SESSION['ZWII_UI'] : 'fr_FR';
}

View File

@ -54,8 +54,9 @@ class install extends common
// Soumission du formulaire
if ($this->isPost()) {
$lang = $this->getInput('installLanguage');
// Place le cookie pour la suite de l'installation
setcookie('ZWII_UI', $lang, time() + 3600, helper::baseUrl(false, false), '', false, false);
// Pour la suite de l'installation
// setcookie('ZWII_UI', $lang, time() + 3600, helper::baseUrl(false, false), '', false, false);
$_SESSION['ZWII_UI'] = $this->getInput('installLanguage');
// Valeurs en sortie
$this->addOutput([
@ -166,7 +167,8 @@ class install extends common
$this->initData('page', self::$i18nContent, false);
$this->initData('module', self::$i18nContent, false);
// Supprime l'installation FR générée par défaut.
$this->removeDir(self::DATA_DIR . 'fr_FR');
if (is_dir(self::DATA_DIR . 'fr_FR'))
$this->removeDir(self::DATA_DIR . 'fr_FR');
}
// Sauvegarder la configuration du Proxy

View File

@ -1 +1,22 @@
/* Vide */
/**
* 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-2023, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/
.title {
font-weight: bold;
}

View File

@ -2,71 +2,79 @@
<?php echo helper::translate('Renseignez les champs ci-dessous pour finaliser l\'installation.'); ?>
</p>
<?php echo template::formOpen('installForm'); ?>
<h3>
<?php echo helper::translate('Compte administrateur'); ?>
</h3>
<div>
<div class="row">
<div class="col12">
<?php echo template::text('installId', [
'autocomplete' => 'off',
'label' => 'Identifiant'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::password('installPassword', [
'autocomplete' => 'off',
'label' => 'Mot de passe'
]); ?>
</div>
<div class="col6">
<?php echo template::password('installConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::mail('installMail', [
'autocomplete' => 'off',
'label' => 'Adresse électronique'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('installFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
]); ?>
</div>
<div class="col6">
<?php echo template::text('installLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
]); ?>
</div>
</div>
</div>
<ul class="accordion" data-speed="150">
<li class="accordion-item">
<h3 class="accordion-title">
<?php echo '&#9655; ' . helper::translate('Options avancées'); ?>
</h3>
<div class="accordion-content">
<?php if ($this->getUrl(2) === 'fr_FR'): ?>
<div class="row">
<div class="col12">
<details open>
<summary>
<span class="title">
<?php echo helper::translate('Compte administrateur'); ?>
</span>
</summary>
<div class="row">
<div class="col12">
<?php echo template::checkbox('installDefaultData', true, 'Ne pas charger l\'exemple de site (utilisateurs avancés)', [
'checked' => false
]);
?>
<?php echo template::text('installId', [
'autocomplete' => 'off',
'label' => 'Identifiant'
]); ?>
</div>
</div>
<?php endif;?>
<div class="row">
<div class="col6">
<?php echo template::password('installPassword', [
'autocomplete' => 'off',
'label' => 'Mot de passe'
]); ?>
</div>
<div class="col6">
<?php echo template::password('installConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::mail('installMail', [
'autocomplete' => 'off',
'label' => 'Adresse électronique'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('installFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
]); ?>
</div>
<div class="col6">
<?php echo template::text('installLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
]); ?>
</div>
</div>
</details>
</div>
</div>
<div class="row">
<div class="col12">
<details close>
<summary>
<span class="title">
<?php echo helper::translate('Options avancées'); ?>
</span>
</summary>
<?php if ($this->getUrl(2) === 'fr_FR'): ?>
<div class="row">
<div class="col12">
<?php echo template::checkbox('installDefaultData', true, 'Ne pas charger l\'exemple de site (utilisateurs avancés)', [
'checked' => false
]);
?>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col3">
<?php echo template::select('installProxyType', $module::$proxyType, [
@ -95,11 +103,10 @@
'value' => $this->getUrl(2)
]); ?>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</details>
<div class="row">
<div class="col2">
<?php echo template::button('installPrevious', [

View File

@ -615,7 +615,7 @@ class translate extends common
* fait partie des lnagues installées
*/
if (
$this->getInput('ZWII_CONTENT') !== $lang
$_SESSION['ZWII_CONTENT'] !== $lang
&&
is_dir(self::DATA_DIR . $lang)
&&