forked from ZwiiCMS-Team/ZwiiCMS
move var $script in index
This commit is contained in:
parent
1b1975b252
commit
117530b8f1
@ -96,11 +96,11 @@ class translate extends common {
|
|||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
if($this->isPost()) {
|
if($this->isPost()) {
|
||||||
// Désactivation du script Google
|
// Désactivation du script Google
|
||||||
if ($this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) === false) {
|
$script = $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN);
|
||||||
|
if ($script === false) {
|
||||||
setrawcookie('googtrans', '/fr/fr', time() + 3600, helper::baseUrl(false,false));
|
setrawcookie('googtrans', '/fr/fr', time() + 3600, helper::baseUrl(false,false));
|
||||||
$_SESSION['googtrans'] = '/fr/fr';
|
$_SESSION['googtrans'] = '/fr/fr';
|
||||||
}
|
}
|
||||||
$script = $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN);
|
|
||||||
// Edition des langues
|
// Edition des langues
|
||||||
foreach (self::$i18nList as $keyi18n => $value) {
|
foreach (self::$i18nList as $keyi18n => $value) {
|
||||||
// Effacement d'une langue installée
|
// Effacement d'une langue installée
|
||||||
@ -111,16 +111,25 @@ class translate extends common {
|
|||||||
}
|
}
|
||||||
// Installation d'une langue
|
// Installation d'une langue
|
||||||
if ( $this->getInput('translate' . strtoupper($keyi18n)) === 'site'
|
if ( $this->getInput('translate' . strtoupper($keyi18n)) === 'site'
|
||||||
|
// Pas d'initialisation si la langue existe déjà
|
||||||
AND is_dir(self::DATA_DIR . $keyi18n) === false )
|
AND is_dir(self::DATA_DIR . $keyi18n) === false )
|
||||||
{
|
{
|
||||||
// Pas d'initialisation si la langue existe déjà
|
|
||||||
if (!file_exists( self::DATA_DIR . $keyi18n . '/page.json'))
|
|
||||||
|
if (!file_exists( self::DATA_DIR . $keyi18n . '/page.json')) {
|
||||||
|
echo $keyi18n;
|
||||||
$this->initData('page', $keyi18n, false);
|
$this->initData('page', $keyi18n, false);
|
||||||
if (!file_exists( self::DATA_DIR . $keyi18n . '/module.json'))
|
}
|
||||||
|
|
||||||
|
if (!file_exists( self::DATA_DIR . $keyi18n . '/module.json')) {
|
||||||
$this->initData('module', $keyi18n, false);
|
$this->initData('module', $keyi18n, false);
|
||||||
if (!file_exists( self::DATA_DIR . $keyi18n . '/locale.json'))
|
}
|
||||||
|
|
||||||
|
if (!file_exists( self::DATA_DIR . $keyi18n . '/locale.json')) {
|
||||||
$this->initData('locale', $keyi18n, false);
|
$this->initData('locale', $keyi18n, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// Active le script si une langue est en trad auto
|
// Active le script si une langue est en trad auto
|
||||||
if ($script === false
|
if ($script === false
|
||||||
AND $this->getInput('translate'. strtoupper($keyi18n)) === 'script') {
|
AND $this->getInput('translate'. strtoupper($keyi18n)) === 'script') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user