From 68c8e9da57dcb29862ce4b47d80fc52a66ff8bed Mon Sep 17 00:00:00 2001 From: rGaillard Date: Sat, 16 Nov 2013 19:24:03 +0100 Subject: [PATCH] // move to themeconfigurator --- .../images/index.php | 0 .../logo.gif | Bin .../logo.png | Bin .../themeconfigurator/themeconfigurator.php | 424 +++++++++++++++++- .../views/css/admin.css | 0 .../views/css/font/FontAwesome.otf | Bin .../views/css/font/font.css | 0 .../views/css/font/fontawesome-webfont.eot | Bin .../views/css/font/fontawesome-webfont.svg | 0 .../views/css/font/fontawesome-webfont.ttf | Bin .../views/css/font/fontawesome-webfont.woff | Bin .../views/css/font/museo_slab_300-webfont.eot | Bin .../views/css/font/museo_slab_300-webfont.ttf | Bin .../views/css/font/museo_slab_500-webfont.eot | Bin .../views/css/font/museo_slab_500-webfont.ttf | Bin .../css/font/proximanova-sbold-webfont.eot | Bin .../css/font/proximanova-sbold-webfont.ttf | Bin .../views/css/font/proximanova-webfont.eot | Bin .../views/css/font/proximanova-webfont.ttf | Bin .../views/css/hooks.css | 0 .../views/js/admin.js | 0 .../views/js}/index.php | 0 .../views/templates/admin/admin.tpl | 9 +- .../views/templates/admin}/index.php | 0 .../views/templates/admin/items.tpl | 34 +- .../views/templates/admin/messages.tpl | 0 .../views/templates/admin/new.tpl | 26 +- .../views/templates/hooks/hook.tpl} | 6 +- .../views/templates}/index.php | 0 modules/tmhtmlcontent/config.xml | 12 - .../4124625121355c962edd8c86ef14f3ee.jpg | Bin 115280 -> 0 bytes .../471dd22ba78685f12e457c16c9e3a005.jpg | Bin 138914 -> 0 bytes .../4f15eb95ccf54ffc141222224b86b2ac.jpg | Bin 139990 -> 0 bytes .../67d43d531b80880be4bf34fa50c3c2d5.jpg | Bin 80665 -> 0 bytes .../73c2f0d3133082d7d2879648d7b72e8d.jpg | Bin 142954 -> 0 bytes .../86a740c6973b2c0fdd9211583fb51dc3.jpg | Bin 87797 -> 0 bytes .../eb27ba8719f4206d861d8ce84dad7891.jpg | Bin 123560 -> 0 bytes modules/tmhtmlcontent/index.php | 8 - modules/tmhtmlcontent/tmhtmlcontent.php | 387 ---------------- .../views/templates/admin/index.php | 10 - .../views/templates/hooks/footer.tpl | 27 -- .../views/templates/hooks/left.tpl | 27 -- .../views/templates/hooks/right.tpl | 27 -- .../views/templates/hooks/top.tpl | 27 -- .../tmhtmlcontent/views/templates/index.php | 10 - 45 files changed, 438 insertions(+), 596 deletions(-) rename modules/{tmhtmlcontent => themeconfigurator}/images/index.php (100%) rename modules/{tmhtmlcontent => themeconfigurator}/logo.gif (100%) rename modules/{tmhtmlcontent => themeconfigurator}/logo.png (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/admin.css (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/FontAwesome.otf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/font.css (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/fontawesome-webfont.eot (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/fontawesome-webfont.svg (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/fontawesome-webfont.ttf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/fontawesome-webfont.woff (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/museo_slab_300-webfont.eot (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/museo_slab_300-webfont.ttf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/museo_slab_500-webfont.eot (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/museo_slab_500-webfont.ttf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/proximanova-sbold-webfont.eot (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/proximanova-sbold-webfont.ttf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/proximanova-webfont.eot (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/font/proximanova-webfont.ttf (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/css/hooks.css (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/js/admin.js (100%) rename modules/{tmhtmlcontent/translations => themeconfigurator/views/js}/index.php (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/templates/admin/admin.tpl (84%) rename modules/{tmhtmlcontent/views => themeconfigurator/views/templates/admin}/index.php (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/templates/admin/items.tpl (88%) rename modules/{tmhtmlcontent => themeconfigurator}/views/templates/admin/messages.tpl (100%) rename modules/{tmhtmlcontent => themeconfigurator}/views/templates/admin/new.tpl (88%) rename modules/{tmhtmlcontent/views/templates/hooks/home.tpl => themeconfigurator/views/templates/hooks/hook.tpl} (86%) rename modules/{tmhtmlcontent/views/js => themeconfigurator/views/templates}/index.php (100%) delete mode 100644 modules/tmhtmlcontent/config.xml delete mode 100644 modules/tmhtmlcontent/images/4124625121355c962edd8c86ef14f3ee.jpg delete mode 100644 modules/tmhtmlcontent/images/471dd22ba78685f12e457c16c9e3a005.jpg delete mode 100644 modules/tmhtmlcontent/images/4f15eb95ccf54ffc141222224b86b2ac.jpg delete mode 100644 modules/tmhtmlcontent/images/67d43d531b80880be4bf34fa50c3c2d5.jpg delete mode 100644 modules/tmhtmlcontent/images/73c2f0d3133082d7d2879648d7b72e8d.jpg delete mode 100644 modules/tmhtmlcontent/images/86a740c6973b2c0fdd9211583fb51dc3.jpg delete mode 100644 modules/tmhtmlcontent/images/eb27ba8719f4206d861d8ce84dad7891.jpg delete mode 100644 modules/tmhtmlcontent/index.php delete mode 100644 modules/tmhtmlcontent/tmhtmlcontent.php delete mode 100644 modules/tmhtmlcontent/views/templates/admin/index.php delete mode 100644 modules/tmhtmlcontent/views/templates/hooks/footer.tpl delete mode 100644 modules/tmhtmlcontent/views/templates/hooks/left.tpl delete mode 100644 modules/tmhtmlcontent/views/templates/hooks/right.tpl delete mode 100644 modules/tmhtmlcontent/views/templates/hooks/top.tpl delete mode 100644 modules/tmhtmlcontent/views/templates/index.php diff --git a/modules/tmhtmlcontent/images/index.php b/modules/themeconfigurator/images/index.php similarity index 100% rename from modules/tmhtmlcontent/images/index.php rename to modules/themeconfigurator/images/index.php diff --git a/modules/tmhtmlcontent/logo.gif b/modules/themeconfigurator/logo.gif similarity index 100% rename from modules/tmhtmlcontent/logo.gif rename to modules/themeconfigurator/logo.gif diff --git a/modules/tmhtmlcontent/logo.png b/modules/themeconfigurator/logo.png similarity index 100% rename from modules/tmhtmlcontent/logo.png rename to modules/themeconfigurator/logo.png diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index 97114461e..6d2bf81bb 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -26,21 +26,281 @@ if (!defined('_PS_VERSION_')) exit; - + class ThemeConfigurator extends Module { + protected $max_image_size = 1048576; + protected $default_language; + protected $languages; + public function __construct() { $this->name = 'themeconfigurator'; $this->tab = 'front_office_features'; $this->version = '0.1'; + $this->bootstrap = true; + + $this->secure_key = Tools::encrypt($this->name); + $this->default_language = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT')); + $this->languages = Language::getLanguages(); + parent::__construct(); $this->displayName = $this->l('Theme configurator'); $this->description = $this->l('Configure elements of your theme'); - $this->bootstrap = true; + + $this->module_path = _PS_MODULE_DIR_.$this->name.'/'; + $this->uploads_path = _PS_MODULE_DIR_.$this->name.'/images/'; + $this->admin_tpl_path = _PS_MODULE_DIR_.$this->name.'/views/templates/admin/'; + $this->hooks_tpl_path = _PS_MODULE_DIR_.$this->name.'/views/templates/hooks/'; + + } + + public function install() + { + if (!parent::install() || + !$this->installDB() || + !$this->registerHook('displayHeader') || + !$this->registerHook('displayTop') || + !$this->registerHook('displayLeftColumn') || + !$this->registerHook('displayRightColumn') || + !$this->registerHook('displayHome') || + !$this->registerHook('displayFooter') || + !$this->registerHook('displayBackOfficeHeader')) + return false; + + return true; + } + + private function installDB() + { + return ( + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'themeconfigurator`') && + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'themeconfigurator` ( + `id_item` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_shop` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `item_order` int(10) unsigned NOT NULL, + `title` VARCHAR(100), + `title_use` tinyint(1) unsigned NOT NULL DEFAULT \'0\', + `hook` VARCHAR(100), + `url` VARCHAR(100), + `target` tinyint(1) unsigned NOT NULL DEFAULT \'0\', + `image` VARCHAR(100), + `image_w` VARCHAR(10), + `image_h` VARCHAR(10), + `html` TEXT, + `active` tinyint(1) unsigned NOT NULL DEFAULT \'1\', + PRIMARY KEY (`id_item`) + ) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8;') + ); + + return true; + } + + public function uninstall() + { + $images = Db::getInstance()->executeS('SELECT image FROM `'._DB_PREFIX_.'themeconfigurator`'); + foreach ($images as $image) + $this->deleteImage($image['image']); + + if (!Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'themeconfigurator`') || + !parent::uninstall()) + return false; + + return true; + } + + public function hookDisplayBackOfficeHeader() + { + if (Tools::getValue('configure') != $this->name) + return; + $this->context->controller->addCSS($this->_path.'views/css/admin.css'); + $this->context->controller->addJquery(); + $this->context->controller->addJS($this->_path.'views/js/admin.js'); + } + + public function hookdisplayHeader($params) + { + $this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all'); + } + + public function hookDisplayTop() + { + $this->context->smarty->assign(array( + 'htmlitems'=> $this->getItemsFromHook('top'), + 'hook' => 'top' + )); + return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + } + + public function hookDisplayHome() + { + $this->context->smarty->assign(array( + 'htmlitems'=> $this->getItemsFromHook('home'), + 'hook' => 'home' + )); + return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + } + + public function hookDisplayLeftColumn() + { + $this->context->smarty->assign(array( + 'htmlitems'=> $this->getItemsFromHook('left'), + 'hook' => 'left' + )); + return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); } + public function hookDisplayRightColumn() + { + $this->context->smarty->assign(array( + 'htmlitems'=> $this->getItemsFromHook('right'), + 'hook' => 'right' + )); + return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + } + public function hookDisplayFooter() + { + $this->context->smarty->assign(array( + 'htmlitems'=> $this->getItemsFromHook('footer'), + 'hook' => 'footer' + )); + return $this->display(__FILE__, 'views/templates/hooks/hook.tpl'); + } + + protected function getItemsFromHook($hook) + { + if (!$hook) + return false; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'themeconfigurator` + WHERE id_shop = '.(int)$this->context->shop->id.' AND id_lang = '.(int)$this->context->language->id.' AND hook = \''.pSQL($hook).'\' AND active = 1 + ORDER BY item_order ASC' + ); + } + + protected function deleteImage($image) + { + $file_name = $this->uploads_path.$image; + if (realpath(dirname($file_name)) != $this->uploads_path) + die; + + if ($image != '' && is_file($file_name)) + unlink($file_name); + } + + protected function removeItem() + { + $id_item = (int)Tools::getValue('item_id'); + + if ($image = Db::getInstance()->getValue('SELECT image FROM `'._DB_PREFIX_.'themeconfigurator` WHERE id_item = '.(int)$id_item)) + $this->deleteImage($image); + + Db::getInstance()->delete(_DB_PREFIX_.'themeconfigurator', 'id_item = '.(int)$id_item); + + if (Db::getInstance()->Affected_Rows() == 1) + { + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'themeconfigurator` + SET item_order = item_order-1 + WHERE ( + item_order > '.(int)Tools::getValue('item_order').' AND + id_shop = '.(int)$this->context->shop->id.' AND + hook = \''.pSQL(Tools::getValue('item_hook')).'\') + '); + + $this->context->smarty->assign('confirmation', $this->l('Successful deletion.')); + } + else + $this->context->smarty->assign('error', $this->l('Can\'t delete the slide.')); + } + + protected function updateItem() + { + $id_item = (int)Tools::getValue('item_id'); + + $title = Tools::getValue('item_title'); + $content = Tools::getValue('item_html'); + if (!Validate::isCleanHtml($title, (int)Configuration::get('PS_ALLOW_HTML_IFRAME')) || !Validate::isCleanHtml($content,(int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) + { + $this->context->smarty->assign('error', $this->l('Invalid content')); + return false; + } + + $new_image = ''; + $image_w = (is_numeric(Tools::getValue('item_img_w'))) ? (int)Tools::getValue('item_img_w') : ''; + $image_h = (is_numeric(Tools::getValue('item_img_h'))) ? (int)Tools::getValue('item_img_h') : ''; + + if(!empty($_FILES['item_img']['name'])) + { + if ($old_image = Db::getInstance()->getValue('SELECT image FROM `'._DB_PREFIX_.'themeconfigurator` WHERE id_item = '.(int)$id_item)) + $this->_deleteImages($old_image); + + if (!$image = $this->uploadImage($_FILES['item_img'], $image_w, $image_h)) + return false; + + $new_image = 'image = \''.pSQL($image).'\','; + } + else + { + $image_w = ''; + $image_h = ''; + } + + if (!Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'themeconfigurator` SET + title = \''.pSQL($title).'\', + title_use = '.(int)Tools::getValue('item_title_use').', + hook = \''.pSQL(Tools::getValue('item_hook')).'\', + url = \''.pSQL(Tools::getValue('item_url')).'\', + target = '.(int)Tools::getValue('item_target').', + '.$new_image.' + image_w = '.(int)$image_w.', + image_h = '.(int)$image_h.', + active = '.(int)Tools::getValue('item_active').', + html = \''.pSQL($content).'\' + WHERE id_item = '.(int)Tools::getValue('item_id') + )) + { + if ($image = Db::getInstance()->getValue('SELECT image FROM `'._DB_PREFIX_.'themeconfigurator` WHERE id_item = '.(int)Tools::getValue('item_id'))) + $this->deleteImage($image); + + $this->context->smarty->assign('error', $this->l('An error occured while saving data.')); + return false; + } + $this->context->smarty->assign('confirmation', $this->l('Successfully updated.')); + return true; + + } + + protected function uploadImage($image, $image_w = '', $image_h = '') + { + $res = false; + if (is_array($image) && (ImageManager::validateUpload($image, $this->max_image_size) === false) && ($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) && move_uploaded_file($image['tmp_name'], $tmp_name)) + { + $type = Tools::strtolower(Tools::substr(strrchr($image['name'], '.'), 1)); + $img_name = Tools::encrypt($image['name'].sha1(microtime())).'.'.$type; + Configuration::set('PS_IMAGE_QUALITY','png_all'); + if (ImageManager::resize($tmp_name, dirname(__FILE__).'/images/'.$img_name, $image_w, $image_h)) + $res = true; + + } + + if (isset($temp_name)) + @unlink($tmp_name); + if (!$res) + { + $this->context->smarty->assign('error', $this->l('An error occurred during the image upload.')); + return false; + } + + return $img_name; + } + public function getContent() { if (Tools::isSubmit('submitModule')) @@ -71,19 +331,107 @@ class ThemeConfigurator extends Module $module_instance->install(); } } - return $this->renderForm(); + + if (Tools::isSubmit('newItem')) + $this->addItem(); + elseif (Tools::isSubmit('updateItem')) + $this->updateItem(); + elseif (Tools::isSubmit('removeItem')) + $this->removeItem(); + + $html = $this->renderConfigurationForm(); + $html .= $this->renderThemeConfiguratorForm(); + + return $html; } - public function renderForm() + protected function addItem() { + $title = Tools::getValue('item_title'); + $content = Tools::getValue('item_html'); + if (!Validate::isCleanHtml($title, (int)Configuration::get('PS_ALLOW_HTML_IFRAME')) || !Validate::isCleanHtml($content, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) + { + $this->context->smarty->assign('error', $this->l('Invalid content')); + return false; + } + + if (!$current_order = (int)Db::getInstance()->getValue(' + SELECT item_order + 1 + FROM `'._DB_PREFIX_.'themeconfigurator` + WHERE + id_shop = '.(int)$this->context->shop->id.' + AND id_lang = '.(int)Tools::getValue('id_lang').' + AND hook = \''.pSQL(Tools::getValue('item_hook')).'\' + ORDER BY item_order DESC' + )) + $current_order = 1; + + $image_w = is_numeric(Tools::getValue('item_img_w')) ? (int)Tools::getValue('item_img_w') : ''; + $image_h = is_numeric(Tools::getValue('item_img_h')) ? (int)Tools::getValue('item_img_h') : ''; + + if(!empty($_FILES['item_img']['name'])) + { + if (!$image = $this->uploadImage($_FILES['item_img'], $image_w, $image_h)) + return false; + } + else + { + $image = ''; + $image_w = ''; + $image_h = ''; + } + + if (!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)Tools::getValue('id_lang').'\', + \''.(int)$current_order.'\', + \''.pSQL($title).'\', + \''.(int)Tools::getValue('item_title_use').'\', + \''.pSQL(Tools::getValue('item_hook')).'\', + \''.pSQL(Tools::getValue('item_url')).'\', + \''.(int)Tools::getValue('item_target').'\', + \''.pSQL($image).'\', + \''.pSQL($image_w).'\', + \''.pSQL($image_h).'\', + \''.pSQL($content).'\', + 1) + ')) + { + if (!Tools::isEmpty($image)) + $this->deleteImage($image); + + $this->context->smarty->assign('error', $this->l('An error occured while saving data.')); + return false; + } + + $this->context->smarty->assign('confirmation', $this->l('New item added successfull.')); + return true; + } + + public function renderConfigurationForm() + { $inputs = array(); foreach ($this->getConfigurableModules() as $module) + { + $desc = ''; + if (isset($module['is_module']) && $module['is_module']) + { + $module_instance = Module::getInstanceByName($module['name']); + if (Validate::isLoadedObject($module_instance) && method_exists($module_instance, 'getContent')) + $desc = ''.$this->l('Configure').''; + } + if (!$desc && isset($module['desc']) && $module['desc']) + $desc = $module['desc']; + $inputs[] = array( 'type' => 'switch', 'label' => $module['label'], 'name' => $module['name'], - 'desc' => (isset($module['desc']) ? $module['desc'] : ''), + 'desc' => $desc, 'values' => array( array( 'id' => 'active_on', @@ -97,6 +445,7 @@ class ThemeConfigurator extends Module ) ), ); + } $fields_form = array( 'form' => array( @@ -131,6 +480,52 @@ class ThemeConfigurator extends Module return $helper->generateForm(array($fields_form)); } + + protected function renderThemeConfiguratorForm() + { + $id_shop = (int)$this->context->shop->id; + $items = array(); + + $this->context->smarty->assign('htmlcontent', array( + 'admin_tpl_path' => $this->admin_tpl_path, + 'hooks_tpl_path' => $this->hooks_tpl_path, + + 'info' => array( + 'module' => $this->name, + 'name' => $this->displayName, + 'version' => $this->version, + 'psVersion' => _PS_VERSION_, + 'context' => (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') == 0) ? 1 : ($this->context->shop->getTotalShops() != 1) ? $this->context->shop->getContext() : 1 + ) + )); + + foreach ($this->languages as $language) { + $hooks[$language['id_lang']] = array('home', 'top', 'left', 'right', 'footer'); + + foreach ($hooks[$language['id_lang']] as $hook) + $items[$language['id_lang']][$hook] = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'themeconfigurator` + WHERE id_shop = '.(int)$id_shop.' + AND id_lang = '.(int)$language['id_lang'].' + AND hook = \''.pSQL($hook).'\' + ORDER BY item_order ASC' + ); + } + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items, + 'lang' => array( + 'default' => $this->default_language, + 'all' => $this->languages, + 'lang_dir' => _THEME_LANG_DIR_, + 'user' => $this->context->language->id + ), + 'postAction' => 'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module=other&module_name='.$this->name.'', + 'id_shop' => $id_shop + )); + + return $this->display(__FILE__, 'views/templates/admin/admin.tpl'); + } protected function getConfigurableModules() { @@ -138,52 +533,39 @@ class ThemeConfigurator extends Module array( 'label' => $this->l('Display the reinsurance block'), 'name' => 'blockreinsurance', - 'desc' => ''.$this->l('Configure the reinsurance block').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockreinsurance')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Display the social following links'), 'name' => 'blocksocial', - 'desc' => ''.$this->l('Configure the social following links').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blocksocial')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Display contact information'), 'name' => 'blockcontactinfos', - 'desc' => ''.$this->l('Configure the contact information of your store').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockcontactinfos')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Display social buttons on the products page'), 'name' => 'addsharethis', - 'desc' => ''.$this->l('Configure').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('addsharethis')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Display facebook block on the home page'), 'name' => 'blockfacebook', - 'desc' => ''.$this->l('Configure').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockfacebook')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Customer cms information block'), 'name' => 'blockcmsinfo', - 'desc' => ''.$this->l('Configure').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockcmsinfo')) && $module->active), 'is_module' => true, ), - array( - 'label' => $this->l('Customer banner information block'), - 'name' => 'tmhtmlcontent', - 'desc' => ''.$this->l('Configure').'', - 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('tmhtmlcontent')) && $module->active), - 'is_module' => true, - ), array( 'label' => $this->l('Enable Quick view'), 'name' => 'quick_view', @@ -192,14 +574,12 @@ class ThemeConfigurator extends Module array( 'label' => $this->l('Enable top banner'), 'name' => 'blockbanner', - 'desc' => ''.$this->l('Configure').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockbanner')) && $module->active), 'is_module' => true, ), array( 'label' => $this->l('Enable product payment logos'), 'name' => 'productpaymentlogos', - 'desc' => ''.$this->l('Configure').'', 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('productpaymentlogos')) && $module->active), 'is_module' => true, ) @@ -213,5 +593,5 @@ class ThemeConfigurator extends Module $values[$module['name']] = $module['value']; return $values; - } -} + } +} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/css/admin.css b/modules/themeconfigurator/views/css/admin.css similarity index 100% rename from modules/tmhtmlcontent/views/css/admin.css rename to modules/themeconfigurator/views/css/admin.css diff --git a/modules/tmhtmlcontent/views/css/font/FontAwesome.otf b/modules/themeconfigurator/views/css/font/FontAwesome.otf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/FontAwesome.otf rename to modules/themeconfigurator/views/css/font/FontAwesome.otf diff --git a/modules/tmhtmlcontent/views/css/font/font.css b/modules/themeconfigurator/views/css/font/font.css similarity index 100% rename from modules/tmhtmlcontent/views/css/font/font.css rename to modules/themeconfigurator/views/css/font/font.css diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.eot b/modules/themeconfigurator/views/css/font/fontawesome-webfont.eot similarity index 100% rename from modules/tmhtmlcontent/views/css/font/fontawesome-webfont.eot rename to modules/themeconfigurator/views/css/font/fontawesome-webfont.eot diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.svg b/modules/themeconfigurator/views/css/font/fontawesome-webfont.svg similarity index 100% rename from modules/tmhtmlcontent/views/css/font/fontawesome-webfont.svg rename to modules/themeconfigurator/views/css/font/fontawesome-webfont.svg diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.ttf b/modules/themeconfigurator/views/css/font/fontawesome-webfont.ttf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/fontawesome-webfont.ttf rename to modules/themeconfigurator/views/css/font/fontawesome-webfont.ttf diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.woff b/modules/themeconfigurator/views/css/font/fontawesome-webfont.woff similarity index 100% rename from modules/tmhtmlcontent/views/css/font/fontawesome-webfont.woff rename to modules/themeconfigurator/views/css/font/fontawesome-webfont.woff diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.eot b/modules/themeconfigurator/views/css/font/museo_slab_300-webfont.eot similarity index 100% rename from modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.eot rename to modules/themeconfigurator/views/css/font/museo_slab_300-webfont.eot diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.ttf b/modules/themeconfigurator/views/css/font/museo_slab_300-webfont.ttf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.ttf rename to modules/themeconfigurator/views/css/font/museo_slab_300-webfont.ttf diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.eot b/modules/themeconfigurator/views/css/font/museo_slab_500-webfont.eot similarity index 100% rename from modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.eot rename to modules/themeconfigurator/views/css/font/museo_slab_500-webfont.eot diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.ttf b/modules/themeconfigurator/views/css/font/museo_slab_500-webfont.ttf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.ttf rename to modules/themeconfigurator/views/css/font/museo_slab_500-webfont.ttf diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.eot b/modules/themeconfigurator/views/css/font/proximanova-sbold-webfont.eot similarity index 100% rename from modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.eot rename to modules/themeconfigurator/views/css/font/proximanova-sbold-webfont.eot diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.ttf b/modules/themeconfigurator/views/css/font/proximanova-sbold-webfont.ttf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.ttf rename to modules/themeconfigurator/views/css/font/proximanova-sbold-webfont.ttf diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-webfont.eot b/modules/themeconfigurator/views/css/font/proximanova-webfont.eot similarity index 100% rename from modules/tmhtmlcontent/views/css/font/proximanova-webfont.eot rename to modules/themeconfigurator/views/css/font/proximanova-webfont.eot diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-webfont.ttf b/modules/themeconfigurator/views/css/font/proximanova-webfont.ttf similarity index 100% rename from modules/tmhtmlcontent/views/css/font/proximanova-webfont.ttf rename to modules/themeconfigurator/views/css/font/proximanova-webfont.ttf diff --git a/modules/tmhtmlcontent/views/css/hooks.css b/modules/themeconfigurator/views/css/hooks.css similarity index 100% rename from modules/tmhtmlcontent/views/css/hooks.css rename to modules/themeconfigurator/views/css/hooks.css diff --git a/modules/tmhtmlcontent/views/js/admin.js b/modules/themeconfigurator/views/js/admin.js similarity index 100% rename from modules/tmhtmlcontent/views/js/admin.js rename to modules/themeconfigurator/views/js/admin.js diff --git a/modules/tmhtmlcontent/translations/index.php b/modules/themeconfigurator/views/js/index.php similarity index 100% rename from modules/tmhtmlcontent/translations/index.php rename to modules/themeconfigurator/views/js/index.php diff --git a/modules/tmhtmlcontent/views/templates/admin/admin.tpl b/modules/themeconfigurator/views/templates/admin/admin.tpl similarity index 84% rename from modules/tmhtmlcontent/views/templates/admin/admin.tpl rename to modules/themeconfigurator/views/templates/admin/admin.tpl index 5779a4a57..a57abe9e5 100644 --- a/modules/tmhtmlcontent/views/templates/admin/admin.tpl +++ b/modules/themeconfigurator/views/templates/admin/admin.tpl @@ -1,16 +1,13 @@

{$htmlcontent.info.name} (v.{$htmlcontent.info.version})

- - {if $error} + {if isset($error) && $error} {include file="{$htmlcontent.admin_tpl_path}messages.tpl" id="main" text=$error class='error'} {/if} - {if $confirmation} + {if isset($confirmation) && $confirmation} {include file="{$htmlcontent.admin_tpl_path}messages.tpl" id="main" text=$confirmation class='conf'} {/if} - {include file="{$htmlcontent.admin_tpl_path}new.tpl"} {include file="{$htmlcontent.admin_tpl_path}items.tpl"} - -
\ No newline at end of file + diff --git a/modules/tmhtmlcontent/views/index.php b/modules/themeconfigurator/views/templates/admin/index.php similarity index 100% rename from modules/tmhtmlcontent/views/index.php rename to modules/themeconfigurator/views/templates/admin/index.php diff --git a/modules/tmhtmlcontent/views/templates/admin/items.tpl b/modules/themeconfigurator/views/templates/admin/items.tpl similarity index 88% rename from modules/tmhtmlcontent/views/templates/admin/items.tpl rename to modules/themeconfigurator/views/templates/admin/items.tpl index da603ab09..8cd6e246f 100644 --- a/modules/tmhtmlcontent/views/templates/admin/items.tpl +++ b/modules/themeconfigurator/views/templates/admin/items.tpl @@ -9,7 +9,7 @@
{foreach name=hooks from=$langItems key=hook item=hookItems} -

{l s='Hook' mod='tmhtmlcontent'} "{$hook}"

+

{l s='Hook' mod='themeconfigurator'} "{$hook}"

{if $hookItems} {else}
- {l s='No items available' mod='tmhtmlcontent'} + {l s='No items available' mod='themeconfigurator'}
{/if} {/foreach} diff --git a/modules/tmhtmlcontent/views/templates/admin/messages.tpl b/modules/themeconfigurator/views/templates/admin/messages.tpl similarity index 100% rename from modules/tmhtmlcontent/views/templates/admin/messages.tpl rename to modules/themeconfigurator/views/templates/admin/messages.tpl diff --git a/modules/tmhtmlcontent/views/templates/admin/new.tpl b/modules/themeconfigurator/views/templates/admin/new.tpl similarity index 88% rename from modules/tmhtmlcontent/views/templates/admin/new.tpl rename to modules/themeconfigurator/views/templates/admin/new.tpl index 40e2a1c69..4d7c13e2d 100644 --- a/modules/tmhtmlcontent/views/templates/admin/new.tpl +++ b/modules/themeconfigurator/views/templates/admin/new.tpl @@ -1,12 +1,12 @@
- {l s='Add item' mod='tmhtmlcontent'} + {l s='Add item' mod='themeconfigurator'}
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
diff --git a/modules/tmhtmlcontent/views/templates/hooks/home.tpl b/modules/themeconfigurator/views/templates/hooks/hook.tpl similarity index 86% rename from modules/tmhtmlcontent/views/templates/hooks/home.tpl rename to modules/themeconfigurator/views/templates/hooks/hook.tpl index 285b07aea..cf76d7e05 100644 --- a/modules/tmhtmlcontent/views/templates/hooks/home.tpl +++ b/modules/themeconfigurator/views/templates/hooks/hook.tpl @@ -1,7 +1,7 @@ -{if isset($htmlitems.items) && $htmlitems.items} -
+{if isset($htmlitems) && $htmlitems} +
-{/if} diff --git a/modules/tmhtmlcontent/views/templates/hooks/left.tpl b/modules/tmhtmlcontent/views/templates/hooks/left.tpl deleted file mode 100644 index afc5afbb6..000000000 --- a/modules/tmhtmlcontent/views/templates/hooks/left.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{if isset($htmlitems.items) && $htmlitems.items} - -{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/hooks/right.tpl b/modules/tmhtmlcontent/views/templates/hooks/right.tpl deleted file mode 100644 index 6fe8b6c57..000000000 --- a/modules/tmhtmlcontent/views/templates/hooks/right.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{if isset($htmlitems.items) && $htmlitems.items} - -{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/hooks/top.tpl b/modules/tmhtmlcontent/views/templates/hooks/top.tpl deleted file mode 100644 index e9f9f958c..000000000 --- a/modules/tmhtmlcontent/views/templates/hooks/top.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{if isset($htmlitems.items) && $htmlitems.items} - -{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/index.php b/modules/tmhtmlcontent/views/templates/index.php deleted file mode 100644 index 198b35f62..000000000 --- a/modules/tmhtmlcontent/views/templates/index.php +++ /dev/null @@ -1,10 +0,0 @@ -