diff --git a/core/core.php b/core/core.php index 51bb8085..8d175f88 100644 --- a/core/core.php +++ b/core/core.php @@ -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 . '/'; diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 6fc1fbf5..23237a3f 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -79,6 +79,10 @@ class init extends common { 'hideMenuChildren' =>false ] ], + 'translate' => [ + 'active' => false, + 'showCredits' => false + ], 'module' => [], 'user' => [], 'theme' => [ diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index a9656934..8efb2e8c 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -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([ diff --git a/core/module/translate/view/index/index.css b/core/module/translate/view/index/index.css new file mode 100644 index 00000000..51a18ec5 --- /dev/null +++ b/core/module/translate/view/index/index.css @@ -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 + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @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 +*/ \ No newline at end of file diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index 7e1e9bf6..00de0b0f 100644 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl(), 'ico' => 'left', 'value' => 'Retour' ]); ?> diff --git a/core/vendor/translation/css/translateelement.css b/core/vendor/i18n/css/translateelement.css similarity index 100% rename from core/vendor/translation/css/translateelement.css rename to core/vendor/i18n/css/translateelement.css diff --git a/core/vendor/translation/inc.json b/core/vendor/i18n/inc.json similarity index 100% rename from core/vendor/translation/inc.json rename to core/vendor/i18n/inc.json diff --git a/core/vendor/translation/translate.js b/core/vendor/i18n/translate.js similarity index 100% rename from core/vendor/translation/translate.js rename to core/vendor/i18n/translate.js diff --git a/core/vendor/translation/translation.js b/core/vendor/i18n/translation.js similarity index 100% rename from core/vendor/translation/translation.js rename to core/vendor/i18n/translation.js