changed path from dirname(__FILE__) to PS_ROOT_DIR
This commit is contained in:
@@ -530,8 +530,8 @@ class LanguageCore extends ObjectModel
|
||||
{
|
||||
if (file_exists($image_directory.$this->iso_code.$image))
|
||||
unlink($image_directory.$this->iso_code.$image);
|
||||
if (file_exists(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg'))
|
||||
unlink(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg');
|
||||
if (file_exists(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg'))
|
||||
unlink(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ class LanguageCore extends ObjectModel
|
||||
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
|
||||
if ($flag != null && !preg_match('/<body>/', $flag))
|
||||
{
|
||||
$file = fopen(dirname(__FILE__).'/../img/l/'.(int)$lang->id.'.jpg', 'w');
|
||||
$file = fopen(_PS_ROOT_DIR_.'/img/l/'.(int)$lang->id.'.jpg', 'w');
|
||||
if ($file)
|
||||
{
|
||||
fwrite($file, $flag);
|
||||
@@ -740,14 +740,14 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to)
|
||||
foreach ($files_copy as $file)
|
||||
@copy(dirname(__FILE__).'/../img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file));
|
||||
@copy(_PS_ROOT_DIR_.'/img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static function _copyNoneFlag($id)
|
||||
{
|
||||
return copy(dirname(__FILE__).'/../img/l/none.jpg', dirname(__FILE__).'/../img/l/'.$id.'.jpg');
|
||||
return copy(_PS_ROOT_DIR_.'/img/l/none.jpg', _PS_ROOT_DIR_.'/img/l/'.$id.'.jpg');
|
||||
}
|
||||
|
||||
protected static $_cache_language_installation = null;
|
||||
|
||||
Reference in New Issue
Block a user