* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) exit; class BlockManufacturer extends Module { public function __construct() { $this->name = 'blockmanufacturer'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Manufacturers block'); $this->description = $this->l('Displays a block listing product manufacturers and/or brands.'); } public function install() { Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true); Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5); Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true); return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header') && $this->registerHook('actionObjectManufacturerDeleteAfter') && $this->registerHook('actionObjectManufacturerAddAfter') && $this->registerHook('actionObjectManufacturerUpdateAfter'); } public function hookLeftColumn($params) { if (!$this->isCached('blockmanufacturer.tpl', $this->getCacheId())) $this->smarty->assign(array( 'manufacturers' => Manufacturer::getManufacturers(), 'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'), 'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'), 'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'), 'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'), )); return $this->display(__FILE__, 'blockmanufacturer.tpl', $this->getCacheId()); } public function hookRightColumn($params) { return $this->hookLeftColumn($params); } public function getContent() { $output = '