trad auto hors connexion

This commit is contained in:
Fred Tempez 2020-11-14 14:52:18 +01:00
parent 972b86676e
commit 34a26ea4ab
9 changed files with 36 additions and 11 deletions

View File

@ -116,8 +116,7 @@ class common {
'tippy',
'zwiico',
'imagemap',
'simplelightbox',
'translation'
'simplelightbox'
],
'view' => ''
];
@ -2028,6 +2027,7 @@ class core extends common {
'vendor' => array_merge($this->output['vendor'], $output['vendor'])
]);
}
if($output['title'] !== null) {
$this->addOutput([
'title' => $output['title']
@ -2047,6 +2047,13 @@ class core extends common {
}
}
}
// Librairie googtrans ajouté dynamiquement
if ( $this->getData(['translate','active']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) {
$this->addOutput([
'vendor' => array_merge($this->output['vendor'], ['i18n'])
]);
}
// Erreurs
if($access === 'login') {
http_response_code(302);
@ -2825,12 +2832,6 @@ class layout extends common {
// Librairies
$moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']);
foreach($this->core->output['vendor'] as $vendorName) {
// Librairie googtrans
if ( $vendorName === 'translation'
AND $this->getData(['translate','active']) === false
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) {
continue;
}
// Coeur
if(file_exists('core/vendor/' . $vendorName . '/inc.json')) {
$vendorPath = 'core/vendor/' . $vendorName . '/';

View File

@ -79,6 +79,10 @@ class init extends common {
'hideMenuChildren' =>false
]
],
'translate' => [
'active' => false,
'showCredits' => false
],
'module' => [],
'user' => [],
'theme' => [

View File

@ -26,8 +26,8 @@ class translate extends common {
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['translate', [
'active' => $this->getInput('translateActive', helper::FILTER_URL),
'showCredits' => $this->getInput('translateCredits', helper::FILTER_URL),
'active' => $this->getInput('translateActive', helper::FILTER_BOOLEAN),
'showCredits' => $this->getInput('translateCredits', helper::FILTER_BOOLEAN),
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -0,0 +1,20 @@
/**
* 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

@ -3,7 +3,7 @@
<div class="col2">
<?php echo template::button('translateFormBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'href' => helper::baseUrl(),
'ico' => 'left',
'value' => 'Retour'
]); ?>