Activation de la langue à l'installation

This commit is contained in:
Fred Tempez 2022-11-01 20:53:19 +01:00
parent ff16d480c0
commit c22198d52d
5 changed files with 18 additions and 32 deletions

View File

@ -341,12 +341,11 @@ class common
if ($this->getData(['user']) === []) {
// Installation en cours
self::$i18nUI = array_key_exists($this->getInput('ZWII_UI'), self::$languages) ? $this->getInput('ZWII_UI') : 'fr_FR';
helper::deleteCookie('ZWII_UI');
} else {
// Langue sélectionnée dans le compte
self::$i18nUI = $this->getData(['user', $this->getUser('id'), 'language']);
// Validation de la langue
self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI)) ? self::$i18nUI = 'fr_FR' : self::$i18nUI;
self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI)) ? 'fr_FR' : self::$i18nUI;
}
// Le fichier existe-t-il ?

View File

@ -199,6 +199,7 @@ class install extends common
// Nettoyage
unlink(self::TEMP_DIR . 'files.tar.gz');
unlink(self::TEMP_DIR . 'files.tar');
helper::deleteCookie('ZWII_UI');
// Créer le dossier des fontes
if (!is_dir(self::DATA_DIR . 'fonts')) {
@ -221,6 +222,11 @@ class install extends common
$this->copyDir('core/module/install/ressource/themes', self::FILE_DIR . 'source/theme');
unlink(self::FILE_DIR . 'source/theme/themes.json');
// Créer sitemap
$this->createSitemap();
// Mise à jour de la liste des pages pour TinyMCE
$this->listPages();
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl(false),
@ -237,11 +243,6 @@ class install extends common
$dataThemes = json_decode($dataThemes, true);
self::$themes = helper::arrayColumn($dataThemes, 'name');
// Créer sitemap
$this->createSitemap();
// Mise à jour de la liste des pages pour TinyMCE
$this->listPages();
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,

View File

@ -65,15 +65,15 @@
<div class="col3">
<?php echo template::select('installProxyType', $module::$proxyType, [
'label' => 'Type de proxy'
]); ?>
</div>
<div class="col6">
]); ?>
</div>
<div class="col6">
<?php echo template::text('installProxyUrl', [
'label' => 'Adresse du proxy',
'placeholder' => 'cache.proxy.fr'
]); ?>
</div>
<div class="col3">
<div class="col3">
<?php echo template::text('installProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060'
@ -82,10 +82,14 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::select('installTheme', $module::$themes, [
<?php echo template::select('installTheme', $module::$themes, [
'label' => 'Thème'
]); ?>
<?php echo template::hidden('installLanguage', [
'value' => $this->getUrl(2)
]); ?>
</div>
</div>
</div>
</li>

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

View File

@ -29,12 +29,12 @@
</div>
<?php endif; ?>
<div class="row">
<div class="col6">
<div class="col9">
<?php echo template::checkbox('userLoginLongTime', true, 'Rester connecté sur ce navigateur', [
'checked' => $module::$userLongtime
]); ?>
</div>
<div class="col6 textAlignRight">
<div class="col3 textAlignRight">
<a href="<?php echo helper::baseUrl(); ?>user/forgot/<?php echo $this->getUrl(2); ?>">Mot de passe perdu ?</a>
</div>
</div>