diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 9e2dcab1d..edeb0e402 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -568,6 +568,7 @@ class InstallModelInstall extends InstallAbstractModel 'statssearch', 'statsstock', 'statsvisits', + 'themeconfigurator', ); } return $modules; diff --git a/modules/homeslider/homeslider.php b/modules/homeslider/homeslider.php index cdde2aa91..b7cff3d6c 100644 --- a/modules/homeslider/homeslider.php +++ b/modules/homeslider/homeslider.php @@ -60,7 +60,7 @@ class HomeSlider extends Module public function install() { /* Adds Module */ - if (parent::install() && $this->registerHook('displayHome') && $this->registerHook('actionShopDataDuplication')) + if (parent::install() && $this->registerHook('displayTop') && $this->registerHook('actionShopDataDuplication')) { /* Sets up configuration */ $res = Configuration::updateValue('HOMESLIDER_WIDTH', '779'); @@ -660,7 +660,7 @@ class HomeSlider extends Module return true; } - public function hookDisplayHome() + public function hookDisplayTop() { if(!$this->_prepareHook()) return; @@ -682,11 +682,6 @@ class HomeSlider extends Module return parent::getCacheId($name); } - public function hookTop() - { - return $this->hookDisplayHome(); - } - public function clearCache() { $this->_clearCache('homeslider.tpl'); diff --git a/modules/themeconfigurator/images/banner-img1.jpg b/modules/themeconfigurator/images/banner-img1.jpg new file mode 100644 index 000000000..129537267 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img1.jpg differ diff --git a/modules/themeconfigurator/images/banner-img2.jpg b/modules/themeconfigurator/images/banner-img2.jpg new file mode 100644 index 000000000..11c6a882c Binary files /dev/null and b/modules/themeconfigurator/images/banner-img2.jpg differ diff --git a/modules/themeconfigurator/images/banner-img3.jpg b/modules/themeconfigurator/images/banner-img3.jpg new file mode 100644 index 000000000..c56df8429 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img3.jpg differ diff --git a/modules/themeconfigurator/images/banner-img4.jpg b/modules/themeconfigurator/images/banner-img4.jpg new file mode 100644 index 000000000..279dd5007 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img4.jpg differ diff --git a/modules/themeconfigurator/images/banner-img5.jpg b/modules/themeconfigurator/images/banner-img5.jpg new file mode 100644 index 000000000..103c1a066 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img5.jpg differ diff --git a/modules/themeconfigurator/images/banner-img6.jpg b/modules/themeconfigurator/images/banner-img6.jpg new file mode 100644 index 000000000..acd63b656 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img6.jpg differ diff --git a/modules/themeconfigurator/images/banner-img7.jpg b/modules/themeconfigurator/images/banner-img7.jpg new file mode 100644 index 000000000..297a18902 Binary files /dev/null and b/modules/themeconfigurator/images/banner-img7.jpg differ diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index 495168377..c559074ef 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -70,7 +70,8 @@ class ThemeConfigurator extends Module ); if (!parent::install() || - !$this->installDB() || + !$this->installDB() || + !$this->installFixtures() || !$this->registerHook('displayHeader') || !$this->registerHook('displayTop') || !$this->registerHook('displayLeftColumn') || @@ -78,7 +79,6 @@ class ThemeConfigurator extends Module !$this->registerHook('displayHome') || !$this->registerHook('displayFooter') || !$this->registerHook('displayBackOfficeHeader') || - !Configuration::updateValue('PS_TC_THEMES', serialize($themes_colors)) || !Configuration::updateValue('PS_TC_FONTS', serialize($themes_fonts))) return false; @@ -113,6 +113,58 @@ class ThemeConfigurator extends Module return true; } + public function installFixtures() + { + $result = true; + + for ($i = 1; $i < 6; $i++) + { + $result &= Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'themeconfigurator` ( + `id_shop`, `id_lang`, `item_order`, `title`, `title_use`, `hook`, `url`, `target`, `image`, `image_w`, `image_h`, `html`, `active` + ) VALUES ( + \''.(int)$this->context->shop->id.'\', + \''.(int)$this->context->language->id.'\', + \''.(int)$i.'\', + \'\', + \'0\', + \'home\', + \'\', + \'\', + \'banner-img'.$i.'.jpg\', + \'\', + \'\', + \'\', + 1) + '); + } + + for ($i = 6; $i < 8; $i++) + { + $result &= Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'themeconfigurator` ( + `id_shop`, `id_lang`, `item_order`, `title`, `title_use`, `hook`, `url`, `target`, `image`, `image_w`, `image_h`, `html`, `active` + ) VALUES ( + \''.(int)$this->context->shop->id.'\', + \''.(int)$this->context->language->id.'\', + \''.(int)$i.'\', + \'\', + \'0\', + \'top\', + \'\', + \'\', + \'banner-img'.$i.'.jpg\', + \'\', + \'\', + \'\', + 1) + '); + } + + + return $result; + } + public function uninstall() { $images = Db::getInstance()->executeS('SELECT image FROM `'._DB_PREFIX_.'themeconfigurator`'); @@ -166,7 +218,7 @@ class ThemeConfigurator extends Module 'htmlitems'=> $this->getItemsFromHook('top'), 'hook' => 'top' )); - return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + return $this->display(__FILE__, 'hook.tpl'); } public function hookDisplayHome() @@ -175,7 +227,7 @@ class ThemeConfigurator extends Module 'htmlitems'=> $this->getItemsFromHook('home'), 'hook' => 'home' )); - return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + return $this->display(__FILE__, 'hook.tpl'); } public function hookDisplayLeftColumn() @@ -184,7 +236,7 @@ class ThemeConfigurator extends Module 'htmlitems'=> $this->getItemsFromHook('left'), 'hook' => 'left' )); - return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + return $this->display(__FILE__, 'hook.tpl'); } public function hookDisplayRightColumn() @@ -193,7 +245,7 @@ class ThemeConfigurator extends Module 'htmlitems'=> $this->getItemsFromHook('right'), 'hook' => 'right' )); - return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + return $this->display(__FILE__, 'hook.tpl'); } public function hookDisplayFooter() @@ -202,7 +254,7 @@ class ThemeConfigurator extends Module 'htmlitems'=> $this->getItemsFromHook('footer'), 'hook' => 'footer' )); - return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + return $this->display(__FILE__, 'hook.tpl'); } protected function getItemsFromHook($hook) diff --git a/modules/themeconfigurator/views/templates/hook/hook.tpl b/modules/themeconfigurator/views/templates/hook/hook.tpl new file mode 100644 index 000000000..bb8eb1c42 --- /dev/null +++ b/modules/themeconfigurator/views/templates/hook/hook.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems) && $htmlitems} +