From 2b02823a2c305f100167e60ba1d31056868cf79f Mon Sep 17 00:00:00 2001 From: Nolwenn Date: Wed, 22 Jun 2016 16:12:58 +0200 Subject: [PATCH] home mag --- .gitignore | 1 + modules/advconstructor/.gitignore | 1 + modules/advconstructor/README.md | 1 + modules/advconstructor/advconstructor.php | 334 ++++++++++++++ .../classes/AdvConstructorBlock.php | 245 ++++++++++ .../classes/AdvConstructorHook.php | 94 ++++ modules/advconstructor/classes/index.php | 35 ++ modules/advconstructor/config_fr.xml | 12 + .../controllers/admin/AdminAdvConstructor.php | 420 ++++++++++++++++++ .../admin/AdminAdvConstructorPosition.php | 159 +++++++ .../controllers/admin/index.php | 35 ++ modules/advconstructor/controllers/index.php | 35 ++ modules/advconstructor/img/index.php | 35 ++ modules/advconstructor/index.php | 35 ++ modules/advconstructor/logo.gif | Bin 0 -> 2097 bytes modules/advconstructor/logo.png | Bin 0 -> 6271 bytes modules/advconstructor/translations/index.php | 35 ++ modules/advconstructor/views/index.php | 35 ++ .../admin/_configure/helpers/form/form.tpl | 48 ++ .../admin/_configure/helpers/form/index.php | 35 ++ .../admin/_configure/helpers/index.php | 35 ++ .../templates/admin/_configure/index.php | 35 ++ .../adv_constructor/helpers/form/form.tpl | 109 +++++ .../adv_constructor/helpers/form/index.php | 35 ++ .../admin/adv_constructor/helpers/index.php | 35 ++ .../templates/admin/adv_constructor/index.php | 35 ++ .../views/templates/admin/helpers/index.php | 35 ++ .../admin/helpers/uploader/index.php | 35 ++ .../admin/helpers/uploader/simple.tpl | 54 +++ .../views/templates/admin/index.php | 35 ++ .../views/templates/hook/alert.tpl | 0 .../views/templates/hook/edito.tpl | 3 + .../views/templates/hook/footer.tpl | 0 .../views/templates/hook/nav.tpl | 0 .../views/templates/hook/seo.tpl | 5 + .../advconstructor/views/templates/index.php | 35 ++ themes/toutpratique/css/global.css | 58 ++- themes/toutpratique/img/light.png | Bin 0 -> 7502 bytes themes/toutpratique/index.tpl | 16 +- .../modules/advconstructor/category.tpl | 9 + .../modules/advconstructor/edito.tpl | 13 + .../modules/advconstructor/home.tpl | 13 + .../advconstructor/translations/fr.php | 0 43 files changed, 2187 insertions(+), 3 deletions(-) create mode 100644 modules/advconstructor/.gitignore create mode 100644 modules/advconstructor/README.md create mode 100644 modules/advconstructor/advconstructor.php create mode 100644 modules/advconstructor/classes/AdvConstructorBlock.php create mode 100644 modules/advconstructor/classes/AdvConstructorHook.php create mode 100644 modules/advconstructor/classes/index.php create mode 100644 modules/advconstructor/config_fr.xml create mode 100644 modules/advconstructor/controllers/admin/AdminAdvConstructor.php create mode 100644 modules/advconstructor/controllers/admin/AdminAdvConstructorPosition.php create mode 100644 modules/advconstructor/controllers/admin/index.php create mode 100644 modules/advconstructor/controllers/index.php create mode 100644 modules/advconstructor/img/index.php create mode 100644 modules/advconstructor/index.php create mode 100644 modules/advconstructor/logo.gif create mode 100644 modules/advconstructor/logo.png create mode 100644 modules/advconstructor/translations/index.php create mode 100644 modules/advconstructor/views/index.php create mode 100644 modules/advconstructor/views/templates/admin/_configure/helpers/form/form.tpl create mode 100644 modules/advconstructor/views/templates/admin/_configure/helpers/form/index.php create mode 100644 modules/advconstructor/views/templates/admin/_configure/helpers/index.php create mode 100644 modules/advconstructor/views/templates/admin/_configure/index.php create mode 100644 modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/form.tpl create mode 100644 modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/index.php create mode 100644 modules/advconstructor/views/templates/admin/adv_constructor/helpers/index.php create mode 100644 modules/advconstructor/views/templates/admin/adv_constructor/index.php create mode 100644 modules/advconstructor/views/templates/admin/helpers/index.php create mode 100644 modules/advconstructor/views/templates/admin/helpers/uploader/index.php create mode 100644 modules/advconstructor/views/templates/admin/helpers/uploader/simple.tpl create mode 100644 modules/advconstructor/views/templates/admin/index.php create mode 100644 modules/advconstructor/views/templates/hook/alert.tpl create mode 100644 modules/advconstructor/views/templates/hook/edito.tpl create mode 100644 modules/advconstructor/views/templates/hook/footer.tpl create mode 100644 modules/advconstructor/views/templates/hook/nav.tpl create mode 100644 modules/advconstructor/views/templates/hook/seo.tpl create mode 100644 modules/advconstructor/views/templates/index.php create mode 100644 themes/toutpratique/img/light.png create mode 100644 themes/toutpratique/modules/advconstructor/category.tpl create mode 100644 themes/toutpratique/modules/advconstructor/edito.tpl create mode 100644 themes/toutpratique/modules/advconstructor/home.tpl create mode 100644 themes/toutpratique/modules/advconstructor/translations/fr.php diff --git a/.gitignore b/.gitignore index f684b5fe..6198e714 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ adm/export/* adm/import/* themes/toutpratique/cache/* modules/blocknewsletter/*.csv +modules/*/config_.xml diff --git a/modules/advconstructor/.gitignore b/modules/advconstructor/.gitignore new file mode 100644 index 00000000..62c89355 --- /dev/null +++ b/modules/advconstructor/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/modules/advconstructor/README.md b/modules/advconstructor/README.md new file mode 100644 index 00000000..faefdb34 --- /dev/null +++ b/modules/advconstructor/README.md @@ -0,0 +1 @@ +#TODO: \ No newline at end of file diff --git a/modules/advconstructor/advconstructor.php b/modules/advconstructor/advconstructor.php new file mode 100644 index 00000000..54bce25c --- /dev/null +++ b/modules/advconstructor/advconstructor.php @@ -0,0 +1,334 @@ +name = 'advconstructor'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + $this->author = 'Antadis'; + $this->need_instance = 0; + + $this->bootstrap = true; + parent::__construct(); + + $this->displayName = $this->l('Générateur de bloc'); + $this->description = $this->l('Générer n\'importe quel type de bloc'); + } + + /***********************/ + /******* Install *******/ + /***********************/ + + public function install() + { + $this->installDb(); + $this->createTab(); + $this->createFolder(); + if ( !parent::install() ) { + $this->uninstallDb(); + $this->deleteTab(); + $this->uninstall(); + return false; + } + Configuration::updateValue('ADVCONSTRUCTOR_HOOKS', ''); + Configuration::updateValue('ADVCONSTRUCTOR_TYPE', 'alert,edito,footer,nav,seo'); + Configuration::updateValue('ADVCONSTRUCTOR_ICON', 'loupe,message,rouage'); + return true; + } + + public function uninstall() + { + if ( !parent::uninstall() ) { + return false; + } + Configuration::deleteByName('ADVCONSTRUCTOR_HOOKS'); + Configuration::deleteByName('ADVCONSTRUCTOR_TYPE'); + Configuration::deleteByName('ADVCONSTRUCTOR_ICON'); + $this->uninstallDb(); + $this->deleteTab(); + return true; + } + + public function installDb() + { + $sql = array(); + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor` ( + `id_advconstructor` int(10) unsigned NOT NULL auto_increment, + `skin` varchar(255) NOT NULL, + `active` int(11), + `icon` varchar(255) NOT NULL, + `external` int(10) unsigned NOT NULL, + `date_from` datetime NOT NULL, + `date_to` datetime NOT NULL, + `date_add` datetime NOT NULL DEFAULT "0000-00-00 00:00:00", + `date_upd` datetime NOT NULL DEFAULT "0000-00-00 00:00:00", + PRIMARY KEY (`id_advconstructor`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor_lang` ( + `id_advconstructor` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `subtitle` varchar(255) NOT NULL, + `link` varchar(255), + `content` text, + PRIMARY KEY (`id_advconstructor`,`id_lang`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor_shop` ( + `id_advconstructor` int(10) unsigned NOT NULL, + `id_shop` int(10) unsigned NOT NULL, + `type` varchar(255) NOT NULL, + PRIMARY KEY (`id_advconstructor`,`id_shop`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor_category` ( + `id_advconstructor` int(10) unsigned NOT NULL, + `id_category` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_advconstructor`,`id_category`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor_product` ( + `id_advconstructor` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_advconstructor`,`id_product`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + $sql[] = + 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advconstructor_hook` ( + `id_advconstructor_hook` int(10) unsigned NOT NULL auto_increment, + `id_advconstructor` int(10) unsigned NOT NULL, + `id_hook` int(10) unsigned NOT NULL, + `id_category` int(10) unsigned, + `position` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_advconstructor_hook`) + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; + + return $this->uninstallDb() && $this->updateDb($sql); + } + + public function uninstallDb() + { + $sql = array(); + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor` ;'; + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor_lang` ;'; + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor_shop` ;'; + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor_category` ;'; + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor_product` ;'; + $sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'advconstructor_hook` ;'; + + return $this->updateDb($sql); + } + + public function updateDb( $sqls ) + { + foreach ( $sqls as $sql ) { + if ( !Db::getInstance()->execute($sql) ) { + return false; + } + } + return true; + } + + public function createFolder() + { + $img_dir = _PS_IMG_DIR_ . 'constructor'; + $folder = is_dir($img_dir); + if (!$folder) + { + $folder = mkdir($img_dir, 0755, true); + } + + return $folder; + } + + public function createTab() + { + $languages = Language::getLanguages(); + + $new_tab = new Tab(); + $new_tab->class_name = 'AdminAdvConstructor'; + $new_tab->id_parent = Tab::getCurrentParentId(); + $new_tab->module = $this->name; + foreach ( $languages as $language ) { + $new_tab->name[$language['id_lang']] = 'Générateur de bloc'; + } + + $new_tab->add(); + $id_tab_parent = $new_tab->id; + + $new_tab = new Tab(); + $new_tab->class_name = 'AdminAdvConstructorPosition'; + $new_tab->id_parent = $id_tab_parent; + $new_tab->module = $this->name; + foreach ( $languages as $language ) { + $new_tab->name[$language['id_lang']] = 'Positions des blocs'; + } + $new_tab->add(); + } + + public function deleteTab() + { + $idTab = Tab::getIdFromClassName('AdminAdvConstructor'); + if ( $idTab ) { + $tab = new Tab($idTab); + $tab->delete(); + } + $idTab = Tab::getIdFromClassName('AdminAdvConstructorPosition'); + if ( $idTab ) { + $tab = new Tab($idTab); + $tab->delete(); + } + } + + /************************/ + /********* HOOK *********/ + /************************/ + + public function __call( $name, $args = array() ) + { + $hookName = str_replace('hook', '', $name); + $id_hook = (int)Hook::getIdByName($hookName); + $hooks_id = explode( ",", Configuration::get('ADVCONSTRUCTOR_HOOKS') ); + if (in_array($id_hook, $hooks_id)) { + $html = ''; + $id_category = false; + if (Tools::getValue('controller') == 'category') { + $id_category = (int) Tools::getValue('id_category'); + } + if ( $blocks = AdvConstructorBlock::getBlocksByHookID($id_hook, $id_category) ) { + foreach ($blocks as $block) { + $this->smarty->assign( + array( + 'block' => $block, + 'linkimg' =>'modules/advconstructor/img/', + ) + ); + $html .= $this->display(__FILE__, $block->skin.'.tpl'); + } + } + return $html; + } + return NULL; + } + + /*********************************/ + /********* CONFIGURATION *********/ + /*********************************/ + + public function getContent() + { + $this->_postProcess(); + $this->_html = ''; + $this->_html .= $this->renderForm(); + return $this->_html; + } + + protected function _postProcess() + { + + if ( Tools::isSubmit('submitConfiguration') ) + { + $this->unHook(); + $hooks = Tools::getValue('hookBox'); + foreach ($hooks as $hook) { + $this->registerHook(Hook::getNameById($hook)); + } + $res = Configuration::updateValue('ADVCONSTRUCTOR_TYPE', Tools::getValue('ADVCONSTRUCTOR_TYPE')); + $res &= Configuration::updateValue('ADVCONSTRUCTOR_ICON', Tools::getValue('ADVCONSTRUCTOR_ICON')); + $res &= Configuration::updateValue('ADVCONSTRUCTOR_HOOKS', implode($hooks,',')); + if (!$res) { + $errors[] = $this->displayError($this->l('The configuration could not be updated.')); + } else { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true).'&conf=6&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name); + } + } + } + + public function renderForm() + { + $hooks = array(); + $hooks_configuration = explode( ",", Configuration::get('ADVCONSTRUCTOR_HOOKS') ); + foreach ( Hook::getHooks() as $hook ) { + $hook['selected'] = (bool) in_array($hook['id_hook'], $hooks_configuration); + $hooks[] = $hook; + } + + $fields_form = array( + 'form' => array( + 'legend' => array( + 'title' => $this->l('Configuration'), + 'icon' => 'icon-plus-sign-alt' + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Types de blocs'), + 'name' => 'ADVCONSTRUCTOR_TYPE', + 'value' => Configuration::get('ADVCONSTRUCTOR_TYPE') + ), + array( + 'type' => 'text', + 'label' => $this->l('Icones de blocs'), + 'name' => 'ADVCONSTRUCTOR_ICON', + 'value' => Configuration::get('ADVCONSTRUCTOR_ICON') + ), + array( + 'type' => 'hook', + 'label' => $this->l('Hooks à afficher'), + 'name' => 'hookBox', + 'values' => $hooks, + 'col' => '9' + ) + ), + 'submit' => array( + 'title' => $this->l('Sauvegarder'), + ) + ), + ); + + $helper = new HelperForm(); + $helper->show_toolbar = false; + $helper->table = $this->table; + $this->fields_form = array(); + $helper->module = $this; + $helper->identifier = $this->identifier; + $helper->submit_action = 'submitConfiguration'; + $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; + $helper->token = Tools::getAdminTokenLite('AdminModules'); + $helper->tpl_vars = array( + 'fields_value' => $this->getConfigFieldsValues() + ); + $helper->override_folder = '/'; + return $helper->generateForm(array($fields_form)); + } + + public function getConfigFieldsValues() + { + $id_shop_group = Shop::getContextShopGroupID(); + $id_shop = Shop::getContextShopID(); + + return array( + 'ADVCONSTRUCTOR_TYPE' => Configuration::get('ADVCONSTRUCTOR_TYPE'), + 'ADVCONSTRUCTOR_ICON' => Configuration::get('ADVCONSTRUCTOR_ICON') + ); + } + + protected function unHook() + { + $sql = 'SELECT `id_hook` FROM `'._DB_PREFIX_.'hook_module` WHERE `id_module` = '.(int)$this->id; + $result = Db::getInstance()->executeS($sql); + foreach ($result as $row) { + $this->unregisterHook((int)$row['id_hook']); + $this->unregisterExceptions((int)$row['id_hook']); + } + } +} \ No newline at end of file diff --git a/modules/advconstructor/classes/AdvConstructorBlock.php b/modules/advconstructor/classes/AdvConstructorBlock.php new file mode 100644 index 00000000..08566fd6 --- /dev/null +++ b/modules/advconstructor/classes/AdvConstructorBlock.php @@ -0,0 +1,245 @@ + 'advconstructor', + 'primary' => 'id_advconstructor', + 'multilang' => true, + 'fields' => array( + 'title' => array( + 'type' => ObjectModel :: TYPE_STRING, + 'lang' => true, + 'validate' => 'isString', + 'required' => TRUE + ), + 'subtitle' => array( + 'type' => ObjectModel :: TYPE_STRING, + 'lang' => true, + 'validate' => 'isString' + ), + 'icon' => array( + 'type' => ObjectModel :: TYPE_STRING, + 'validate' => 'isString' + ), + 'content' => array( + 'type' => ObjectModel :: TYPE_HTML, + 'lang' => true, + 'validate' => 'isString' + ), + 'link' => array( + 'type' => ObjectModel :: TYPE_STRING, + 'lang' => true, + 'validate' => 'isString' + ), + 'external' => array( + 'type' => ObjectModel :: TYPE_INT, + 'validate' => 'isBool' + ), + 'skin' => array( + 'type' => ObjectModel :: TYPE_STRING, + 'validate' => 'isString' + ), + 'active' => array( + 'type' => ObjectModel :: TYPE_INT, + 'validate' => 'isBool' + ), + 'date_from' => array( + 'type' => ObjectModel :: TYPE_DATE + ), + 'date_to' => array( + 'type' => ObjectModel :: TYPE_DATE + ), + 'date_add' => array( + 'type' => ObjectModel :: TYPE_DATE + ), + 'date_upd' => array( + 'type' => ObjectModel :: TYPE_DATE + ) + ) + ); + + public function getHooks() + { + if (!isset($this->hooks)) { + $this->hooks = array(); + foreach (Db::getInstance()->executeS(' + SELECT `id_hook` + FROM `' . _DB_PREFIX_ . 'advconstructor_hook` + WHERE `id_advconstructor` = ' . $this->id . ' + ') as $hook) { + $this->hooks[] = $hook['id_hook']; + } + } + + return $this->hooks; + } + + public function getCategory() + { + if (!isset($this->categories)) { + $this->categories = array(); + foreach (Db::getInstance()->executeS(' + SELECT `id_category` + FROM `' . _DB_PREFIX_ . 'advconstructor_category` + WHERE `id_advconstructor` = ' . $this->id . ' + ') as $category) { + $this->categories[] = $category['id_category']; + } + } + + return $this->categories; + } + + public function addHooksAssociation( $hooks ) + { + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'advconstructor_hook` + WHERE `id_advconstructor` = '.(int) $this->id.' + AND id_hook NOT IN ('.implode(',',$hooks).') + '); + + foreach ( $hooks as $hook ) { + if ( !AdvConstructorHook::associationHookExist( $this->id, $hook ) ) { + $advconstructor_hook = new AdvConstructorHook(); + $advconstructor_hook->id_advconstructor = (int) $this->id; + $advconstructor_hook->id_hook = (int) $hook; + $advconstructor_hook->add(); + $advconstructor_hook->refreshPositions(); + } + } + } + + public function addCategoryAssociation( $categories ) + { + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'advconstructor_category` + WHERE `id_advconstructor` = '.(int) $this->id.' + '); + + foreach ( $categories as $category ) { + if ( !$this->associationCategoryExist( $category ) ) { + Db::getInstance()->execute(' + INSERT INTO `'._DB_PREFIX_.'advconstructor_category` + (`id_advconstructor`,`id_category`) + VALUES ('.(int) $this->id.','.$category.') + '); + } + } + } + + public static function getBlocksByHookID( $id_hook, $id_category ) + { + $now = date('Y-m-d H:i:s'); + + $sql = 'SELECT id_advconstructor, position FROM `' . _DB_PREFIX_ . 'advconstructor_hook` WHERE id_hook ='.(int)$id_hook; + + if ( $blocks_id = Db::getInstance()->executeS($sql) ) { + $blocks = array(); + foreach ($blocks_id as $block_id) { + $blocks[] = $block_id['id_advconstructor']; + } + $collection = new Collection('AdvConstructorBlock', Context::getContext()->language->id); + $collection->Sqlwhere('a0.date_from <= IF(a0.date_from = "0000-00-00 00:00:00","0000-00-00 00:00:00","' . $now . '")' ); + $collection->Sqlwhere('a0.date_to >= IF(a0.date_to = "0000-00-00 00:00:00","0000-00-00 00:00:00","' . $now . '")' ); + $collection->Sqlwhere('a0.id_advconstructor IN ('.implode(',',$blocks).')' ); + if (Shop::isFeatureActive()) { + $collection->Sqlwhere('a0.`id_advconstructor` IN ( + SELECT sa.`id_advconstructor` + FROM `' . _DB_PREFIX_ . 'advconstructor_shop` sa + WHERE sa.id_shop IN (' . implode(', ', Shop::getContextListShopID()) . ') + )'); + } + $res = $collection->getAll(); + $temp = array(); + foreach ( $res as $row ) { + foreach ($blocks_id as $block_id) { + if ( $block_id['id_advconstructor'] == $row->id ) { + $show = false; + if ( !self::existInOneCategory( $row->id ) ) { + $show = true; + } else { + if ( $id_category && self::testCategoryAssociation( $row->id, $id_category ) ) { + $show = true; + } + } + if ( $show ){ + $temp[$block_id['position']] = $row; + } + } + } + } + ksort($temp); + return $temp; + } else { + return false; + } + } + + public static function getBlocksByHookIDLite( $id_hook ) + { + $sql = 'SELECT id_advconstructor FROM `' . _DB_PREFIX_ . 'advconstructor_hook` WHERE id_hook ='.(int)$id_hook.' ORDER BY position ASC'; + if ( $blocks_id = Db::getInstance()->executeS($sql) ) { + $blocks = array(); + foreach ($blocks_id as $block_id) { + $blocks[] = $block_id['id_advconstructor']; + } + return $blocks; + } else { + return false; + } + } + + public function associationCategoryExist( $id_category ) + { + $sql = 'SELECT `id_advconstructor` + FROM `'._DB_PREFIX_.'advconstructor_category` + WHERE `id_category` = '.(int) $id_category.' + AND `id_advconstructor` = '.(int) $this->id; + if (!$id = Db::getInstance()->getRow($sql)) { + return false; + } else { + return true; + } + } + + public static function existInOneCategory( $id_advconstructor ){ + $sql = 'SELECT `id_advconstructor` + FROM `'._DB_PREFIX_.'advconstructor_category` + WHERE `id_advconstructor` = '.(int) $id_advconstructor; + if (!$id = Db::getInstance()->getRow($sql)) { + return false; + } else { + return true; + } + } + + public static function testCategoryAssociation( $id_advconstructor, $id_category ){ + $sql = 'SELECT `id_advconstructor` + FROM `'._DB_PREFIX_.'advconstructor_category` + WHERE `id_category` = '.$id_category.' AND + `id_advconstructor` = '.(int) $id_advconstructor; + if (!$id = Db::getInstance()->getRow($sql)) { + return false; + } else { + return true; + } + } +} \ No newline at end of file diff --git a/modules/advconstructor/classes/AdvConstructorHook.php b/modules/advconstructor/classes/AdvConstructorHook.php new file mode 100644 index 00000000..a38a174b --- /dev/null +++ b/modules/advconstructor/classes/AdvConstructorHook.php @@ -0,0 +1,94 @@ + 'advconstructor_hook', + 'primary' => 'id_advconstructor_hook', + 'fields' => array( + 'id_advconstructor' => array( + 'type' => ObjectModel :: TYPE_INT + ), + 'id_hook' => array( + 'type' => ObjectModel :: TYPE_INT + ), + 'position' => array( + 'type' => ObjectModel :: TYPE_INT + ) + ) + ); + + public function updatePosition($way, $position) + { + $sql = 'SELECT `position`, `id_advconstructor_hook` + FROM `'._DB_PREFIX_.'advconstructor_hook` + WHERE `id_hook` = '.(int)$this->id_hook.' + ORDER BY `position` ASC'; + $res = Db::getInstance()->executeS($sql); + if (!$res) + return false; + + foreach ($res as $row) + if ((int)$row['id_advconstructor_hook'] == (int)$this->id) + $moved_row = $row; + + if (!isset($moved_row) || !isset($position)) + return false; + + // < and > statements rather than BETWEEN operator + // since BETWEEN is treated differently according to databases + $res = Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'advconstructor_hook` + SET `position`= `position` '.($way ? '- 1' : '+ 1').' + WHERE `id_hook` = '.(int)$this->id_hook.' + AND `position` + '.($way + ? '> '.(int)$moved_row['position'].' AND `position` <= '.(int)$position + : '< '.(int)$moved_row['position'].' AND `position` >= '.(int)$position) + ) + && Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'advconstructor_hook` + SET `position` = '.(int)$position.' + WHERE `id_advconstructor_hook`='.(int)$moved_row['id_advconstructor_hook'] + ); + $this->refreshPositions(); + + return $res; + } + + public function refreshPositions(){ + $sql = 'SELECT `id_advconstructor_hook` + FROM `'._DB_PREFIX_.'advconstructor_hook` + WHERE `id_hook` = '.(int)$this->id_hook.' + ORDER BY `position` ASC'; + if (!$blocks = Db::getInstance()->executeS($sql)) + return false; + + $pos=0; + foreach ($blocks as $block) { + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'advconstructor_hook` + SET `position` = '.(int)$pos.' + WHERE `id_advconstructor_hook`='.(int)$block['id_advconstructor_hook']); + $pos++; + } + } + + public static function associationHookExist( $id_advconstructor, $id_hook ) + { + $sql = 'SELECT `id_advconstructor_hook` + FROM `'._DB_PREFIX_.'advconstructor_hook` + WHERE `id_hook` = '.(int) $id_hook.' + AND `id_advconstructor` = '.(int) $id_advconstructor; + if (!$id = Db::getInstance()->getRow($sql)) { + return false; + } else { + return $id['id_advconstructor_hook']; + } + } +} \ No newline at end of file diff --git a/modules/advconstructor/classes/index.php b/modules/advconstructor/classes/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/classes/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/config_fr.xml b/modules/advconstructor/config_fr.xml new file mode 100644 index 00000000..be544cfc --- /dev/null +++ b/modules/advconstructor/config_fr.xml @@ -0,0 +1,12 @@ + + + advconstructor + + + + + + 1 + 0 + + \ No newline at end of file diff --git a/modules/advconstructor/controllers/admin/AdminAdvConstructor.php b/modules/advconstructor/controllers/admin/AdminAdvConstructor.php new file mode 100644 index 00000000..6d9205b0 --- /dev/null +++ b/modules/advconstructor/controllers/admin/AdminAdvConstructor.php @@ -0,0 +1,420 @@ +table = 'advconstructor'; + $this->className = 'AdvConstructorBlock'; + $this->identifier = 'id_advconstructor'; + $this->lang = true; + $this->deleted = false; + $this->bootstrap = true; + $this->explicitSelect = true; + $this->context = Context::getContext(); + $this->_defaultOrderBy = 'id_advconstructor'; + + if ( Tools::getValue('hookid') ) { + $blocks = AdvConstructorBlock::getBlocksByHookIDLite(Tools::getValue('hookid')); + $blocks_id = "0"; + if($blocks){ + $blocks_id = implode(',',$blocks); + } + $this->_where = ' AND a.`id_advconstructor` IN ('.$blocks_id.')'; + } + + parent::__construct(); + + $this->fields_list = array( + 'id_advconstructor' => array( + 'title' => $this->l('ID'), + 'align' => 'center', + 'width' => 25, + 'filter_key' => 'a!id_advconstructor' + ), + 'title' => array( + 'title' => $this->l('Nom') + ), + 'skin' => array( + 'title' => $this->l('Apparence') + ), + 'active' => array( + 'title' => $this->l('Activé'), + 'active' => 'status', + 'filter_key' => 'a!active', + 'align' => 'text-center', + 'type' => 'bool', + 'class' => 'fixed-width-sm', + 'orderby' => false + ), + ); + + $this->actions = array('edit','delete'); + $this->bulk_actions = array( + 'delete' => array( + 'text' => $this->l('Supprimer la liste'), + 'icon' => 'icon-trash', + 'confirm' => $this->l('Supprimer les blocs selectionné?') + ) + ); + $this->specificConfirmDelete = false; + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + + if ($this->display == 'edit' || $this->display == 'add') { + $this->page_header_toolbar_btn['back_to_list'] = array( + 'href' => self::$currentIndex.'&token='.$this->token, + 'desc' => $this->l('Retour à la liste', null, null, false), + 'icon' => 'process-icon-back' + ); + } + $this->page_header_toolbar_btn['new_constructor'] = array( + 'href' => self::$currentIndex.'&addadvconstructor&token='.$this->token, + 'desc' => $this->l('Ajouter un nouveau bloc', null, null, false), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['position'] = array( + 'href' => $this->context->link->getAdminLink('AdminAdvConstructorPosition'), + 'desc' => $this->l('Gérer les positions', null, null, false), + 'icon' => 'process-icon-modules-list' + ); + } + + public function renderForm() + { + if (!($obj = $this->loadObject(true))) { + return; + } + + $context = Context::getContext(); + + $hooks_id = explode( ",", Configuration::get('ADVCONSTRUCTOR_HOOKS') ); + $hooks = array(); + foreach ($hooks_id as $hook_id) { + $hook = new Hook($hook_id, $context->language->id); + $hooks[] = array( + 'id_hook' => $hook->id, + 'name' => $hook->name, + 'title' => $hook->title, + ); + } + + $block_hooks = array(); + if (!empty($this->object->id)) { + $block_hooks = $this->object->getHooks(); + } + foreach ($hooks as $key => $hook) { + $hook['selected'] = (bool) in_array($hook['id_hook'], $block_hooks); + $hooks[$key] = $hook; + } + + $skins = array(); + foreach ( explode(',', Configuration::get('ADVCONSTRUCTOR_TYPE')) as $skin ) { + $skins[] = array( + 'id' => $skin, + 'name' => $skin + ); + } + + $icons = array(); + $icons[] = array('id' => '', 'name' => 'Standard'); + foreach ( explode(',', Configuration::get('ADVCONSTRUCTOR_ICON')) as $key => $icon ) { + $icons[] = array( + 'id' => $key+1, + 'name' => ucfirst($icon) + ); + } + + if ( Tools::isSubmit('id_advconstructor') ) { + $id_advconstructor = (int)Tools::getValue('id_advconstructor'); + $image = __PS_BASE_URI__.'img/constructor/image/'.$id_advconstructor ; + $hover = __PS_BASE_URI__.'img/constructor/hover/'.$id_advconstructor ; + } else { + $image = "noimg" ; + $hover = "noimg" ; + } + + $selected_categories = !empty($this->object->id) ? $this->object->getCategory() : array(); + + $this->fields_form = array( + 'multilang' => true, + 'tinymce' => true, + 'legend' => array( + 'title' => $this->l('Bloc'), + ), + 'submit' => array( + 'name' => 'submitBlock', + 'title' => $this->l('Enregistrer') + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Titre'), + 'name' => 'title', + 'lang' => true, + 'required' => true, + 'form_group_class' => 'fieldhide input_info', + 'size' => 255 + ), + array( + 'type' => 'text', + 'label' => $this->l('Label du lien'), + 'name' => 'subtitle', + 'lang' => true, + 'form_group_class' => 'fieldhide input_info', + 'size' => 255 + ), + array( + 'type' => 'text', + 'label' => $this->l('Lien'), + 'name' => 'link', + 'lang' => true, + 'form_group_class' => 'fieldhide input_info', + 'size' => 255 + ), + array( + 'type' => 'switch', + 'label' => $this->l('Lien externe'), + 'name' => 'external', + 'required' => false, + 'is_bool' => true, + 'form_group_class' => 'fieldhide input_info', + 'values' => array( + array( + 'id' => 'external_on', + 'value' => 1, + 'label' => $this->l('Yes') + ), + array( + 'id' => 'external_off', + 'value' => 0, + 'label' => $this->l('No') + ) + ) + ), + array( + 'type' => 'textarea', + 'label' => $this->l('Contenu'), + 'name' => 'content', + 'form_group_class' => 'fieldhide input_info', + 'autoload_rte' => true, + 'lang' => true, + 'cols' => 60, + 'rows' => 120 + ), + array( + 'type' => 'datetime', + 'label' => $this->l('Date de début'), + 'name' => 'date_from', + 'form_group_class' => 'fieldhide input_dates', + 'size' => 33, + ), + array( + 'type' => 'datetime', + 'label' => $this->l('Date de fin'), + 'name' => 'date_to', + 'form_group_class' => 'fieldhide input_dates', + 'size' => 33, + ), + array( + 'type' => 'select', + 'label' => $this->l('Apparence du bloc'), + 'name' => 'skin', + 'required' => true, + 'form_group_class' => 'fieldhide input_association', + 'options' => array( + 'query' => $skins, + 'id' => 'id', + 'name' => 'name' + ) + ), + array( + 'type' => 'hook', + 'label' => $this->l('Hook'), + 'name' => 'hookBox', + 'required' => true, + 'form_group_class' => 'fieldhide input_association', + 'values' => $hooks, + 'col' => '9', + ), + array( + 'type' => 'categories', + 'label' => $this->l('Parent category'), + 'name' => 'categoryBox', + 'tree' => array( + 'id' => 'categories-tree', + 'selected_categories' => $selected_categories, + 'use_checkbox' => true, + 'root_category' => $context->shop->getCategory() + ), + 'col' => '9', + 'form_group_class' => 'fieldhide input_association' + ), + array( + 'type' => 'select', + 'label' => $this->l('Type d\'affichage'), + 'name' => 'icon', + 'required' => FALSE, + 'form_group_class' => 'fieldhide input_img', + 'options' => array( + 'query' => $icons, + 'id' => 'id', + 'name' => 'name' + ) + ), + array( + 'type' => 'file', + 'label' => $this->l('Choisisser une image'), + 'name' => 'image', + 'form_group_class' => 'fieldhide input_img', + 'url' => $image + ), + array( + 'type' => 'switch', + 'label' => $this->l('Actif'), + 'name' => 'active', + 'required' => false, + 'class' => 't', + 'form_group_class' => 'fieldhide input_info', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'active_on', + 'value' => 1 + ), + array( + 'id' => 'active_off', + 'value' => 0 + ) + ), + ), + ) + ); + + if (Shop::isFeatureActive()) { + $this->fields_form['input'][] = array( + 'type' => 'shop', + 'label' => $this->l('Boutique'), + 'name' => 'checkBoxShopAsso', + 'form_group_class' => 'fieldhide input_association' + ); + } + + return parent::renderForm(); + } + + + public function init() + { + parent::init(); + + if (Shop::getContext() == Shop::CONTEXT_SHOP) { + $this->_join .= ' LEFT JOIN `'._DB_PREFIX_. $this->table .'_shop` sa ON (a.`' . $this->identifier . '` = sa.`' . $this->identifier . '` AND sa.id_shop = '.(int)$this->context->shop->id.') '; + } + + if (Shop::getContext() == Shop::CONTEXT_SHOP && Shop::isFeatureActive()) { + $this->_where = ' AND sa.`id_shop` = '.(int)Context::getContext()->shop->id; + } + } + + public function postProcess() + { + $result = parent::postProcess(); + if ( Validate::isLoadedObject($result) ) { + $this->generatePicture($result); + $result->addHooksAssociation(Tools::getValue('hookBox')); + $result->addCategoryAssociation(Tools::getValue('categoryBox')); + $this->redirect_after = self::$currentIndex.'&id_advconstructor='.(int)$result->id.'&update'.$this->table.'&token='.$this->token; + } + return $result; + } + + public function generatePicture($object) + { + $languages = Language::getLanguages(false); + foreach ($languages as $language) { + $tabimgs = array( + "image", + "hover" + ); + + foreach ( $tabimgs as $tabimg ) { + $namePost = $tabimg.'_'.$language['id_lang']; + if (isset($_FILES[$namePost]) && !empty($_FILES[$namePost]['tmp_name']) ) { + $fileTemp = $_FILES[$namePost]['tmp_name']; + $fileParts = pathinfo($_FILES[$namePost]['name']); + + if ( $fileParts['extension'] == 'jpg' || $fileParts['extension'] == 'png' ) { + if(!is_dir(_PS_IMG_DIR_.'constructor/'.$tabimg)) { + mkdir(_PS_IMG_DIR_.'constructor/'.$tabimg, 0775); + } + + $res = move_uploaded_file($fileTemp, _PS_IMG_DIR_.'constructor/'.$tabimg.'/'. $object->id . '_'.$language['id_lang'].'.jpg'); + if(!$res) + $this->errors[] = sprintf(Tools::displayError('An error occured during upload of file %s'), $object->id . '.jpg'); + else + $this->confirmations[] = sprintf($this->l('File %s has been uploaded'), $object->id . '.jpg'); + } else + $this->errors[] = sprintf(Tools::displayError('File %s have not good extension, only .jpg or .png'), $object->id . '.jpg'); + } + } + } + } + + protected function updateAssoShop($id_object) + { + if (!Shop::isFeatureActive()) { + return; + } + + $assos_data = $this->getSelectedAssoShop($this->table, $id_object); + + $exclude_ids = $assos_data; + foreach (Db::getInstance()->executeS('SELECT id_shop FROM ' . _DB_PREFIX_ . 'shop') as $row) { + if (!$this->context->employee->hasAuthOnShop($row['id_shop'])) { + $exclude_ids[] = $row['id_shop']; + } + } + + Db::getInstance()->delete($this->table . '_shop', '`' . $this->identifier . '` = ' . (int) $id_object . ($exclude_ids ? ' AND id_shop NOT IN (' . implode(', ', $exclude_ids) . ')' : '')); + + $insert = array(); + foreach ($assos_data as $id_shop) { + $insert[] = array( + $this->identifier => $id_object, + 'id_shop' => (int) $id_shop, + ); + } + + return Db::getInstance()->insert($this->table . '_shop', $insert, FALSE, TRUE, Db::INSERT_IGNORE); + } + + protected function getSelectedAssoShop($table) + { + if (!Shop::isFeatureActive()) { + return array(); + } + + $shops = Shop::getShops(TRUE, NULL, TRUE); + if (count($shops) == 1 && isset($shops[0])) { + return array($shops[0], 'shop'); + } + + $assos = array(); + if (Tools::isSubmit('checkBoxShopAsso_' . $table)) { + foreach (Tools::getValue('checkBoxShopAsso_' . $table) as $id_shop => $value) { + $assos[] = (int) $id_shop; + } + } else if (Shop::getTotalShops(FALSE) == 1) { + // if we do not have the checkBox multishop, we can have an admin with only one shop and being in multishop + $assos[] = (int) Shop::getContextShopID(); + } + + return $assos; + } +} diff --git a/modules/advconstructor/controllers/admin/AdminAdvConstructorPosition.php b/modules/advconstructor/controllers/admin/AdminAdvConstructorPosition.php new file mode 100644 index 00000000..1d5fa226 --- /dev/null +++ b/modules/advconstructor/controllers/admin/AdminAdvConstructorPosition.php @@ -0,0 +1,159 @@ +bootstrap = true; + parent::__construct(); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + $this->page_header_toolbar_btn['back_to_list'] = array( + 'href' => $this->context->link->getAdminLink('AdminAdvConstructor'), + 'desc' => $this->l('Retour à la liste de bloc', null, null, false), + 'icon' => 'process-icon-back' + ); + if ($this->display != 'edit' && $this->display != 'add') { + $this->page_header_toolbar_btn['back_to_choice'] = array( + 'href' => $this->context->link->getAdminLink('AdminAdvConstructorPosition'), + 'desc' => $this->l('Retour au choix du hook', null, null, false), + 'icon' => 'process-icon-back' + ); + } + } + + public function renderForm() + { + $context = Context::getContext(); + + $hooks_id = explode( ",", Configuration::get('ADVCONSTRUCTOR_HOOKS') ); + $hooks = array(); + foreach ($hooks_id as $hook_id) { + $hook = new Hook($hook_id, $context->language->id); + $hooks[] = array( + 'id' => $hook->id, + 'name' => $hook->name + ); + } + + $this->fields_form = array( + 'multilang' => true, + 'tinymce' => true, + 'legend' => array( + 'title' => $this->l('Choissisez le hook'), + ), + 'submit' => array( + 'name' => 'submitHook', + 'title' => $this->l('Changer les positions') + ), + 'input' => array( + 'icon' => array( + 'type' => 'select', + 'label' => $this->l('Hook'), + 'name' => 'hook', + 'required' => FALSE, + 'options' => array( + 'query' => $hooks, + 'id' => 'id', + 'name' => 'name' + ) + ) + ) + ); + + return parent::renderForm(); + } + + public function renderList() + { + $context = Context::getContext(); + + $this->table = 'advconstructor_hook'; + $this->className = 'AdvConstructorHook'; + $this->identifier = 'id_advconstructor_hook'; + $this->lang = false; + $this->deleted = false; + $this->bootstrap = true; + $this->explicitSelect = true; + $this->context = Context::getContext(); + $this->_defaultOrderBy = 'position'; + $this->position_identifier = 'ID'; + + $this->_select = "a.`id_advconstructor`, c.`title` AS `NAME`"; + $this->_where = ' AND a.`id_hook` = '.$this->_hook; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'advconstructor_lang` c ON (c.`id_advconstructor` = a.`id_advconstructor` AND c.`id_lang` = '.$context->language->id.') '; + + $this->fields_list = array( + 'id_advconstructor_hook' => array( + 'title' => $this->l('ID de la position'), + 'align' => 'center', + 'width' => 25 + ), + 'id_advconstructor' => array( + 'title' => $this->l('ID du bloc'), + 'align' => 'center', + 'width' => 25 + ), + 'NAME' => array( + 'title' => $this->l('Nom du bloc'), + 'align' => 'center' + ), + 'position' => array( + 'title' => $this->l('Position'), + 'align' => 'center', + 'position' => 'position', + 'filter_key' => 'a!position' + ) + ); + + return parent::renderList(); + } + + public function postProcess() + { + if ( Tools::isSubmit("submitHook") ) { + $this->_step = 1; + $this->_hook = Tools::getValue('hook'); + $this->display = 'list'; + } else { + $this->display = 'add'; + } + + return parent::postProcess(); + } + + public function ajaxProcessUpdatePositions() + { + $way = (int)(Tools::getValue('way')); + $id = (int)(Tools::getValue('id')); + $positions = Tools::getValue('advconstructor_hook'); + $page = (int)Tools::getValue('page'); + $selected_pagination = (int)Tools::getValue('selected_pagination'); + $obj = 'position hook'; + + if ( is_array($positions) ) { + foreach ($positions as $position => $value) { + $pos = explode('_', $value); + + if (isset($pos[2]) && (int)$pos[2] === $id) { + $hook_position = new AdvConstructorHook((int)$pos[2]); + if (isset($position) && $hook_position->updatePosition( $way, $position ) ) { + die(true); + } else { + die('{"hasError" : true, errors : "Cannot update blocks position"}'); + } + } + } + } else { + die('{"hasError" : true, errors : "Cannot update blocks position"}'); + } + } +} \ No newline at end of file diff --git a/modules/advconstructor/controllers/admin/index.php b/modules/advconstructor/controllers/admin/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/controllers/admin/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/controllers/index.php b/modules/advconstructor/controllers/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/controllers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/img/index.php b/modules/advconstructor/img/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/img/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/index.php b/modules/advconstructor/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/logo.gif b/modules/advconstructor/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..2ef1c9e740a7d44219b12f119e282f7b6cafb1e6 GIT binary patch literal 2097 zcmdT_dstFu9A?d2t*e_`ZL@X6W?ITkE<%zhm(+zzu!~!k2q$3%hu}ESYL!l_sd=f? ztSm37WrAdun{Hrc8fGabm9uGP7tG4i)XHSgvi8T^|NEZrIp6Jl-{0?dzV|t2nLo>u z%$tpvjTqJ<)Hhfa*B7UpapI@=IfT~7opfFfe=A60B%em6R^r)O^Q8gW?)xwFPnn6P zvGgj>gXhV1jHJVLUV9t&n@pyS2J_%Zub|bO-jd#U^9lpz8Xw9zbIdgl{E{!Ym zXALE(*7W%KXTiCe7TQe4ftqWShS9i;rjfb<>9Zl#dj0SgZ7w0T{mILQ1RdwBz9;u0 zVRL0<^a({)4WVZ&Evg_~*G$W$X2QOMW~yPtsv9-bg(2<<5LWyc(5K z;h^qZ-`3XF-rm8DT^o?o7O!$0etECf zJ06Ut7}dcweOJchG^xx#xhu9>I6pWor_N_<*$&OQh)f+`k(imKb)B)Uul`X(`T4ZM zht;&h&36Y&mBxETb@cn_Qb-bKg#njd1*~qC2jP1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Mqw55DN+JJ51am=M!AWj>Cyb5{ z1LKc5i#g9fE$x8EK!*Yg;IC{Z6az%3Tc7*M8N872(I-uQYk2pi`Vx?w_*dwtMLHl&+iL$e1HWk^PRNXJv1cTmdY#B;s~rSwCIFs-Zz~V%TPyCjj=d`nrHz zL~uOBXSJ{m=4Wm~!*|OQ5x~jc(q1fP6U&PT3MqKn3#%35df~Qg=GrURNEUecNJq^; zP0&_Ew`=)lrS7CYk-m0b9#2L)$EOz&tvhAjuc?{{lHz>QXE$|F?{!{$qE`x!H~&WZ zX-)l3KA`)N=!Aii*m`090>adr2C2*ne8ZY_PF@w4C2VB1ZN#RB3?hts+r06ix`4wzrn{f9`RD+XoH2@`X|e(y`fK z;{iPmBu>k1ctVuK*`9u4Q*M(CbV@l^ zOWW#ZKlctq+C0c3p98h~Y}kJW+8I|?=)|I@=PAKW{#*uTVnflAqUj=x>`}_>{_I(n zvk@h0b*IuHUY0pbn*$|>s`FZw*A1)NZW%6kC9qo&YSR&ud%4O7D{n7^f4g9%y}B-< zc^AUdm6EYeqUVs%G(VmpH08F_D~d8$l~mQdA)#m$o^!5TgBhEF)V-vh4rF`g+6lmmy>OB~g&f>BOyGp!lB)epQ49yb5OZ?0*0mC0R)T literal 0 HcmV?d00001 diff --git a/modules/advconstructor/translations/index.php b/modules/advconstructor/translations/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/translations/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/index.php b/modules/advconstructor/views/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/_configure/helpers/form/form.tpl b/modules/advconstructor/views/templates/admin/_configure/helpers/form/form.tpl new file mode 100644 index 00000000..b90120b9 --- /dev/null +++ b/modules/advconstructor/views/templates/admin/_configure/helpers/form/form.tpl @@ -0,0 +1,48 @@ +{extends file="helpers/form/form.tpl"} +{block name="input"} + {if $input.type == 'hook'} + {assign var=hooks value=$input.values} + {if count($hooks) && isset($hooks)} +
+
+ + + + + + + + + + {foreach $hooks as $key => $hook} + + + + + + {/foreach} + +
+ + + + {l s='ID' mod='advconstructor'} + + {l s='Nom du hook' mod='advconstructor'} + +
+ {assign var=id_checkbox value=hookBox|cat:'_'|cat:$hook['id_hook']} + + {$hook['id_hook']} + +
+
+
+ {else} +

+ {l s='Pas de hook' mod='advconstructor'} +

+ {/if} + {/if} + {$smarty.block.parent} +{/block} \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/_configure/helpers/form/index.php b/modules/advconstructor/views/templates/admin/_configure/helpers/form/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/_configure/helpers/form/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/_configure/helpers/index.php b/modules/advconstructor/views/templates/admin/_configure/helpers/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/_configure/helpers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/_configure/index.php b/modules/advconstructor/views/templates/admin/_configure/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/_configure/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/form.tpl b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/form.tpl new file mode 100644 index 00000000..687f4086 --- /dev/null +++ b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/form.tpl @@ -0,0 +1,109 @@ +{extends file="helpers/form/form.tpl"} +{block name="fieldset" prepend} + + +{/block} + +{block name="input"} + {if $input.type == 'hook'} + {assign var=hooks value=$input.values} + {if count($hooks) && isset($hooks)} +
+
+ + + + + + + + + + {foreach $hooks as $key => $hook} + + + + + + {/foreach} + +
+ + + + {l s='ID' mod='advconstructor'} + + {l s='Nom du hook' mod='advconstructor'} + +
+ {assign var=id_checkbox value=hookBox|cat:'_'|cat:$hook['id_hook']} + + {$hook['id_hook']} + +
+
+
+ {else} +

+ {l s='Pas de hook' mod='advconstructor'} +

+ {/if} + {/if} + {$smarty.block.parent} +{/block} \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/index.php b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/form/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/adv_constructor/helpers/index.php b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/adv_constructor/helpers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/adv_constructor/index.php b/modules/advconstructor/views/templates/admin/adv_constructor/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/adv_constructor/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/helpers/index.php b/modules/advconstructor/views/templates/admin/helpers/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/helpers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/helpers/uploader/index.php b/modules/advconstructor/views/templates/admin/helpers/uploader/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/helpers/uploader/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/helpers/uploader/simple.tpl b/modules/advconstructor/views/templates/admin/helpers/uploader/simple.tpl new file mode 100644 index 00000000..5eb05876 --- /dev/null +++ b/modules/advconstructor/views/templates/admin/helpers/uploader/simple.tpl @@ -0,0 +1,54 @@ +{assign var=languages value=Language::getLanguages(false)} +{if !isset($defaultFormLanguage)} + {assign var=defaultFormLanguage value=$languages[0].id_lang} +{/if} +
+ {foreach from=$languages item=language} + {if $languages|count > 1} +
+ {/if} +
+ {if $url != "noimg"} + + {/if} + +
+ + + + + +
+
+ {if $languages|count > 1} +
+ + +
+ {/if} + {if $languages|count > 1} +
+ {/if} + + {/foreach} +
\ No newline at end of file diff --git a/modules/advconstructor/views/templates/admin/index.php b/modules/advconstructor/views/templates/admin/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/admin/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/modules/advconstructor/views/templates/hook/alert.tpl b/modules/advconstructor/views/templates/hook/alert.tpl new file mode 100644 index 00000000..e69de29b diff --git a/modules/advconstructor/views/templates/hook/edito.tpl b/modules/advconstructor/views/templates/hook/edito.tpl new file mode 100644 index 00000000..ed22b78b --- /dev/null +++ b/modules/advconstructor/views/templates/hook/edito.tpl @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/modules/advconstructor/views/templates/hook/footer.tpl b/modules/advconstructor/views/templates/hook/footer.tpl new file mode 100644 index 00000000..e69de29b diff --git a/modules/advconstructor/views/templates/hook/nav.tpl b/modules/advconstructor/views/templates/hook/nav.tpl new file mode 100644 index 00000000..e69de29b diff --git a/modules/advconstructor/views/templates/hook/seo.tpl b/modules/advconstructor/views/templates/hook/seo.tpl new file mode 100644 index 00000000..8c3ca70f --- /dev/null +++ b/modules/advconstructor/views/templates/hook/seo.tpl @@ -0,0 +1,5 @@ +
+

{$block->title}

+

{$block->subtitle}

+ {$block->content} +
\ No newline at end of file diff --git a/modules/advconstructor/views/templates/index.php b/modules/advconstructor/views/templates/index.php new file mode 100644 index 00000000..9484a53e --- /dev/null +++ b/modules/advconstructor/views/templates/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; \ No newline at end of file diff --git a/themes/toutpratique/css/global.css b/themes/toutpratique/css/global.css index 31920bf0..25786496 100644 --- a/themes/toutpratique/css/global.css +++ b/themes/toutpratique/css/global.css @@ -280,7 +280,63 @@ body.content_only { margin: 0 } } } +/************ ADV CONSTRUCTOR *************/ +#constructorLink { + margin-top: 30px; +} + #constructorLink div .inner { + background-color: #f5f0f1; + padding: 45px 0px 45px 30px; + overflow: hidden; + height: 270px; + } + #constructorLink div .inner .img { width: 168px; height: 100%;position: relative; position: relative; + float: right;} + #constructorLink div:nth-child(2) .inner { background-color: #edf4f3; } + #constructorLink div img { position: absolute; left: -5px;} + #constructorLink .btn { background-color: #464646; margin-top: 20px; font-size: 24px; line-height: 30px; } + #constructorLink .btn:hover { background-color: #e44e58; } + #constructorLink .title { + font-family: 'pompiere_regular'; + font-size: 35px; + text-transform: uppercase; + margin-top: 0; + margin-bottom: 20px; + } + #constructorLink p { + color : #464646; + } +#best_sales .title { + text-align: center; + margin-bottom: 30px; + margin-top: 30px; + font-size: 36px; + border-bottom: 3px solid #333333; + padding-bottom: 10px; +} + #index #best_sales h2:not(.title) {display: none;} + +@media(max-width: 1170px) { + #constructorLink div .inner { height: 350px; } + #constructorLink div .inner p { height: 110px; } + +} +@media(max-width: 990px) { + #constructorLink div .inner .img { width: 120px; } + #constructorLink div .inner .img img { left: -30px; } +} +@media(max-width: 767px) { + #constructorLink .title { font-size: 30px; } + #constructorLink div .inner p { display: none; } + #constructorLink div .inner .img { height: 150px; float:none; margin: auto;} + #constructorLink div .inner .img img { max-width: 100%; width: 120px; float: none; margin: auto; left:0 ;} + #constructorLink div .inner { text-align: center; padding: 20px 15px 20px 15px; height: auto; } + #constructorLink .btn { margin: auto; } +} +@media(max-width: 500px) { + #constructorLink { display: none; } +} #main_menu { font-family: 'pt_sansbold'; @@ -617,7 +673,7 @@ body .ac_results { color: #222222; font-family: 'vidaloka'; letter-spacing: -1px; - font-size: 48px; + font-size: 36px; margin-top: 20px; margin-bottom: 25px; } diff --git a/themes/toutpratique/img/light.png b/themes/toutpratique/img/light.png new file mode 100644 index 0000000000000000000000000000000000000000..c91315eb2b9e9980f83cb1f354ccb8144ade268d GIT binary patch literal 7502 zcmaKRcQ{;M*R~c!jZve8(L(exMvdN$UK3)N!C)|qE;>Qst4{*4}IFbN01Pf-yv!nu3*rfPjEnS4YDX-%jA~ zQF2oJb1x-)65rfLYg(htyqwViP#-vfD$L6f&ZUcly1-50P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fDa<>&*)yjPG9A9S5WPq@h+PIjK$jEsWP5MN4>eDVunUq)l#DIBy|IB#1 z?M`l+<9G?PfT?V$>5CT`79Dhd=HrDCX*^gV;IPjP0kSWeL7bq_S;!<9f1=WQT`z8S z2$v0SKHCm>X@EgCzL(>k#L0nl@Sw{>QFi1U}z=f`fAR5*{FX-nF1cJe1QYXsJ1 z=zw4Q0AAC(C_wsH7efu0xYaJ)se6b~FK?vDpp5#1YU!0=FHPE2>EU@kqz)he@vup{ zlFF(d)g6=3qlio1az?x1LrN@QFGkU`u-;1 z*|_yzFSRbsej&y9aQ^E}MzYxPtnztqG*F@?DOe!&=AZjw&HH5-jjuyd>8VsVINAGDvcS}Xyb4stT92QPUY33hqv zWsKvc*@#zKBb?bIpfBU$rOR;p*#8DJ&XbKVfIGjHMizL2UTb_YEMqLuB~GXiyQm9)5Ah34;fks19Mdid?d&2m|m_kHYn!#MlJIGY#T)DI)=nuxOqQbpE%>I3D zPIUl63;&J0X}~&gr%5N?Hu5Y(@V=4m%gTHBBO?_upeu6pRAPoXmGIOAQ7#n$PCnH$ z!-0wCz~98zhm2QA&NJKsEYuzCN+)x%Uo9W0&&5TI9?C&Ym&My@p?^?Zp1kF#_uIi>j^ + +{*

{l s='Mes astuces en un clic'}

@@ -9,8 +10,19 @@
+*} + + +
+
+

{l s='Les indispensables du moment'}

+ {hook h='displayHome' mod='blockbestsellers'} +
-
diff --git a/themes/toutpratique/modules/advconstructor/category.tpl b/themes/toutpratique/modules/advconstructor/category.tpl new file mode 100644 index 00000000..c27bccb9 --- /dev/null +++ b/themes/toutpratique/modules/advconstructor/category.tpl @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/themes/toutpratique/modules/advconstructor/edito.tpl b/themes/toutpratique/modules/advconstructor/edito.tpl new file mode 100644 index 00000000..7dce524e --- /dev/null +++ b/themes/toutpratique/modules/advconstructor/edito.tpl @@ -0,0 +1,13 @@ +
+
+
+ +
+

{$block->title}

+ {$block->content} + + {$block->subtitle} + + +
+
\ No newline at end of file diff --git a/themes/toutpratique/modules/advconstructor/home.tpl b/themes/toutpratique/modules/advconstructor/home.tpl new file mode 100644 index 00000000..d5ecc4ac --- /dev/null +++ b/themes/toutpratique/modules/advconstructor/home.tpl @@ -0,0 +1,13 @@ +
+
+
+ {$block->title} +
+ {$block->content} +
+
+ {if !empty($block->link)} + {$block->subtitle} + {/if} +
+
\ No newline at end of file diff --git a/themes/toutpratique/modules/advconstructor/translations/fr.php b/themes/toutpratique/modules/advconstructor/translations/fr.php new file mode 100644 index 00000000..e69de29b