// revert from r11699
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11702 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+8
-10
@@ -306,26 +306,24 @@ class LinkCore
|
||||
public function getImageLink($name, $ids, $type = null)
|
||||
{
|
||||
// legacy mode or default image
|
||||
$theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
|
||||
if ((Configuration::get('PS_LEGACY_IMAGES')
|
||||
&& (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg')))
|
||||
&& (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'.jpg')))
|
||||
|| strpos($ids, 'default') !== false)
|
||||
{
|
||||
if ($this->allow == 1)
|
||||
$uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
|
||||
else
|
||||
$uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg';
|
||||
}
|
||||
if ($this->allow == 1)
|
||||
$uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg';
|
||||
else
|
||||
$uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg';
|
||||
}else
|
||||
{
|
||||
// if ids if of the form id_product-id_image, we want to extract the id_image part
|
||||
$split_ids = explode('-', $ids);
|
||||
$id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]);
|
||||
$theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
|
||||
|
||||
if ($this->allow == 1)
|
||||
$uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
|
||||
$uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').'/'.$name.'.jpg';
|
||||
else
|
||||
$uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg';
|
||||
$uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'.jpg';
|
||||
}
|
||||
|
||||
return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;
|
||||
|
||||
Reference in New Issue
Block a user