defaut data correction sylvain + emplacement translate dans config

This commit is contained in:
Fred Tempez 2020-11-24 09:13:49 +01:00
parent 639fa7c85f
commit 1251f247d3
4 changed files with 21 additions and 15 deletions

View File

@ -164,7 +164,6 @@ class common {
'theme' => '',
'admin' => '',
'blacklist' => '',
'translate' => '',
'locale' => ''
];
@ -219,7 +218,7 @@ class common {
}
// Auto traduction
if ( $this->getData(['translate','active'])) {
if ( $this->getData(['config','translate','active'])) {
// Lire la langue du navigateur
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
@ -2137,7 +2136,7 @@ class core extends common {
// Librairie googtrans ajouté dynamiquement
if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr'
AND $this->getData(['translate','active']) === true
AND $this->getData(['config','translate','active']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) {
$this->addOutput([
'vendor' => array_merge($this->output['vendor'], ['i18n'])
@ -2278,8 +2277,8 @@ class layout extends common {
echo $this->core->output['content'];
if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr'
AND $this->getData(['translate','showCredits']) === true
AND $this->getData(['translate','active']) === true )
AND $this->getData(['config','translate','showCredits']) === true
AND $this->getData(['config','translate','active']) === true )
{
echo '<div id="googTransLogo"><a href="//policies.google.com/terms#toc-content" data-lity><img src="core/module/translate/ressource/googtrans.png" /></a></div>';
}

View File

@ -41,7 +41,11 @@ class init extends common {
'attempt' => 3,
'log' => false,
'captcha' => true
]
],
'translate' => [
'active' => false,
'showCredits' => false
],
],
'core' => [
'dataVersion' => 10306,
@ -80,10 +84,6 @@ class init extends common {
'hideMenuChildren' =>false
]
],
'translate' => [
'active' => false,
'showCredits' => false
],
'module' => [],
'user' => [],
'theme' => [
@ -651,7 +651,13 @@ class init extends common {
'blog' => [
'config' => [
'feeds' => true,
'feedsLabel' => "Syndication RSS"
'feedsLabel' => "Syndication RSS",
"editConsent" => "all",
"commentMaxlength" => "500",
"commentApproved" => false,
"commentClose" => false,
"commentNotification" => false,
"commentGroupNotification" => 1
],
'posts' => [
'mon-premier-article' => [
@ -661,7 +667,8 @@ class init extends common {
'author' => 'Rémi',
'content' => 'Article bien rédigé et très pertinent, bravo !',
'createdOn' => 1421748000,
'userId' => ''
'userId' => '',
'approval' => true
]
],
'content' => '<p>Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.</p><p>Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.</p><p>Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.</p>',

View File

@ -25,7 +25,7 @@ class translate extends common {
public function index() {
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['translate', [
$this->setData(['config','translate', [
'active' => $this->getInput('translateActive', helper::FILTER_BOOLEAN),
'showCredits' => $this->getInput('translateActive', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
]]);

View File

@ -19,13 +19,13 @@
<div class="row">
<div class="col6">
<?php echo template::checkbox('translateActive', true, 'Traduction automatique', [
'checked' => $this->getData(['translate', 'active']),
'checked' => $this->getData(['config', 'translate', 'active']),
'help' => 'Traduction automatique du site hors connexion par le script Google Translate selon la langue du navigateur du visiteur.'
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('translateCredits', true, 'Afficher les crédits', [
'checked' => $this->getData(['translate', 'showCredits']),
'checked' => $this->getData(['config', 'translate', 'showCredits']),
'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
]); ?>
</div>