/** * Home * @param $params * @return mixed */ public function hookHome($params) { if (Configuration::get('NOW_SLIDESHOW_ENABLE')) { $aSlides = NowSlideshow::getSlides(); foreach ($aSlides as $position => $oSlide) { if ($oSlide->type == NowSlideshow::TYPE_CMS) { $aSlides[$position]->object = new CMS($oSlide->id_type, Context::getContext()->language->id); } elseif ($oSlide->type == NowSlideshow::TYPE_CATEGORY) { $aSlides[$position]->object = new Category($oSlide->id_type, Context::getContext()->language->id); } elseif ($oSlide->type == NowSlideshow::TYPE_MANUFACTURER) { $aSlides[$position]->object = new Manufacturer($oSlide->id_type, Context::getContext()->language->id); } } $this->context->smarty->assign(array('aSlides' => $aSlides)); return $this->context->smarty->fetch($this->module_dir . 'views/templates/hook/home.tpl'); } }
/** * @see ObjectModel::delete() */ public function delete() { if (!parent::delete()) { return false; } NowSlideshow::cleanPositions(); }
/** * @return bool */ protected function processBulkDelete() { if (is_array($this->boxes) && !empty($this->boxes)) { foreach ($this->boxes as $iIdNowSlideshow) { $oNowSlideshow = new NowSlideshow((int) $iIdNowSlideshow); if (!$oNowSlideshow->deleteImage()) { $this->errors[] = Tools::displayError('An error occurred while deleting image of the object (NowSlideshow).') . ' <b>' . $this->table . '</b> '; return false; } } } return parent::processBulkDelete(); }