forked from ZwiiCMS-Team/ZwiiCMS
correction i18n
This commit is contained in:
parent
052a2b1746
commit
235e8b0f86
@ -45,7 +45,7 @@ class common {
|
|||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
|
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
|
||||||
const ZWII_VERSION = '11.0.000';
|
const ZWII_VERSION = '11.0.001';
|
||||||
const ZWII_UPDATE_CHANNEL = "v11";
|
const ZWII_UPDATE_CHANNEL = "v11";
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
@ -252,7 +252,7 @@ class common {
|
|||||||
* - L'auto-détection est active
|
* - L'auto-détection est active
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( $this->getData(['config', 'i18n', 'enabled']) === true
|
if ( $this->getData(['config', 'i18n', 'active']) === true
|
||||||
AND $this->getData(['config', 'i18n','scriptGoogle']) === true
|
AND $this->getData(['config', 'i18n','scriptGoogle']) === true
|
||||||
AND $this->getData(['config', 'i18n','autoDetect']) === true
|
AND $this->getData(['config', 'i18n','autoDetect']) === true
|
||||||
AND $this->getInput('ZWII_I18N_SITE') !== ''
|
AND $this->getInput('ZWII_I18N_SITE') !== ''
|
||||||
@ -1745,7 +1745,7 @@ class core extends common {
|
|||||||
// Chargement de la bibliothèque googtrans
|
// Chargement de la bibliothèque googtrans
|
||||||
|
|
||||||
// Le script de traduction est sélectionné
|
// Le script de traduction est sélectionné
|
||||||
if ($this->getData(['config', 'i18n', 'enabled']) === true) {
|
if ($this->getData(['config', 'i18n', 'active']) === true) {
|
||||||
if ( $this->getData(['config', 'i18n','scriptGoogle']) === true
|
if ( $this->getData(['config', 'i18n','scriptGoogle']) === true
|
||||||
// et la traduction de la langue courante est automatique
|
// et la traduction de la langue courante est automatique
|
||||||
AND ( $this->getInput('ZWII_I18N_SCRIPT') !== ''
|
AND ( $this->getInput('ZWII_I18N_SCRIPT') !== ''
|
||||||
@ -1892,7 +1892,7 @@ class layout extends common {
|
|||||||
* @param Page par défaut
|
* @param Page par défaut
|
||||||
*/
|
*/
|
||||||
public function showContent() {
|
public function showContent() {
|
||||||
if ($this->getData(['config', 'i18n', 'enabled']) === true) {
|
if ($this->getData(['config', 'i18n', 'active']) === true) {
|
||||||
echo $this->showi18n('Site');
|
echo $this->showi18n('Site');
|
||||||
}
|
}
|
||||||
if(
|
if(
|
||||||
@ -1913,7 +1913,7 @@ class layout extends common {
|
|||||||
* La traduction est active et le site n'est pas en français.
|
* La traduction est active et le site n'est pas en français.
|
||||||
* La fonction est activée.
|
* La fonction est activée.
|
||||||
*/
|
*/
|
||||||
if ( $this->getData(['config', 'i18n', 'enabled']) === true
|
if ( $this->getData(['config', 'i18n', 'active']) === true
|
||||||
AND $this->getData(['config', 'i18n','scriptGoogle']) === true
|
AND $this->getData(['config', 'i18n','scriptGoogle']) === true
|
||||||
AND $this->getData(['config', 'i18n','showCredits']) === true
|
AND $this->getData(['config', 'i18n','showCredits']) === true
|
||||||
AND
|
AND
|
||||||
@ -2279,7 +2279,7 @@ class layout extends common {
|
|||||||
}
|
}
|
||||||
// Retourne les items du menu
|
// Retourne les items du menu
|
||||||
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
|
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
|
||||||
if ($this->getData(['config', 'i18n', 'enabled']) === true) {
|
if ($this->getData(['config', 'i18n', 'active']) === true) {
|
||||||
echo $this->showi18n('Nav');
|
echo $this->showi18n('Nav');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2521,11 +2521,11 @@ class layout extends common {
|
|||||||
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
|
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
|
||||||
}
|
}
|
||||||
if($this->getUser('group') >= self::GROUP_ADMIN) {
|
if($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>';
|
if ($this->getData(['config', 'i18n', 'active']) === true) {
|
||||||
if ($this->getData(['config', 'i18n', 'enabled']) === true) {
|
|
||||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
|
$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
|
||||||
}
|
}
|
||||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'addon" data-tippy-content="Gérer les modules">' . template::ico('puzzle') . '</a></li>';
|
$rightItems .= '<li><a href="' . helper::baseUrl() . 'addon" data-tippy-content="Gérer les modules">' . template::ico('puzzle') . '</a></li>';
|
||||||
|
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>';
|
||||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
|
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
|
||||||
// Mise à jour automatique
|
// Mise à jour automatique
|
||||||
$today = mktime(0, 0, 0);
|
$today = mktime(0, 0, 0);
|
||||||
|
@ -401,7 +401,7 @@ class config extends common {
|
|||||||
'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) ]);
|
$this->setData(['config', 'i18n', 'active', $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
|
||||||
@ -481,7 +481,7 @@ class config extends common {
|
|||||||
'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
|
'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
|
||||||
],
|
],
|
||||||
'i18n' => [
|
'i18n' => [
|
||||||
'enabled' => $this->getData(['config', 'i18n', 'enabled'])
|
'active' => $this->getData(['config', 'i18n', 'active'])
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::checkbox('configI18n', true, 'Activer la gestion des langues étrangères', [
|
<?php echo template::checkbox('configI18n', true, 'Activer la gestion des langues étrangères', [
|
||||||
'checked' => $this->getData(['config', 'i18n', 'enabled']),
|
'checked' => $this->getData(['config', 'i18n', 'active']),
|
||||||
'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.'
|
'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>
|
||||||
|
@ -32,6 +32,20 @@ class init extends common {
|
|||||||
'attempt' => 3,
|
'attempt' => 3,
|
||||||
'log' => false,
|
'log' => false,
|
||||||
'captcha' => true
|
'captcha' => true
|
||||||
|
],
|
||||||
|
"i18n" => [
|
||||||
|
"active"=> true,
|
||||||
|
"scriptGoogle"=> false,
|
||||||
|
"showCredits"=> false,
|
||||||
|
"autoDetect"=> false,
|
||||||
|
"admin"=> false,
|
||||||
|
"fr"=> "none",
|
||||||
|
"de"=> "none",
|
||||||
|
"en"=> "none",
|
||||||
|
"es"=> "none",
|
||||||
|
"it"=> "none",
|
||||||
|
"nl"=> "none",
|
||||||
|
"pt"=> "none"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'core' => [
|
'core' => [
|
||||||
|
@ -129,7 +129,7 @@ class translate extends common {
|
|||||||
}
|
}
|
||||||
// Enregistrement des données
|
// Enregistrement des données
|
||||||
$this->setData(['config','i18n', [
|
$this->setData(['config','i18n', [
|
||||||
'enabled' => $this->getData(['config', 'i18n', 'enabled']),
|
'active' => $this->getData(['config', 'i18n', 'active']),
|
||||||
'scriptGoogle' => $script,
|
'scriptGoogle' => $script,
|
||||||
'showCredits' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
|
'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,
|
'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user