[10.0.112.dev] Logo googtrans optionnel

This commit is contained in:
Fred Tempez 2019-11-18 10:44:09 +01:00
parent 8ef190477b
commit ed3e276610
3 changed files with 11 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class common {
const I18N_DIR = 'site/i18n/';
// Numéro de version
const ZWII_VERSION = '10.0.110.dev';
const ZWII_VERSION = '10.0.111.dev';
public static $actions = [];
public static $coreModuleIds = [
@ -1231,6 +1231,7 @@ class common {
$this->setData(['config','i18n','fr', 'autotranslate', false]);
// Option de gestion des langues
$this->setData(['config','disablei18n', false]);
$this->setData(['config','googTransLogo', true]);
$this->setData(['core', 'dataVersion', 10000]);
}
}
@ -2217,7 +2218,8 @@ class layout extends common {
}
echo '<div class="translate">' . $this->core->output['content'] . '</div>';
if ($this->getData(['config','i18n',$this->geti18n(),'autoTranslate']) === true) {
if ($this->getData(['config','i18n',$this->geti18n(),'autoTranslate']) === true &&
$this->getData(['config','googTransLogo']) === true) {
echo '<div><a href="//translate.google.com/intl/fr/about/" data-lity><img src="' . helper::baseUrl(false) . 'core/module/i18n/ressource/googtrans.png" /></a></div>';
}
}

View File

@ -404,6 +404,7 @@ class config extends common {
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'disablei18n' => sizeof($this->i18nInstalled() ) === 1 ? $this->getInput('configdisablei18n', helper::FILTER_BOOLEAN) : false,
'googTransLogo' => $this->getInput('configdGoogTransLogo', helper::FILTER_BOOLEAN),
'i18n' => $this->getData(['config','i18n'])
]
]);

View File

@ -117,6 +117,12 @@
'help' => 'L\'option n\'est pas modifiable quand une langue est installée.'
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('configdGoogTransLogo', true, 'Logo Google Translation', [
'checked' => $this->getData(['config', 'googTransLogo']),
'help' => 'Affiche en logo Google Translation en bas des pages traduites automatiquement. Si vous ne traduisez pas vous-même vos pages, cette option est vivement recommandée.'
]); ?>
</div>
</div>
</div>
</div>