Esempio n. 1
0
 public function install()
 {
     if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('rightColumn') || !$this->registerHook('header') || !$this->registerHook('footer') || !$this->registerHook('CMSPOS') || !$this->registerHook('displayNav') || !$this->registerHook('actionObjectCmsUpdateAfter') || !$this->registerHook('actionObjectCmsDeleteAfter') || !$this->registerHook('actionShopDataDuplication') || !$this->registerHook('actionAdminStoresControllerUpdate_optionsAfter') || !OvicBlockCMSModel::createTables() || !Configuration::updateValue('FOOTER_CMS', '') || !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 0) || !Configuration::updateValue('FOOTER_POWEREDBY', 0) || !Configuration::updateValue('FOOTER_PRICE-DROP', 1) || !Configuration::updateValue('FOOTER_NEW-PRODUCTS', 1) || !Configuration::updateValue('FOOTER_BEST-SALES', 1) || !Configuration::updateValue('FOOTER_CONTACT', 1) || !Configuration::updateValue('FOOTER_SITEMAP', 1)) {
         return false;
     }
     $this->_clearCache('ovicblockcms.tpl');
     $this->_clearCache('cmspos.tpl');
     // Install fixtures for ovicblockcms
     $default = Db::getInstance()->insert('cms_block', array('id_cms_category' => 1, 'location' => 0, 'position' => 0));
     if (!$default) {
         return false;
     }
     $result = true;
     $id_cms_block = Db::getInstance()->Insert_ID();
     $shops = Shop::getShops(true, null, true);
     foreach ($shops as $shop) {
         $result &= Db::getInstance()->insert('cms_block_shop', array('id_cms_block' => $id_cms_block, 'id_shop' => $shop));
     }
     $languages = Language::getLanguages(false);
     foreach ($languages as $lang) {
         $result &= Db::getInstance()->insert('cms_block_lang', array('id_cms_block' => $id_cms_block, 'id_lang' => $lang['id_lang'], 'name' => $this->l('Information')));
     }
     $pages = CMS::getCMSPages(null, 1);
     foreach ($pages as $cms) {
         $result &= Db::getInstance()->insert('cms_block_page', array('id_cms_block' => $id_cms_block, 'id_cms' => $cms['id_cms'], 'is_category' => 0));
     }
     return $result;
 }