From ba5753c184fef26576cdc647af1cf5416cecb542 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Thu, 29 Sep 2011 13:16:03 +0000 Subject: [PATCH] //ManufacturerController : Normalization --- controllers/front/ManufacturerController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/front/ManufacturerController.php b/controllers/front/ManufacturerController.php index 7264b780b..67dc151a2 100644 --- a/controllers/front/ManufacturerController.php +++ b/controllers/front/ManufacturerController.php @@ -53,7 +53,7 @@ class ManufacturerControllerCore extends FrontController if ($id_manufacturer = Tools::getValue('id_manufacturer')) { $this->manufacturer = new Manufacturer((int)$id_manufacturer, $this->context->language->id); - if (!Validate::isLoadedObject($this->manufacturer) OR !$this->manufacturer->active || !$this->manufacturer->isAssociatedToGroupShop()) + if (!Validate::isLoadedObject($this->manufacturer) || !$this->manufacturer->active || !$this->manufacturer->isAssociatedToGroupShop()) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); @@ -64,9 +64,13 @@ class ManufacturerControllerCore extends FrontController } } + /** + * Assign template vars related to page content + * @see FrontController::process() + */ public function process() { - if (Validate::isLoadedObject($this->manufacturer) AND $this->manufacturer->active AND $this->manufacturer->isAssociatedToGroupShop()) + if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToGroupShop()) { $this->productSort(); $this->assignOne(); @@ -84,7 +88,7 @@ class ManufacturerControllerCore extends FrontController */ protected function assignOne() { - $nbProducts = $this->manufacturer->getProducts($this->manufacturer->id, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); + $nbProducts = $this->manufacturer->getProducts($this->manufacturer->id, null, null, null, $this->orderBy, $this->orderWay, true); $this->pagination((int)$nbProducts); $this->context->smarty->assign(array( 'nb_products' => $nbProducts, @@ -107,7 +111,7 @@ class ManufacturerControllerCore extends FrontController $manufacturers = Manufacturer::getManufacturers(true, $this->context->language->id, true, $this->p, $this->n, false, $id_current_group_shop); $imgDir = _PS_MANU_IMG_DIR_; - foreach ($data AS &$item) + foreach ($data as &$item) $item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$item['id_manufacturer'].'-medium.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer']; $this->context->smarty->assign(array(