// fix admin Language and Theme controller
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11955 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -486,6 +486,41 @@ class AdminLanguagesControllerCore extends AdminController
|
||||
if (!$lang->active)
|
||||
$this->_errors[] = Tools::displayError('You cannot set this language as default language because it\'s disabled');
|
||||
}
|
||||
public function ajaxProcessCheckLangPack()
|
||||
{
|
||||
$this->json = true;
|
||||
if(empty($_GET['iso_lang']))
|
||||
{
|
||||
$this->status = 'error';
|
||||
$this->_errors[] = '[TECHNICAL ERROR] iso_lang not set or empty';
|
||||
}
|
||||
if(empty($_GET['ps_version']))
|
||||
{
|
||||
$this->status = 'error';
|
||||
$this->_errors[] = '[TECHNICAL ERROR] ps_version not set or empty';
|
||||
}
|
||||
if(@fsockopen('api.prestashop.com', 80))
|
||||
{
|
||||
// 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']);
|
||||
|
||||
if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== NULL)
|
||||
{
|
||||
$this->status = 'ok';
|
||||
$this->content = $lang_packs;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->status = 'error';
|
||||
$this->_errors[] = $this->l('wrong ISO code or lang pack unavailable');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->status = 'error';
|
||||
$this->_errors[] = '[TECHNICAL ERROR] Server unreachable';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user