// Changed image system to new default + #PSCFV-4068
This commit is contained in:
@@ -208,7 +208,7 @@ class HelperListCore extends Helper
|
||||
|
||||
if (method_exists($this->context->controller, $method_name))
|
||||
$this->_list[$index][$action] = $this->context->controller->$method_name($this->token, $id, $name);
|
||||
else if (method_exists($this, $method_name))
|
||||
elseif (method_exists($this, $method_name))
|
||||
$this->_list[$index][$action] = $this->$method_name($this->token, $id, $name);
|
||||
}
|
||||
}
|
||||
@@ -236,9 +236,9 @@ class HelperListCore extends Helper
|
||||
Tools::getValue('id_product')
|
||||
);
|
||||
}
|
||||
else if (isset($params['activeVisu']))
|
||||
elseif (isset($params['activeVisu']))
|
||||
$this->_list[$index][$key] = (bool)$tr[$key];
|
||||
else if (isset($params['position']))
|
||||
elseif (isset($params['position']))
|
||||
{
|
||||
$this->_list[$index][$key] = array(
|
||||
'position' => $tr[$key],
|
||||
@@ -252,14 +252,17 @@ class HelperListCore extends Helper
|
||||
'&way=0&position='.((int)$tr['position'] - 1).'&token='.$this->token
|
||||
);
|
||||
}
|
||||
else if (isset($params['image']))
|
||||
elseif (isset($params['image']))
|
||||
{
|
||||
// item_id is the product id in a product image context, else it is the image id.
|
||||
$item_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id;
|
||||
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType;
|
||||
if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES'))
|
||||
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType;
|
||||
else
|
||||
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.Image::getImgFolderStatic($tr['id_image']).(int)$tr['id_image'].'.'.$this->imageType;
|
||||
$this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType);
|
||||
}
|
||||
else if (isset($params['icon']) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default'])))
|
||||
elseif (isset($params['icon']) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default'])))
|
||||
{
|
||||
if (isset($params['icon'][$tr[$key]]) && is_array($params['icon'][$tr[$key]]))
|
||||
$this->_list[$index][$key] = array(
|
||||
@@ -272,18 +275,18 @@ class HelperListCore extends Helper
|
||||
'alt' => isset($params['icon'][$tr[$key]]) ? $params['icon'][$tr[$key]] : $params['icon']['default'],
|
||||
);
|
||||
}
|
||||
else if (isset($params['type']) && $params['type'] == 'float')
|
||||
elseif (isset($params['type']) && $params['type'] == 'float')
|
||||
$this->_list[$index][$key] = rtrim(rtrim($tr[$key], '0'), '.');
|
||||
else if (isset($params['type']) && $params['type'] == 'price')
|
||||
elseif (isset($params['type']) && $params['type'] == 'price')
|
||||
{
|
||||
$currency = (isset($params['currency']) && $params['currency']) ? Currency::getCurrencyInstance($tr['id_currency']) : $this->context->currency;
|
||||
$this->_list[$index][$key] = Tools::displayPrice($tr[$key], $currency, false);
|
||||
}
|
||||
else if (isset($params['type']) && $params['type'] == 'date')
|
||||
elseif (isset($params['type']) && $params['type'] == 'date')
|
||||
$this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id);
|
||||
else if (isset($params['type']) && $params['type'] == 'datetime')
|
||||
elseif (isset($params['type']) && $params['type'] == 'datetime')
|
||||
$this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id, true);
|
||||
else if (isset($tr[$key]))
|
||||
elseif (isset($tr[$key]))
|
||||
{
|
||||
$echo = $tr[$key];
|
||||
if (isset($params['callback']))
|
||||
|
||||
Reference in New Issue
Block a user