// Add tabs file when add a new language
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16209 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
72d36e4878
commit
b45cc923ad
1 file changed
+15
-2
+15
-2
@@ -83,6 +83,7 @@ class LanguageCore extends ObjectModel
|
|||||||
'errors' => '_ERRORS',
|
'errors' => '_ERRORS',
|
||||||
'admin' => '_LANGADM',
|
'admin' => '_LANGADM',
|
||||||
'pdf' => '_LANGPDF',
|
'pdf' => '_LANGPDF',
|
||||||
|
'tabs' => 'tabs',
|
||||||
);
|
);
|
||||||
|
|
||||||
public function __construct($id = null, $id_lang = null)
|
public function __construct($id = null, $id_lang = null)
|
||||||
@@ -113,11 +114,23 @@ class LanguageCore extends ObjectModel
|
|||||||
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||||
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
|
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
|
||||||
foreach ($this->translationsFilesAndVars as $file => $var)
|
foreach ($this->translationsFilesAndVars as $file => $var)
|
||||||
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php'))
|
{
|
||||||
file_put_contents(_PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php', '<?php
|
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
||||||
|
if (!file_exists($path_file))
|
||||||
|
if ($file != 'tabs')
|
||||||
|
file_put_contents($path_file, '<?php
|
||||||
global $'.$var.';
|
global $'.$var.';
|
||||||
$'.$var.' = array();
|
$'.$var.' = array();
|
||||||
?>');
|
?>');
|
||||||
|
else
|
||||||
|
file_put_contents($path_file, '<?php
|
||||||
|
$'.$var.' = array();
|
||||||
|
return $'.$var.';
|
||||||
|
?>');
|
||||||
|
|
||||||
|
@chmod($path_file, 0777);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user