[-] CORE : fixed bug #PSCFV-4754 Image sizes are the same for all shops and themes

This commit is contained in:
vAugagneur
2012-12-18 14:59:34 +01:00
parent c138e2dc5b
commit 17350c6149
19 changed files with 80 additions and 57 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class BestSalesControllerCore extends FrontController
'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
));
+6 -6
View File
@@ -120,10 +120,10 @@ class CategoryControllerCore extends FrontController
'return_category_name' => Tools::safeOutput($this->category->name),
'path' => Tools::getPath($this->category->id),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'categorySize' => Image::getSize('category_default'),
'mediumSize' => Image::getSize('medium_default'),
'thumbSceneSize' => Image::getSize('m_scene_default'),
'homeSize' => Image::getSize('home_default'),
'categorySize' => Image::getSize(ImageType::getFormatedName('category')),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'),
'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'),
'suppliers' => Supplier::getSuppliers()
@@ -144,9 +144,9 @@ class CategoryControllerCore extends FrontController
{
foreach ($sceneImageTypes as $sceneImageType)
{
if ($sceneImageType['name'] == 'm_scene_default')
if ($sceneImageType['name'] == ImageType::getFormatedName('m_scene'))
$thumbSceneImageType = $sceneImageType;
elseif ($sceneImageType['name'] == 'scene_default')
elseif ($sceneImageType['name'] == ImageType::getFormatedName('scene'))
$largeSceneImageType = $sceneImageType;
}
+1 -1
View File
@@ -132,7 +132,7 @@ class CompareControllerCore extends FrontController
'product_features' => $listFeatures,
'products' => $listProducts,
'width' => $width,
'homeSize' => Image::getSize('home_default')
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
));
$this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Hook::exec('displayProductComparison', array('list_ids_product' => $ids)));
}
+2 -2
View File
@@ -115,12 +115,12 @@ class ManufacturerControllerCore extends FrontController
$this->pagination($nbProducts);
foreach ($data as &$item)
$item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$item['id_manufacturer'].'-medium_default.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer'];
$item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$item['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer'];
$this->context->smarty->assign(array(
'pages_nb' => ceil($nbProducts / (int)($this->n)),
'nbManufacturers' => $nbProducts,
'mediumSize' => Image::getSize('medium_default'),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'manufacturers' => $data,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
));
+1 -1
View File
@@ -60,7 +60,7 @@ class NewProductsControllerCore extends FrontController
'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => (int)($nbProducts),
'homeSize' => Image::getSize('home_default'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
));
+1 -1
View File
@@ -53,7 +53,7 @@ class PricesDropControllerCore extends FrontController
'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
));
+9 -5
View File
@@ -345,15 +345,19 @@ class ProductControllerCore extends FrontController
$product_images[(int)$image['id_image']] = $image;
}
if (!isset($cover))
$cover = array('id_image' => $this->context->language->iso_code.'-default', 'legend' => 'No picture', 'title' => 'No picture');
$size = Image::getSize('large_default');
$cover = array(
'id_image' => $this->context->language->iso_code.'-default',
'legend' => 'No picture',
'title' => 'No picture'
);
$size = Image::getSize(ImageType::getFormatedName('large'));
$this->context->smarty->assign(array(
'have_image' => Product::getCover((int)Tools::getValue('id_product')),
'cover' => $cover,
'imgWidth' => (int)$size['width'],
'mediumSize' => Image::getSize('medium_default'),
'largeSize' => Image::getSize('large_default'),
'homeSize' => Image::getSize('home_default'),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'largeSize' => Image::getSize(ImageType::getFormatedName('large')),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'col_img_dir' => _PS_COL_IMG_DIR_));
if (count($product_images))
$this->context->smarty->assign('images', $product_images);
+3 -3
View File
@@ -81,7 +81,7 @@ class SearchControllerCore extends FrontController
'nbProducts' => $search['total'],
'search_query' => $query,
'instant_search' => $this->instant_search,
'homeSize' => Image::getSize('home_default')));
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
}
else if (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query))
{
@@ -97,7 +97,7 @@ class SearchControllerCore extends FrontController
'search_products' => $search['result'],
'nbProducts' => $search['total'],
'search_query' => $query,
'homeSize' => Image::getSize('home_default')));
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
}
else if (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag))
{
@@ -110,7 +110,7 @@ class SearchControllerCore extends FrontController
'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
'search_products' => $result,
'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default')));
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
}
else
{
+1 -1
View File
@@ -262,7 +262,7 @@ class StoresControllerCore extends FrontController
$this->assignStores();
$this->context->smarty->assign(array(
'mediumSize' => Image::getSize('medium_default'),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
'searchUrl' => $this->context->link->getPageLink('stores'),
+2 -2
View File
@@ -118,12 +118,12 @@ class SupplierControllerCore extends FrontController
$suppliers = Supplier::getSuppliers(true, $this->context->language->id, true, $this->p, $this->n);
foreach ($suppliers as &$row)
$row['image'] = (!file_exists(_PS_SUPP_IMG_DIR_.'/'.$row['id_supplier'].'-medium_default.jpg')) ? $this->context->language->iso_code.'-default' : $row['id_supplier'];
$row['image'] = (!file_exists(_PS_SUPP_IMG_DIR_.'/'.$row['id_supplier'].'-'.ImageType::getFormatedName('medium').'.jpg')) ? $this->context->language->iso_code.'-default' : $row['id_supplier'];
$this->context->smarty->assign(array(
'pages_nb' => ceil($nbProducts / (int)$this->n),
'nbSuppliers' => $nbProducts,
'mediumSize' => Image::getSize('medium_default'),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'suppliers_list' => $suppliers,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
));