// Fix list of lang pack from prestashop.com
This commit is contained in:
1 parent
0ab5542f3e
commit
359eb16ee5
2 files changed
+4
-3
No files matched your search
@@ -419,7 +419,7 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
$this->errors[] = $error;
|
$this->errors[] = $error;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!$tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !move_uploaded_file($_FILES['no-picture']['tmp_name'], $tmp_name))
|
if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['no-picture']['tmp_name'], $tmp_name))
|
||||||
return false;
|
return false;
|
||||||
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'.jpg'))
|
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'.jpg'))
|
||||||
$this->errors[] = Tools::displayError('An error occurred while copying no-picture image to your product folder.');
|
$this->errors[] = Tools::displayError('An error occurred while copying no-picture image to your product folder.');
|
||||||
@@ -485,6 +485,7 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
if (!$lang->active)
|
if (!$lang->active)
|
||||||
$this->errors[] = Tools::displayError('You cannot set this language as default language because it\'s disabled');
|
$this->errors[] = Tools::displayError('You cannot set this language as default language because it\'s disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajaxProcessCheckLangPack()
|
public function ajaxProcessCheckLangPack()
|
||||||
{
|
{
|
||||||
$this->json = true;
|
$this->json = true;
|
||||||
@@ -501,7 +502,7 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
if (@fsockopen('api.prestashop.com', 80))
|
if (@fsockopen('api.prestashop.com', 80))
|
||||||
{
|
{
|
||||||
// Get all iso code available
|
// Get all iso code available
|
||||||
$lang_packs = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']);
|
$lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']);
|
||||||
|
|
||||||
if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== null)
|
if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
if (Validate::isLangIsoCode($arr_import_lang[0]))
|
if (Validate::isLangIsoCode($arr_import_lang[0]))
|
||||||
{
|
{
|
||||||
if ($content = Tools::file_get_contents(
|
if ($content = Tools::file_get_contents(
|
||||||
'http://api.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
|
'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
|
||||||
@stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
@stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||||
{
|
{
|
||||||
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
|
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
|
||||||
|
|||||||
Reference in new issue
Block a user