name = 'blockinfos'; $this->tab = 'Blocks'; $this->version = 1.1; parent::__construct(); $this->displayName = $this->l('Info block'); $this->description = $this->l('Adds a block with several information links'); } public function install() { if (!parent::install() OR !$this->registerHook('leftColumn')) return false; Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'block_cms`(`id_block`, `id_cms`) VALUES ('.intval($this->id).', 1), ('.intval($this->id).', 2), ('.intval($this->id).', 3), ('.intval($this->id).', 4)'); return true; } public function uninstall() { Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'block_cms` WHERE `id_block` ='.intval($this->id)); parent::uninstall(); } public function getContent() { if(isset($_POST['btnSubmit'])) $this->_postProcess(); $this-> _displayForm(); return $this->_html; } private function _displayForm() { global $cookie; $this->_html .= '
'; } private function _postProcess() { if (Tools::isSubmit('btnSubmit')) { $categoryBox = Tools::getValue('categoryBox'); if ($categoryBox AND is_array($categoryBox) AND count($categoryBox)) { foreach ($categoryBox AS $row) $cms[] = intval($row); if (CMS::updateCmsToBlock($cms, intval($this->id))) $this->_html .= '