public static
getImageDisplay
(mixed $image, mixed $imageAdditional, mixed $pathItem, mixed $switchImage, mixed $width, mixed $height, mixed $imageSize, mixed $layoutType, mixed $attributesOptions, mixed $attributesOptionsType = 1)
public static function getImageDisplay($image, $imageAdditional, $pathItem, $switchImage, $width, $height, $imageSize, $layoutType, $attributesOptions, $attributesOptionsType = 1)
{
$imageA = array();
if ($imageSize != '') {
$imageA['size'] = $imageSize;
} else {
$imageA['size'] = $layoutType == 'gridlist' ? 'large' : 'medium';
}
$imageA['image'] = PhocacartImage::getThumbnailName($pathItem, $image, $imageA['size']);
$imageA['default'] = $imageA['image'];
if ($attributesOptionsType == 1) {
$imageAttributes = PhocaCartImage::getImageChangedByAttributes($attributesOptions, 'large');
} else {
$imageAttributes = PhocaCartImage::getImageChangedBySelectedAttribute($attributesOptions, 'large');
}
if ($imageAttributes != '') {
$imageA['image'] = PhocacartImage::getThumbnailName($pathItem, $imageAttributes, $imageA['size']);
}
$imageA['second'] = false;
$imageA['phil'] = 'phIL-not-active';
if ($switchImage == 1 && $imageAdditional != '') {
$iAI = explode(',', $imageAdditional);
if (isset($iAI[0]) && $iAI[0] != '') {
$imageA['second'] = PhocacartImage::getThumbnailName($pathItem, $iAI[0], $imageA['size']);
if (isset($imageA['second']->rel) && $imageA['second']->rel != '') {
$imageA['phil'] = 'phIL';
}
}
}
$imageA['style'] = '';
if (isset($width) && $width != '' && isset($height) && $height != '') {
$imageA['style'] = 'style="width:' . $width . ';height:' . $height . '"';
}
if (!empty($imageA['image'])) {
$imageA['image']->original = $image;
}
return $imageA;
}