diff --git a/config/xml/themes/default.xml b/config/xml/themes/default.xml index 733bcc628..d830fb5ae 100644 --- a/config/xml/themes/default.xml +++ b/config/xml/themes/default.xml @@ -80,7 +80,6 @@ - diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 968503fc8..22929cb33 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -2126,7 +2126,6 @@ class AdminThemesControllerCore extends AdminController 'gapi', 'graphnvd3', 'gridhtml', - 'homeslider', 'loyalty', 'mailalerts', 'newsletter', diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 99e9f3284..998c0f0c7 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -680,18 +680,6 @@ 5 - - 535 - - - 1300 - - - 7700 - - - 1 - m diff --git a/modules/homeslider/CHANGELOG.txt b/modules/homeslider/CHANGELOG.txt deleted file mode 100644 index 4af6fce41..000000000 --- a/modules/homeslider/CHANGELOG.txt +++ /dev/null @@ -1,7 +0,0 @@ ------------------------------- -# V1.5.0 to V1.6.1 ------------------------------- - -## Improved/Changed Features: - -* [CO] : Updated with latest PS version - 1.6.1.23. diff --git a/modules/homeslider/HomeSlide.php b/modules/homeslider/HomeSlide.php deleted file mode 100644 index cd0220ca4..000000000 --- a/modules/homeslider/HomeSlide.php +++ /dev/null @@ -1,151 +0,0 @@ - -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -class HomeSlide extends ObjectModel -{ - public $title; - public $description; - public $url; - public $legend; - public $image; - public $active; - public $position; - public $id_shop; - - /** - * @see ObjectModel::$definition - */ - public static $definition = array( - 'table' => 'homeslider_slides', - 'primary' => 'id_homeslider_slides', - 'multilang' => true, - 'fields' => array( - 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), - 'position' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true), - - // Lang fields - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 4000), - 'title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => true, 'size' => 255), - 'legend' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => true, 'size' => 255), - 'url' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isUrl', 'required' => true, 'size' => 255), - 'image' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 255), - ) - ); - - public function __construct($id_slide = null, $id_lang = null, $id_shop = null, Context $context = null) - { - parent::__construct($id_slide, $id_lang, $id_shop); - } - - public function add($autodate = true, $null_values = false) - { - $context = Context::getContext(); - $id_shop = $context->shop->id; - - $res = parent::add($autodate, $null_values); - $res &= Db::getInstance()->execute(' - INSERT INTO `'._DB_PREFIX_.'homeslider` (`id_shop`, `id_homeslider_slides`) - VALUES('.(int)$id_shop.', '.(int)$this->id.')' - ); - return $res; - } - - public function delete() - { - $res = true; - - $images = $this->image; - foreach ($images as $image) - { - if (preg_match('/sample/', $image) === 0) - if ($image && file_exists(dirname(__FILE__).'/images/'.$image)) - $res &= @unlink(dirname(__FILE__).'/images/'.$image); - } - - $res &= $this->reOrderPositions(); - - $res &= Db::getInstance()->execute(' - DELETE FROM `'._DB_PREFIX_.'homeslider` - WHERE `id_homeslider_slides` = '.(int)$this->id - ); - - $res &= parent::delete(); - return $res; - } - - public function reOrderPositions() - { - $id_slide = $this->id; - $context = Context::getContext(); - $id_shop = $context->shop->id; - - $max = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT MAX(hss.`position`) as position - FROM `'._DB_PREFIX_.'homeslider_slides` hss, `'._DB_PREFIX_.'homeslider` hs - WHERE hss.`id_homeslider_slides` = hs.`id_homeslider_slides` AND hs.`id_shop` = '.(int)$id_shop - ); - - if ((int)$max == (int)$id_slide) - return true; - - $rows = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT hss.`position` as position, hss.`id_homeslider_slides` as id_slide - FROM `'._DB_PREFIX_.'homeslider_slides` hss - LEFT JOIN `'._DB_PREFIX_.'homeslider` hs ON (hss.`id_homeslider_slides` = hs.`id_homeslider_slides`) - WHERE hs.`id_shop` = '.(int)$id_shop.' AND hss.`position` > '.(int)$this->position - ); - - foreach ($rows as $row) - { - $current_slide = new HomeSlide($row['id_slide']); - --$current_slide->position; - $current_slide->update(); - unset($current_slide); - } - - return true; - } - - public static function getAssociatedIdsShop($id_slide) - { - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT hs.`id_shop` - FROM `'._DB_PREFIX_.'homeslider` hs - WHERE hs.`id_homeslider_slides` = '.(int)$id_slide - ); - - if (!is_array($result)) - return false; - - $return = array(); - - foreach ($result as $id_shop) - $return[] = (int)$id_shop['id_shop']; - - return $return; - } - -} diff --git a/modules/homeslider/ajax_homeslider.php b/modules/homeslider/ajax_homeslider.php deleted file mode 100644 index cce5161c8..000000000 --- a/modules/homeslider/ajax_homeslider.php +++ /dev/null @@ -1,47 +0,0 @@ - -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ -include_once('../../config/config.inc.php'); -include_once('../../init.php'); -include_once('homeslider.php'); - -$home_slider = new HomeSlider(); -$slides = array(); - -if (!Tools::isSubmit('secure_key') || Tools::getValue('secure_key') != $home_slider->secure_key || !Tools::getValue('action')) - die(1); - -if (Tools::getValue('action') == 'updateSlidesPosition' && Tools::getValue('slides')) -{ - $slides = Tools::getValue('slides'); - - foreach ($slides as $position => $id_slide) - $res = Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'homeslider_slides` SET `position` = '.(int)$position.' - WHERE `id_homeslider_slides` = '.(int)$id_slide - ); - - $home_slider->clearCache(); -} diff --git a/modules/homeslider/css/homeslider.css b/modules/homeslider/css/homeslider.css deleted file mode 100644 index b6be1ae01..000000000 --- a/modules/homeslider/css/homeslider.css +++ /dev/null @@ -1,91 +0,0 @@ -/* @override http://localhost/bxslider_v3_plugin/css/styles.css */ - -/* - * To change the color scheme of slider change each - * background property for each of the five styles below - */ -.bx-window {margin-bottom:20px;} -.bx-wrapper { - margin-bottom:20px; - height:300px -} -/*next button*/ -.bx-next { - display:none; - position:absolute; - top:40%; - right:-50px; - z-index:999; - width: 30px; - height: 30px; - text-indent: -999999px; - background: url(../img/gray_next.png) no-repeat 0 -30px; -} -/*previous button*/ -.bx-prev { - display:none; - position:absolute; - top:40%; - left:-50px; - z-index:999; - width: 30px; - height: 30px; - text-indent: -999999px; - background: url(../img/gray_prev.png) no-repeat 0 -30px; -} -/*pager links*/ -.bx-pager { - position: absolute; - bottom: 20px; - bottom:40px !ie;/* hack ie7 */ - right: 15px; - padding-top: 7px; - font-size:11px; - color:#666; - text-align:center; -} -.bx-pager a { - display:inline-block; - zoom:1; - margin-right: 5px; - padding:4px 0 0 1px; - height:16px;/* 19 */ - width:18px;/* 19 */ - font-weight:bold; - font-size: 11px; - color:#000; - text-decoration:none; - background:url(../img/gray_pager.png) no-repeat 0 -20px; -} - -/* - * End color scheme styles - */ -/*next/prev button hover state*/ -.bx-next:hover, -.bx-prev:hover { - background-position: 0 0; -} -/*pager links hover and active states*/ -.bx-pager .pager-active, -.bx-pager a:hover { - color:#fff; - text-decoration:none; - background-position: 0 0; -} -/*captions*/ -.bx-captions { - text-align:center; - font-size: 12px; - padding: 7px 0; - color: #666; -} -/*auto controls*/ -.bx-auto { - text-align: center; - padding-top: 15px; -} -.bx-auto a { - color: #666; - font-size: 12px; -} diff --git a/modules/homeslider/css/index.php b/modules/homeslider/css/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/css/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/homeslider.php b/modules/homeslider/homeslider.php deleted file mode 100644 index 6714aaf69..000000000 --- a/modules/homeslider/homeslider.php +++ /dev/null @@ -1,1078 +0,0 @@ - -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -/** - * @since 1.5.0 - */ - -if (!defined('_PS_VERSION_')) - exit; - -include_once(_PS_MODULE_DIR_.'homeslider/HomeSlide.php'); - -class HomeSlider extends Module -{ - protected $_html = ''; - protected $default_width = 779; - protected $default_speed = 500; - protected $default_pause = 3000; - protected $default_loop = 1; - - public function __construct() - { - $this->name = 'homeslider'; - $this->tab = 'front_office_features'; - $this->version = '1.6.1'; - $this->author = 'PrestaShop'; - $this->need_instance = 0; - $this->secure_key = Tools::encrypt($this->name); - $this->bootstrap = true; - - parent::__construct(); - - $this->displayName = $this->l('Image slider for your homepage'); - $this->description = $this->l('Adds an image slider to your homepage.'); - $this->ps_versions_compliancy = array('min' => '1.6.0.4', 'max' => '1.6.99.99'); - } - - /** - * @see Module::install() - */ - public function install() - { - /* Adds Module */ - if (parent::install() && - $this->registerHook('displayHeader') && - $this->registerHook('displayTopColumn') && - $this->registerHook('actionShopDataDuplication') - ) - { - $shops = Shop::getContextListShopID(); - $shop_groups_list = array(); - - /* Setup each shop */ - foreach ($shops as $shop_id) - { - $shop_group_id = (int)Shop::getGroupFromShop($shop_id, true); - - if (!in_array($shop_group_id, $shop_groups_list)) - $shop_groups_list[] = $shop_group_id; - - /* Sets up configuration */ - $res = Configuration::updateValue('HOMESLIDER_WIDTH', $this->default_width, false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', $this->default_speed, false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', $this->default_pause, false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', $this->default_loop, false, $shop_group_id, $shop_id); - } - - /* Sets up Shop Group configuration */ - if (count($shop_groups_list)) - { - foreach ($shop_groups_list as $shop_group_id) - { - $res = Configuration::updateValue('HOMESLIDER_WIDTH', $this->default_width, false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', $this->default_speed, false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', $this->default_pause, false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', $this->default_loop, false, $shop_group_id); - } - } - - /* Sets up Global configuration */ - $res = Configuration::updateValue('HOMESLIDER_WIDTH', $this->default_width); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', $this->default_speed); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', $this->default_pause); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', $this->default_loop); - - /* Creates tables */ - $res &= $this->createTables(); - - /* Adds samples */ - if ($res) - $this->installSamples(); - - // Disable on mobiles and tablets - $this->disableDevice(Context::DEVICE_MOBILE); - - return (bool)$res; - } - - return false; - } - - /** - * Adds samples - */ - protected function installSamples() - { - $languages = Language::getLanguages(false); - for ($i = 1; $i <= 3; ++$i) - { - $slide = new HomeSlide(); - $slide->position = $i; - $slide->active = 1; - foreach ($languages as $language) - { - $slide->title[$language['id_lang']] = 'Sample '.$i; - $slide->description[$language['id_lang']] = '

EXCEPTEUR
OCCAECAT

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tristique in tortor et dignissim. Quisque non tempor leo. Maecenas egestas sem elit

-

'; - $slide->legend[$language['id_lang']] = 'sample-'.$i; - $slide->url[$language['id_lang']] = 'http://www.prestashop.com/?utm_source=back-office&utm_medium=v16_homeslider' - .'&utm_campaign=back-office-'.Tools::strtoupper($this->context->language->iso_code) - .'&utm_content='.(defined('_PS_HOST_MODE_') ? 'ondemand' : 'download'); - $slide->image[$language['id_lang']] = 'sample-'.$i.'.jpg'; - } - $slide->add(); - } - } - - /** - * @see Module::uninstall() - */ - public function uninstall() - { - /* Deletes Module */ - if (parent::uninstall()) - { - /* Deletes tables */ - $res = $this->deleteTables(); - - /* Unsets configuration */ - $res &= Configuration::deleteByName('HOMESLIDER_WIDTH'); - $res &= Configuration::deleteByName('HOMESLIDER_SPEED'); - $res &= Configuration::deleteByName('HOMESLIDER_PAUSE'); - $res &= Configuration::deleteByName('HOMESLIDER_LOOP'); - - return (bool)$res; - } - - return false; - } - - /** - * Creates tables - */ - protected function createTables() - { - /* Slides */ - $res = (bool)Db::getInstance()->execute(' - CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'homeslider` ( - `id_homeslider_slides` int(10) unsigned NOT NULL AUTO_INCREMENT, - `id_shop` int(10) unsigned NOT NULL, - PRIMARY KEY (`id_homeslider_slides`, `id_shop`) - ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8; - '); - - /* Slides configuration */ - $res &= Db::getInstance()->execute(' - CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'homeslider_slides` ( - `id_homeslider_slides` int(10) unsigned NOT NULL AUTO_INCREMENT, - `position` int(10) unsigned NOT NULL DEFAULT \'0\', - `active` tinyint(1) unsigned NOT NULL DEFAULT \'0\', - PRIMARY KEY (`id_homeslider_slides`) - ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8; - '); - - /* Slides lang configuration */ - $res &= Db::getInstance()->execute(' - CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'homeslider_slides_lang` ( - `id_homeslider_slides` int(10) unsigned NOT NULL, - `id_lang` int(10) unsigned NOT NULL, - `title` varchar(255) NOT NULL, - `description` text NOT NULL, - `legend` varchar(255) NOT NULL, - `url` varchar(255) NOT NULL, - `image` varchar(255) NOT NULL, - PRIMARY KEY (`id_homeslider_slides`,`id_lang`) - ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8; - '); - - return $res; - } - - /** - * deletes tables - */ - protected function deleteTables() - { - $slides = $this->getSlides(); - foreach ($slides as $slide) - { - $to_del = new HomeSlide($slide['id_slide']); - $to_del->delete(); - } - - return Db::getInstance()->execute(' - DROP TABLE IF EXISTS `'._DB_PREFIX_.'homeslider`, `'._DB_PREFIX_.'homeslider_slides`, `'._DB_PREFIX_.'homeslider_slides_lang`; - '); - } - - public function getContent() - { - $this->_html .= $this->headerHTML(); - - /* Validate & process */ - if (Tools::isSubmit('submitSlide') || Tools::isSubmit('delete_id_slide') || - Tools::isSubmit('submitSlider') || - Tools::isSubmit('changeStatus') - ) - { - if ($this->_postValidation()) - { - $this->_postProcess(); - $this->_html .= $this->renderForm(); - $this->_html .= $this->renderList(); - } - else - $this->_html .= $this->renderAddForm(); - - $this->clearCache(); - } - elseif (Tools::isSubmit('addSlide') || (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide')))) - { - if (Tools::isSubmit('addSlide')) - $mode = 'add'; - else - $mode = 'edit'; - - if ($mode == 'add') - { - if (Shop::getContext() != Shop::CONTEXT_GROUP && Shop::getContext() != Shop::CONTEXT_ALL) - $this->_html .= $this->renderAddForm(); - else - $this->_html .= $this->getShopContextError(null, $mode); - } - else - { - $associated_shop_ids = HomeSlide::getAssociatedIdsShop((int)Tools::getValue('id_slide')); - $context_shop_id = (int)Shop::getContextShopID(); - - if ($associated_shop_ids === false) - $this->_html .= $this->getShopAssociationError((int)Tools::getValue('id_slide')); - else if (Shop::getContext() != Shop::CONTEXT_GROUP && Shop::getContext() != Shop::CONTEXT_ALL && in_array($context_shop_id, $associated_shop_ids)) - { - if (count($associated_shop_ids) > 1) - $this->_html = $this->getSharedSlideWarning(); - $this->_html .= $this->renderAddForm(); - } - else - { - $shops_name_list = array(); - foreach ($associated_shop_ids as $shop_id) - { - $associated_shop = new Shop((int)$shop_id); - $shops_name_list[] = $associated_shop->name; - } - $this->_html .= $this->getShopContextError($shops_name_list, $mode); - } - } - } - else // Default viewport - { - $this->_html .= $this->getWarningMultishopHtml().$this->getCurrentShopInfoMsg().$this->renderForm(); - - if (Shop::getContext() != Shop::CONTEXT_GROUP && Shop::getContext() != Shop::CONTEXT_ALL) - $this->_html .= $this->renderList(); - } - - return $this->_html; - } - - protected function _postValidation() - { - $errors = array(); - - /* Validation for Slider configuration */ - if (Tools::isSubmit('submitSlider')) - { - - if (!Validate::isInt(Tools::getValue('HOMESLIDER_SPEED')) || !Validate::isInt(Tools::getValue('HOMESLIDER_PAUSE')) || - !Validate::isInt(Tools::getValue('HOMESLIDER_WIDTH')) - ) - $errors[] = $this->l('Invalid values'); - } /* Validation for status */ - elseif (Tools::isSubmit('changeStatus')) - { - if (!Validate::isInt(Tools::getValue('id_slide'))) - $errors[] = $this->l('Invalid slide'); - } - /* Validation for Slide */ - elseif (Tools::isSubmit('submitSlide')) - { - /* Checks state (active) */ - if (!Validate::isInt(Tools::getValue('active_slide')) || (Tools::getValue('active_slide') != 0 && Tools::getValue('active_slide') != 1)) - $errors[] = $this->l('Invalid slide state.'); - /* Checks position */ - if (!Validate::isInt(Tools::getValue('position')) || (Tools::getValue('position') < 0)) - $errors[] = $this->l('Invalid slide position.'); - /* If edit : checks id_slide */ - if (Tools::isSubmit('id_slide')) - { - - //d(var_dump(Tools::getValue('id_slide'))); - if (!Validate::isInt(Tools::getValue('id_slide')) && !$this->slideExists(Tools::getValue('id_slide'))) - $errors[] = $this->l('Invalid slide ID'); - } - /* Checks title/url/legend/description/image */ - $languages = Language::getLanguages(false); - foreach ($languages as $language) - { - if (Tools::strlen(Tools::getValue('title_'.$language['id_lang'])) > 255) - $errors[] = $this->l('The title is too long.'); - if (Tools::strlen(Tools::getValue('legend_'.$language['id_lang'])) > 255) - $errors[] = $this->l('The caption is too long.'); - if (Tools::strlen(Tools::getValue('url_'.$language['id_lang'])) > 255) - $errors[] = $this->l('The URL is too long.'); - if (Tools::strlen(Tools::getValue('description_'.$language['id_lang'])) > 4000) - $errors[] = $this->l('The description is too long.'); - if (Tools::strlen(Tools::getValue('url_'.$language['id_lang'])) > 0 && !Validate::isUrl(Tools::getValue('url_'.$language['id_lang']))) - $errors[] = $this->l('The URL format is not correct.'); - if (Tools::getValue('image_'.$language['id_lang']) != null && !Validate::isFileName(Tools::getValue('image_'.$language['id_lang']))) - $errors[] = $this->l('Invalid filename.'); - if (Tools::getValue('image_old_'.$language['id_lang']) != null && !Validate::isFileName(Tools::getValue('image_old_'.$language['id_lang']))) - $errors[] = $this->l('Invalid filename.'); - } - - /* Checks title/url/legend/description for default lang */ - $id_lang_default = (int)Configuration::get('PS_LANG_DEFAULT'); - if (Tools::strlen(Tools::getValue('title_'.$id_lang_default)) == 0) - $errors[] = $this->l('The title is not set.'); - if (Tools::strlen(Tools::getValue('legend_'.$id_lang_default)) == 0) - $errors[] = $this->l('The caption is not set.'); - if (Tools::strlen(Tools::getValue('url_'.$id_lang_default)) == 0) - $errors[] = $this->l('The URL is not set.'); - if (!Tools::isSubmit('has_picture') && (!isset($_FILES['image_'.$id_lang_default]) || empty($_FILES['image_'.$id_lang_default]['tmp_name']))) - $errors[] = $this->l('The image is not set.'); - if (Tools::getValue('image_old_'.$id_lang_default) && !Validate::isFileName(Tools::getValue('image_old_'.$id_lang_default))) - $errors[] = $this->l('The image is not set.'); - } /* Validation for deletion */ - elseif (Tools::isSubmit('delete_id_slide') && (!Validate::isInt(Tools::getValue('delete_id_slide')) || !$this->slideExists((int)Tools::getValue('delete_id_slide')))) - $errors[] = $this->l('Invalid slide ID'); - - /* Display errors if needed */ - if (count($errors)) - { - $this->_html .= $this->displayError(implode('
', $errors)); - - return false; - } - - /* Returns if validation is ok */ - - return true; - } - - protected function _postProcess() - { - $errors = array(); - $shop_context = Shop::getContext(); - - /* Processes Slider */ - if (Tools::isSubmit('submitSlider')) - { - $shop_groups_list = array(); - $shops = Shop::getContextListShopID(); - - foreach ($shops as $shop_id) - { - $shop_group_id = (int)Shop::getGroupFromShop($shop_id, true); - - if (!in_array($shop_group_id, $shop_groups_list)) - $shop_groups_list[] = $shop_group_id; - - $res = Configuration::updateValue('HOMESLIDER_WIDTH', (int)Tools::getValue('HOMESLIDER_WIDTH'), false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', (int)Tools::getValue('HOMESLIDER_SPEED'), false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', (int)Tools::getValue('HOMESLIDER_PAUSE'), false, $shop_group_id, $shop_id); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', (int)Tools::getValue('HOMESLIDER_LOOP'), false, $shop_group_id, $shop_id); - } - - /* Update global shop context if needed*/ - switch ($shop_context) - { - case Shop::CONTEXT_ALL: - $res = Configuration::updateValue('HOMESLIDER_WIDTH', (int)Tools::getValue('HOMESLIDER_WIDTH')); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', (int)Tools::getValue('HOMESLIDER_SPEED')); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', (int)Tools::getValue('HOMESLIDER_PAUSE')); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', (int)Tools::getValue('HOMESLIDER_LOOP')); - if (count($shop_groups_list)) - { - foreach ($shop_groups_list as $shop_group_id) - { - $res = Configuration::updateValue('HOMESLIDER_WIDTH', (int)Tools::getValue('HOMESLIDER_WIDTH'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', (int)Tools::getValue('HOMESLIDER_SPEED'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', (int)Tools::getValue('HOMESLIDER_PAUSE'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', (int)Tools::getValue('HOMESLIDER_LOOP'), false, $shop_group_id); - } - } - break; - case Shop::CONTEXT_GROUP: - if (count($shop_groups_list)) - { - foreach ($shop_groups_list as $shop_group_id) - { - $res = Configuration::updateValue('HOMESLIDER_WIDTH', (int)Tools::getValue('HOMESLIDER_WIDTH'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_SPEED', (int)Tools::getValue('HOMESLIDER_SPEED'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_PAUSE', (int)Tools::getValue('HOMESLIDER_PAUSE'), false, $shop_group_id); - $res &= Configuration::updateValue('HOMESLIDER_LOOP', (int)Tools::getValue('HOMESLIDER_LOOP'), false, $shop_group_id); - } - } - break; - } - - $this->clearCache(); - - 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); - } /* Process Slide status */ - elseif (Tools::isSubmit('changeStatus') && Tools::isSubmit('id_slide')) - { - $slide = new HomeSlide((int)Tools::getValue('id_slide')); - if ($slide->active == 0) - $slide->active = 1; - else - $slide->active = 0; - $res = $slide->update(); - $this->clearCache(); - $this->_html .= ($res ? $this->displayConfirmation($this->l('Configuration updated')) : $this->displayError($this->l('The configuration could not be updated.'))); - } - /* Processes Slide */ - elseif (Tools::isSubmit('submitSlide')) - { - /* Sets ID if needed */ - if (Tools::getValue('id_slide')) - { - $slide = new HomeSlide((int)Tools::getValue('id_slide')); - if (!Validate::isLoadedObject($slide)) - { - $this->_html .= $this->displayError($this->l('Invalid slide ID')); - return false; - } - } - else - $slide = new HomeSlide(); - /* Sets position */ - $slide->position = (int)Tools::getValue('position'); - /* Sets active */ - $slide->active = (int)Tools::getValue('active_slide'); - - /* Sets each langue fields */ - $languages = Language::getLanguages(false); - - foreach ($languages as $language) - { - $slide->title[$language['id_lang']] = Tools::getValue('title_'.$language['id_lang']); - $slide->url[$language['id_lang']] = Tools::getValue('url_'.$language['id_lang']); - $slide->legend[$language['id_lang']] = Tools::getValue('legend_'.$language['id_lang']); - $slide->description[$language['id_lang']] = Tools::getValue('description_'.$language['id_lang']); - - /* Uploads image and sets slide */ - $type = Tools::strtolower(Tools::substr(strrchr($_FILES['image_'.$language['id_lang']]['name'], '.'), 1)); - $imagesize = @getimagesize($_FILES['image_'.$language['id_lang']]['tmp_name']); - if (isset($_FILES['image_'.$language['id_lang']]) && - isset($_FILES['image_'.$language['id_lang']]['tmp_name']) && - !empty($_FILES['image_'.$language['id_lang']]['tmp_name']) && - !empty($imagesize) && - in_array( - Tools::strtolower(Tools::substr(strrchr($imagesize['mime'], '/'), 1)), array( - 'jpg', - 'gif', - 'jpeg', - 'png' - ) - ) && - in_array($type, array('jpg', 'gif', 'jpeg', 'png')) - ) - { - $temp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS'); - $salt = sha1(microtime()); - if ($error = ImageManager::validateUpload($_FILES['image_'.$language['id_lang']])) - $errors[] = $error; - elseif (!$temp_name || !move_uploaded_file($_FILES['image_'.$language['id_lang']]['tmp_name'], $temp_name)) - return false; - elseif (!ImageManager::resize($temp_name, dirname(__FILE__).'/images/'.$salt.'_'.$_FILES['image_'.$language['id_lang']]['name'], null, null, $type)) - $errors[] = $this->displayError($this->l('An error occurred during the image upload process.')); - if (isset($temp_name)) - @unlink($temp_name); - $slide->image[$language['id_lang']] = $salt.'_'.$_FILES['image_'.$language['id_lang']]['name']; - } - elseif (Tools::getValue('image_old_'.$language['id_lang']) != '') - $slide->image[$language['id_lang']] = Tools::getValue('image_old_'.$language['id_lang']); - } - - /* Processes if no errors */ - if (!$errors) - { - /* Adds */ - if (!Tools::getValue('id_slide')) - { - if (!$slide->add()) - $errors[] = $this->displayError($this->l('The slide could not be added.')); - } - /* Update */ - elseif (!$slide->update()) - $errors[] = $this->displayError($this->l('The slide could not be updated.')); - $this->clearCache(); - } - } /* Deletes */ - elseif (Tools::isSubmit('delete_id_slide')) - { - $slide = new HomeSlide((int)Tools::getValue('delete_id_slide')); - $res = $slide->delete(); - $this->clearCache(); - if (!$res) - $this->_html .= $this->displayError('Could not delete.'); - else - Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true).'&conf=1&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name); - } - - /* Display errors if needed */ - if (count($errors)) - $this->_html .= $this->displayError(implode('
', $errors)); - elseif (Tools::isSubmit('submitSlide') && Tools::getValue('id_slide')) - Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true).'&conf=4&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name); - elseif (Tools::isSubmit('submitSlide')) - Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true).'&conf=3&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name); - } - - protected function _prepareHook() - { - if (!$this->isCached('homeslider.tpl', $this->getCacheId())) - { - $slides = $this->getSlides(true); - if (is_array($slides)) - foreach ($slides as &$slide) - { - $slide['sizes'] = @getimagesize((dirname(__FILE__).DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.$slide['image'])); - if (isset($slide['sizes'][3]) && $slide['sizes'][3]) - $slide['size'] = $slide['sizes'][3]; - } - - if (!$slides) - return false; - - $this->smarty->assign(array('homeslider_slides' => $slides)); - } - - return true; - } - - public function hookdisplayHeader($params) - { - if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') - return; - $this->context->controller->addCSS($this->_path.'homeslider.css'); - $this->context->controller->addJS($this->_path.'js/homeslider.js'); - $this->context->controller->addJqueryPlugin(array('bxslider')); - - $config = $this->getConfigFieldsValues(); - $slider = array( - 'width' => $config['HOMESLIDER_WIDTH'], - 'speed' => $config['HOMESLIDER_SPEED'], - 'pause' => $config['HOMESLIDER_PAUSE'], - 'loop' => (bool)$config['HOMESLIDER_LOOP'], - ); - - $this->smarty->assign('homeslider', $slider); - return $this->display(__FILE__, 'header.tpl'); - } - - public function hookdisplayTop($params) - { - return $this->hookdisplayTopColumn($params); - } - - public function hookdisplayTopColumn($params) - { - if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') - return; - - if (!$this->_prepareHook()) - return false; - - return $this->display(__FILE__, 'homeslider.tpl', $this->getCacheId()); - } - - public function hookDisplayHome() - { - if (!$this->_prepareHook()) - return false; - - return $this->display(__FILE__, 'homeslider.tpl', $this->getCacheId()); - } - - public function clearCache() - { - $this->_clearCache('homeslider.tpl'); - } - - public function hookActionShopDataDuplication($params) - { - Db::getInstance()->execute(' - INSERT IGNORE INTO '._DB_PREFIX_.'homeslider (id_homeslider_slides, id_shop) - SELECT id_homeslider_slides, '.(int)$params['new_id_shop'].' - FROM '._DB_PREFIX_.'homeslider - WHERE id_shop = '.(int)$params['old_id_shop'] - ); - $this->clearCache(); - } - - public function headerHTML() - { - if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name) - return; - - $this->context->controller->addJqueryUI('ui.sortable'); - /* Style & js for fieldset 'slides configuration' */ - $html = ''; - - return $html; - } - - public function getNextPosition() - { - $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' - SELECT MAX(hss.`position`) AS `next_position` - FROM `'._DB_PREFIX_.'homeslider_slides` hss, `'._DB_PREFIX_.'homeslider` hs - WHERE hss.`id_homeslider_slides` = hs.`id_homeslider_slides` AND hs.`id_shop` = '.(int)$this->context->shop->id - ); - - return (++$row['next_position']); - } - - public function getSlides($active = null) - { - $this->context = Context::getContext(); - $id_shop = $this->context->shop->id; - $id_lang = $this->context->language->id; - - return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT hs.`id_homeslider_slides` as id_slide, hss.`position`, hss.`active`, hssl.`title`, - hssl.`url`, hssl.`legend`, hssl.`description`, hssl.`image` - FROM '._DB_PREFIX_.'homeslider hs - LEFT JOIN '._DB_PREFIX_.'homeslider_slides hss ON (hs.id_homeslider_slides = hss.id_homeslider_slides) - LEFT JOIN '._DB_PREFIX_.'homeslider_slides_lang hssl ON (hss.id_homeslider_slides = hssl.id_homeslider_slides) - WHERE id_shop = '.(int)$id_shop.' - AND hssl.id_lang = '.(int)$id_lang. - ($active ? ' AND hss.`active` = 1' : ' ').' - ORDER BY hss.position' - ); - } - - public function getAllImagesBySlidesId($id_slides, $active = null, $id_shop = null) - { - $this->context = Context::getContext(); - $images = array(); - - if (!isset($id_shop)) - $id_shop = $this->context->shop->id; - - $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT hssl.`image`, hssl.`id_lang` - FROM '._DB_PREFIX_.'homeslider hs - LEFT JOIN '._DB_PREFIX_.'homeslider_slides hss ON (hs.id_homeslider_slides = hss.id_homeslider_slides) - LEFT JOIN '._DB_PREFIX_.'homeslider_slides_lang hssl ON (hss.id_homeslider_slides = hssl.id_homeslider_slides) - WHERE hs.`id_homeslider_slides` = '.(int)$id_slides.' AND hs.`id_shop` = '.(int)$id_shop. - ($active ? ' AND hss.`active` = 1' : ' ') - ); - - foreach ($results as $result) - $images[$result['id_lang']] = $result['image']; - - return $images; - } - - public function displayStatus($id_slide, $active) - { - $title = ((int)$active == 0 ? $this->l('Disabled') : $this->l('Enabled')); - $icon = ((int)$active == 0 ? 'icon-remove' : 'icon-check'); - $class = ((int)$active == 0 ? 'btn-danger' : 'btn-success'); - $html = ' '.$title.''; - - return $html; - } - - public function slideExists($id_slide) - { - $req = 'SELECT hs.`id_homeslider_slides` as id_slide - FROM `'._DB_PREFIX_.'homeslider` hs - WHERE hs.`id_homeslider_slides` = '.(int)$id_slide; - $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($req); - - return ($row); - } - - public function renderList() - { - $slides = $this->getSlides(); - foreach ($slides as $key => $slide) - { - $slides[$key]['status'] = $this->displayStatus($slide['id_slide'], $slide['active']); - $associated_shop_ids = HomeSlide::getAssociatedIdsShop((int)$slide['id_slide']); - if ($associated_shop_ids && count($associated_shop_ids) > 1) - $slides[$key]['is_shared'] = true; - else - $slides[$key]['is_shared'] = false; - } - - $this->context->smarty->assign( - array( - 'link' => $this->context->link, - 'slides' => $slides, - 'image_baseurl' => $this->_path.'images/' - ) - ); - - return $this->display(__FILE__, 'list.tpl'); - } - - public function renderAddForm() - { - $fields_form = array( - 'form' => array( - 'legend' => array( - 'title' => $this->l('Slide information'), - 'icon' => 'icon-cogs' - ), - 'input' => array( - array( - 'type' => 'file_lang', - 'label' => $this->l('Select a file'), - 'name' => 'image', - 'required' => true, - 'lang' => true, - 'desc' => sprintf($this->l('Maximum image size: %s.'), ini_get('upload_max_filesize')) - ), - array( - 'type' => 'text', - 'label' => $this->l('Slide title'), - 'name' => 'title', - 'required' => true, - 'lang' => true, - ), - array( - 'type' => 'text', - 'label' => $this->l('Target URL'), - 'name' => 'url', - 'required' => true, - 'lang' => true, - ), - array( - 'type' => 'text', - 'label' => $this->l('Caption'), - 'name' => 'legend', - 'required' => true, - 'lang' => true, - ), - array( - 'type' => 'textarea', - 'label' => $this->l('Description'), - 'name' => 'description', - 'autoload_rte' => true, - 'lang' => true, - ), - array( - 'type' => 'switch', - 'label' => $this->l('Enabled'), - 'name' => 'active_slide', - 'is_bool' => true, - 'values' => array( - array( - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->l('Yes') - ), - array( - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->l('No') - ) - ), - ), - ), - 'submit' => array( - 'title' => $this->l('Save'), - ) - ), - ); - - if (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide'))) - { - $slide = new HomeSlide((int)Tools::getValue('id_slide')); - $fields_form['form']['input'][] = array('type' => 'hidden', 'name' => 'id_slide'); - $fields_form['form']['images'] = $slide->image; - - $has_picture = true; - - foreach (Language::getLanguages(false) as $lang) - if (!isset($slide->image[$lang['id_lang']])) - $has_picture &= false; - - if ($has_picture) - $fields_form['form']['input'][] = array('type' => 'hidden', 'name' => 'has_picture'); - } - - $helper = new HelperForm(); - $helper->show_toolbar = false; - $helper->table = $this->table; - $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); - $helper->default_form_language = $lang->id; - $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; - $this->fields_form = array(); - $helper->module = $this; - $helper->identifier = $this->identifier; - $helper->submit_action = 'submitSlide'; - $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; - $helper->token = Tools::getAdminTokenLite('AdminModules'); - $language = new Language((int)Configuration::get('PS_LANG_DEFAULT')); - $helper->tpl_vars = array( - 'base_url' => $this->context->shop->getBaseURL(), - 'language' => array( - 'id_lang' => $language->id, - 'iso_code' => $language->iso_code - ), - 'fields_value' => $this->getAddFieldsValues(), - 'languages' => $this->context->controller->getLanguages(), - 'id_language' => $this->context->language->id, - 'image_baseurl' => $this->_path.'images/' - ); - - $helper->override_folder = '/'; - - $languages = Language::getLanguages(false); - - if (count($languages) > 1) - return $this->getMultiLanguageInfoMsg().$helper->generateForm(array($fields_form)); - else - return $helper->generateForm(array($fields_form)); - } - - public function renderForm() - { - $fields_form = array( - 'form' => array( - 'legend' => array( - 'title' => $this->l('Settings'), - 'icon' => 'icon-cogs' - ), - 'input' => array( - array( - 'type' => 'text', - 'label' => $this->l('Maximum image width'), - 'name' => 'HOMESLIDER_WIDTH', - 'suffix' => 'pixels' - ), - array( - 'type' => 'text', - 'label' => $this->l('Speed'), - 'name' => 'HOMESLIDER_SPEED', - 'suffix' => 'milliseconds', - 'desc' => $this->l('The duration of the transition between two slides.') - ), - array( - 'type' => 'text', - 'label' => $this->l('Pause'), - 'name' => 'HOMESLIDER_PAUSE', - 'suffix' => 'milliseconds', - 'desc' => $this->l('The delay between two slides.') - ), - array( - 'type' => 'switch', - 'label' => $this->l('Auto play'), - 'name' => 'HOMESLIDER_LOOP', - 'values' => array( - array( - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->l('Enabled') - ), - array( - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->l('Disabled') - ) - ), - ) - ), - 'submit' => array( - 'title' => $this->l('Save'), - ) - ), - ); - - $helper = new HelperForm(); - $helper->show_toolbar = false; - $helper->table = $this->table; - $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); - $helper->default_form_language = $lang->id; - $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; - $this->fields_form = array(); - - $helper->identifier = $this->identifier; - $helper->submit_action = 'submitSlider'; - $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(), - 'languages' => $this->context->controller->getLanguages(), - 'id_language' => $this->context->language->id - ); - - return $helper->generateForm(array($fields_form)); - } - - public function getConfigFieldsValues() - { - $id_shop_group = Shop::getContextShopGroupID(); - $id_shop = Shop::getContextShopID(); - - return array( - 'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', Configuration::get('HOMESLIDER_WIDTH', null, $id_shop_group, $id_shop)), - 'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', Configuration::get('HOMESLIDER_SPEED', null, $id_shop_group, $id_shop)), - 'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', Configuration::get('HOMESLIDER_PAUSE', null, $id_shop_group, $id_shop)), - 'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', Configuration::get('HOMESLIDER_LOOP', null, $id_shop_group, $id_shop)), - ); - } - - public function getAddFieldsValues() - { - $fields = array(); - - if (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide'))) - { - $slide = new HomeSlide((int)Tools::getValue('id_slide')); - $fields['id_slide'] = (int)Tools::getValue('id_slide', $slide->id); - } - else - $slide = new HomeSlide(); - - $fields['active_slide'] = Tools::getValue('active_slide', $slide->active); - $fields['has_picture'] = true; - - $languages = Language::getLanguages(false); - - foreach ($languages as $lang) - { - $fields['image'][$lang['id_lang']] = Tools::getValue('image_'.(int)$lang['id_lang']); - $fields['title'][$lang['id_lang']] = Tools::getValue('title_'.(int)$lang['id_lang'], $slide->title[$lang['id_lang']]); - $fields['url'][$lang['id_lang']] = Tools::getValue('url_'.(int)$lang['id_lang'], $slide->url[$lang['id_lang']]); - $fields['legend'][$lang['id_lang']] = Tools::getValue('legend_'.(int)$lang['id_lang'], $slide->legend[$lang['id_lang']]); - $fields['description'][$lang['id_lang']] = Tools::getValue('description_'.(int)$lang['id_lang'], $slide->description[$lang['id_lang']]); - } - - return $fields; - } - - protected function getMultiLanguageInfoMsg() - { - return '

'. - $this->l('Since multiple languages are activated on your shop, please mind to upload your image for each one of them'). - '

'; - } - - protected function getWarningMultishopHtml() - { - if (Shop::getContext() == Shop::CONTEXT_GROUP || Shop::getContext() == Shop::CONTEXT_ALL) - return '

'. - $this->l('You cannot manage slides items from a "All Shops" or a "Group Shop" context, select directly the shop you want to edit'). - '

'; - else - return ''; - } - - protected function getShopContextError($shop_contextualized_name, $mode) - { - if (is_array($shop_contextualized_name)) - $shop_contextualized_name = implode('
', $shop_contextualized_name); - - if ($mode == 'edit') - return '

'. - sprintf($this->l('You can only edit this slide from the shop(s) context: %s'), $shop_contextualized_name). - '

'; - else - return '

'. - sprintf($this->l('You cannot add slides from a "All Shops" or a "Group Shop" context')). - '

'; - } - - protected function getShopAssociationError($id_slide) - { - return '

'. - sprintf($this->l('Unable to get slide shop association information (id_slide: %d)'), (int)$id_slide). - '

'; - } - - - protected function getCurrentShopInfoMsg() - { - $shop_info = null; - - if (Shop::isFeatureActive()) - { - if (Shop::getContext() == Shop::CONTEXT_SHOP) - $shop_info = sprintf($this->l('The modifications will be applied to shop: %s'), $this->context->shop->name); - else if (Shop::getContext() == Shop::CONTEXT_GROUP) - $shop_info = sprintf($this->l('The modifications will be applied to this group: %s'), Shop::getContextShopGroup()->name); - else - $shop_info = $this->l('The modifications will be applied to all shops and shop groups'); - - return '
'. - $shop_info. - '
'; - } - else - return ''; - } - - protected function getSharedSlideWarning() - { - return '

'. - $this->l('This slide is shared with other shops! All shops associated to this slide will apply modifications made here'). - '

'; - } -} diff --git a/modules/homeslider/images/gray_next.png b/modules/homeslider/images/gray_next.png deleted file mode 100644 index 3552a60d5..000000000 Binary files a/modules/homeslider/images/gray_next.png and /dev/null differ diff --git a/modules/homeslider/images/gray_pager.png b/modules/homeslider/images/gray_pager.png deleted file mode 100644 index 9c3054d2a..000000000 Binary files a/modules/homeslider/images/gray_pager.png and /dev/null differ diff --git a/modules/homeslider/images/gray_prev.png b/modules/homeslider/images/gray_prev.png deleted file mode 100644 index 743d69785..000000000 Binary files a/modules/homeslider/images/gray_prev.png and /dev/null differ diff --git a/modules/homeslider/images/index.php b/modules/homeslider/images/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/images/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/images/sample-1.jpg b/modules/homeslider/images/sample-1.jpg deleted file mode 100644 index a4553a626..000000000 Binary files a/modules/homeslider/images/sample-1.jpg and /dev/null differ diff --git a/modules/homeslider/images/sample-2.jpg b/modules/homeslider/images/sample-2.jpg deleted file mode 100644 index ecc8ed0b3..000000000 Binary files a/modules/homeslider/images/sample-2.jpg and /dev/null differ diff --git a/modules/homeslider/images/sample-3.jpg b/modules/homeslider/images/sample-3.jpg deleted file mode 100644 index 5f73e00b3..000000000 Binary files a/modules/homeslider/images/sample-3.jpg and /dev/null differ diff --git a/modules/homeslider/index.php b/modules/homeslider/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/js/homeslider.js b/modules/homeslider/js/homeslider.js deleted file mode 100644 index e6477825c..000000000 --- a/modules/homeslider/js/homeslider.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -* 2007-2016 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -$(document).ready(function(){ - - if (typeof(homeslider_speed) == 'undefined') - homeslider_speed = 500; - if (typeof(homeslider_pause) == 'undefined') - homeslider_pause = 3000; - if (typeof(homeslider_loop) == 'undefined') - homeslider_loop = true; - if (typeof(homeslider_width) == 'undefined') - homeslider_width = 779; - - - if (!!$.prototype.bxSlider) - $('#homeslider').bxSlider({ - useCSS: false, - maxSlides: 1, - slideWidth: homeslider_width, - infiniteLoop: homeslider_loop, - hideControlOnEnd: true, - pager: false, - autoHover: true, - auto: homeslider_loop, - speed: parseInt(homeslider_speed), - pause: homeslider_pause, - controls: true - }); - - $('.homeslider-description').click(function () { - window.location.href = $(this).prev('a').prop('href'); - }); - - if ($('#htmlcontent_top').length > 0) - $('#homepage-slider').addClass('col-xs-8'); - else - $('#homepage-slider').addClass('col-xs-12'); -}); \ No newline at end of file diff --git a/modules/homeslider/js/index.php b/modules/homeslider/js/index.php deleted file mode 100644 index e5064df41..000000000 --- a/modules/homeslider/js/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/logo.gif b/modules/homeslider/logo.gif deleted file mode 100644 index e0f9ab6c0..000000000 Binary files a/modules/homeslider/logo.gif and /dev/null differ diff --git a/modules/homeslider/logo.png b/modules/homeslider/logo.png deleted file mode 100644 index 7e5a93ff8..000000000 Binary files a/modules/homeslider/logo.png and /dev/null differ diff --git a/modules/homeslider/translations/index.php b/modules/homeslider/translations/index.php deleted file mode 100644 index e5064df41..000000000 --- a/modules/homeslider/translations/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/upgrade/index.php b/modules/homeslider/upgrade/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/upgrade/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/upgrade/install-1.2.1.php b/modules/homeslider/upgrade/install-1.2.1.php deleted file mode 100644 index 2d3d12abd..000000000 --- a/modules/homeslider/upgrade/install-1.2.1.php +++ /dev/null @@ -1,24 +0,0 @@ -execute(' - UPDATE '._DB_PREFIX_.'homeslider_slides_lang SET - '.homeslider_stripslashes_field('title').', - '.homeslider_stripslashes_field('description').', - '.homeslider_stripslashes_field('legend').', - '.homeslider_stripslashes_field('url') - ); -} - -function homeslider_stripslashes_field($field) -{ - $quotes = array('"\\\'"', '"\'"'); - $dquotes = array('\'\\\\"\'', '\'"\''); - $backslashes = array('"\\\\\\\\"', '"\\\\"'); - - return '`'.bqSQL($field).'` = replace(replace(replace(`'.bqSQL($field).'`, '.$quotes[0].', '.$quotes[1].'), '.$dquotes[0].', '.$dquotes[1].'), '.$backslashes[0].', '.$backslashes[1].')'; -} \ No newline at end of file diff --git a/modules/homeslider/upgrade/install-1.2.3.php b/modules/homeslider/upgrade/install-1.2.3.php deleted file mode 100644 index 7d794bb7d..000000000 --- a/modules/homeslider/upgrade/install-1.2.3.php +++ /dev/null @@ -1,9 +0,0 @@ -registerHook('displayHeader') && $object->registerHook('displayTopColumn')); -} \ No newline at end of file diff --git a/modules/homeslider/upgrade/install-1.3.2.php b/modules/homeslider/upgrade/install-1.3.2.php deleted file mode 100644 index a376cf2f3..000000000 --- a/modules/homeslider/upgrade/install-1.3.2.php +++ /dev/null @@ -1,9 +0,0 @@ -getLocalPath() . 'img') && !file_exists($module->getLocalPath() . 'images')) - rename($module->getLocalPath() . 'img', $module->getLocalPath() . 'images'); - else if (file_exists($module->getLocalPath() . 'img') && file_exists($module->getLocalPath() . 'images')) - recurseCopy($module->getLocalPath() . 'img', $module->getLocalPath() . 'images', true); - - Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('homeslider.tpl')); - - return true; -} - -if (!function_exists('recurseCopy')) -{ - function recurseCopy($src, $dst, $del = false) - { - $dir = opendir($src); - - if (!file_exists($dst)) - mkdir($dst); - while (false !== ($file = readdir($dir))) { - if (($file != '.') && ($file != '..')) { - if (is_dir($src . DIRECTORY_SEPARATOR . $file)) - recurseCopy($src . DIRECTORY_SEPARATOR . $file, $dst . DIRECTORY_SEPARATOR . $file, $del); - else { - copy($src . DIRECTORY_SEPARATOR . $file, $dst . DIRECTORY_SEPARATOR . $file); - if ($del && is_writable($src . DIRECTORY_SEPARATOR . $file)) - unlink($src . DIRECTORY_SEPARATOR . $file); - } - } - } - closedir($dir); - if ($del && is_writable($src)) - rmdir($src); - } -} \ No newline at end of file diff --git a/modules/homeslider/upgrade/install-1.5.0.php b/modules/homeslider/upgrade/install-1.5.0.php deleted file mode 100644 index b8cc9c542..000000000 --- a/modules/homeslider/upgrade/install-1.5.0.php +++ /dev/null @@ -1,60 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/admin/_configure/helpers/form/form.tpl b/modules/homeslider/views/templates/admin/_configure/helpers/form/form.tpl deleted file mode 100644 index 206702af3..000000000 --- a/modules/homeslider/views/templates/admin/_configure/helpers/form/form.tpl +++ /dev/null @@ -1,81 +0,0 @@ -{* -* 2007-2016 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - -{extends file="helpers/form/form.tpl"} -{block name="field"} - {if $input.type == 'file_lang'} -
- {foreach from=$languages item=language} - {if $languages|count > 1} -
- {/if} -
- {if isset($fields[0]['form']['images'])} - - {/if} -
- - - - - - -
-
- {if $languages|count > 1} -
- - -
- {/if} - {if $languages|count > 1} -
- {/if} - - {/foreach} -
- {/if} - {$smarty.block.parent} -{/block} \ No newline at end of file diff --git a/modules/homeslider/views/templates/admin/_configure/helpers/form/index.php b/modules/homeslider/views/templates/admin/_configure/helpers/form/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/views/templates/admin/_configure/helpers/form/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/admin/_configure/helpers/index.php b/modules/homeslider/views/templates/admin/_configure/helpers/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/views/templates/admin/_configure/helpers/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/admin/_configure/index.php b/modules/homeslider/views/templates/admin/_configure/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/views/templates/admin/_configure/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/admin/index.php b/modules/homeslider/views/templates/admin/index.php deleted file mode 100644 index 8761a003e..000000000 --- a/modules/homeslider/views/templates/admin/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/hook/header.tpl b/modules/homeslider/views/templates/hook/header.tpl deleted file mode 100644 index 08579f1b3..000000000 --- a/modules/homeslider/views/templates/hook/header.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{if isset($homeslider)} - -{/if} \ No newline at end of file diff --git a/modules/homeslider/views/templates/hook/homeslider.tpl b/modules/homeslider/views/templates/hook/homeslider.tpl deleted file mode 100644 index 634401220..000000000 --- a/modules/homeslider/views/templates/hook/homeslider.tpl +++ /dev/null @@ -1,48 +0,0 @@ -{* -* 2007-2016 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} -{if $page_name =='index'} - - {if isset($homeslider_slides)} -
- {if isset($homeslider_slides.0) && isset($homeslider_slides.0.sizes.1)}{capture name='height'}{$homeslider_slides.0.sizes.1}{/capture}{/if} -
    - {foreach from=$homeslider_slides item=slide} - {if $slide.active} -
  • - - {$slide.legend|escape:'htmlall':'UTF-8'} - - {if isset($slide.description) && trim($slide.description) != ''} -
    {$slide.description}
    - {/if} -
  • - {/if} - {/foreach} -
-
- {/if} - -{/if} \ No newline at end of file diff --git a/modules/homeslider/views/templates/hook/index.php b/modules/homeslider/views/templates/hook/index.php deleted file mode 100644 index da7198817..000000000 --- a/modules/homeslider/views/templates/hook/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/homeslider/views/templates/hook/list.tpl b/modules/homeslider/views/templates/hook/list.tpl deleted file mode 100644 index e8d5977b9..000000000 --- a/modules/homeslider/views/templates/hook/list.tpl +++ /dev/null @@ -1,76 +0,0 @@ -{* -* 2007-2016 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} -

{l s='Slides list' mod='homeslider'} - - - - - - - -

-
-
- {foreach from=$slides item=slide} -
-
-
- -
-
- {$slide.title} -
-
-

- #{$slide.id_slide} - {$slide.title} - {if $slide.is_shared} -
- - {l s='Shared slide' mod='homeslider'} - -
- {/if} -

- -
-
-
- {/foreach} -
-
-
diff --git a/modules/homeslider/views/templates/index.php b/modules/homeslider/views/templates/index.php deleted file mode 100644 index da7198817..000000000 --- a/modules/homeslider/views/templates/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 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/hotel-reservation-theme/css/modules/homeslider/homeslider.css b/themes/hotel-reservation-theme/css/modules/homeslider/homeslider.css deleted file mode 100644 index 3f5461cf8..000000000 --- a/themes/hotel-reservation-theme/css/modules/homeslider/homeslider.css +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** - Home Page Slider -*******************************************************************************/ -#homepage-slider { - padding-left: 0; - padding-right: 0; - margin-bottom: 14px; - max-width: 100%; - max-height: 100%; - overflow: hidden; - position: relative; - z-index: 1; - float: left; - /***************************************************************************** - BXSlider Styles - ********************************************************************************/ } - @media (max-width: 767px) { - #homepage-slider { - width: 100%; - max-width: 100%; - padding-top: 20px; } } - #homepage-slider #homeslider { - margin: 0 auto; - padding: 0; } - #homepage-slider .homeslider-container { - position: relative; } - #homepage-slider .homeslider-image { - position: absolute; - left: 0; - top: 0; } - #homepage-slider .homeslider-description { - position: absolute; - left: 0; - top: 0; - padding: 50px 50px; - cursor: pointer; } - #homepage-slider .homeslider-description h2 { - font-size: 2.7em; - color: white; - margin: 0; - padding: 0; } - #homepage-slider .homeslider-description p { - width: 50%; - font-size: 1.15em; - line-height: 1.3em; - padding: 0.5em 0; - color: white; } - #homepage-slider .homeslider-description button { - font-size: 1.2em; - text-transform: uppercase; } - @media (max-width: 1200px) { - #homepage-slider .homeslider-description { - padding: 20px; - font-size: 0.8em; } } - @media (max-width: 768px) { - #homepage-slider .homeslider-description { - padding: 30px; - font-size: 0.7em; } - #homepage-slider .homeslider-description p { - font-size: 1.5em; } } - @media (max-width: 480px) { - #homepage-slider .homeslider-description { - padding: 30px; - font-size: 0.5em; } - #homepage-slider .homeslider-description p { - font-size: 1.7em; } } - #homepage-slider .bx-wrapper a { - display: block; } - #homepage-slider .bx-wrapper img { - height: auto; } - #homepage-slider .bx-wrapper .bx-viewport { - width: 100%; - direction: ltr !important; } - #homepage-slider .bx-wrapper .bx-pager.bx-default-pager a { - background: #666; } - #homepage-slider .bx-wrapper .bx-controls-direction a { - top: auto; - margin-top: 0px; - font-size: 1em; - bottom: 10px; - outline: 0; - width: 52px; - height: 52px; - text-indent: -9999px; - z-index: 9999; - border: 2px solid #fff; - line-height: 18px; } - #homepage-slider .bx-wrapper .bx-controls-direction a:before { - height: 48px; - width: 48px; - display: block; - background: #fff; - content: "."; - opacity: 0.14; - text-indent: -9999px; - position: absolute; - left: 0; - top: 0; - z-index: 1; } - #homepage-slider .bx-wrapper .bx-controls-direction a:after { - display: block; - width: 48px; - height: 48px; - color: #fff; - text-indent: 0; - text-align: center; - font-size: 21px; - font-family: "FontAwesome"; - position: absolute; - top: 0; - left: 0; - z-index: 2; - padding: 16px 0 0 0; } - #homepage-slider .bx-wrapper .bx-controls-direction a:hover:before { - background: #333; - opacity: 0.83; } - #homepage-slider .bx-wrapper .bx-prev { - right: 60px; - left: auto; } - #homepage-slider .bx-wrapper .bx-prev:after { - content: "\f053"; } - #homepage-slider .bx-wrapper .bx-next:after { - content: "\f054"; } - -.ie8 #homepage-slider .bx-wrapper .bx-controls-direction a:before { - background: #333; } - -/*# sourceMappingURL=homeslider.css.map */ diff --git a/themes/hotel-reservation-theme/css/modules/homeslider/images/index.php b/themes/hotel-reservation-theme/css/modules/homeslider/images/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/css/modules/homeslider/images/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 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; diff --git a/themes/hotel-reservation-theme/css/modules/homeslider/index.php b/themes/hotel-reservation-theme/css/modules/homeslider/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/css/modules/homeslider/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 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; diff --git a/themes/hotel-reservation-theme/js/modules/homeslider/index.php b/themes/hotel-reservation-theme/js/modules/homeslider/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/js/modules/homeslider/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 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; diff --git a/themes/hotel-reservation-theme/js/modules/homeslider/js/homeslider.js b/themes/hotel-reservation-theme/js/modules/homeslider/js/homeslider.js deleted file mode 100644 index 29fc4e952..000000000 --- a/themes/hotel-reservation-theme/js/modules/homeslider/js/homeslider.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -* 2007-2017 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2017 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -$(document).ready(function(){ - - if (typeof(homeslider_speed) == 'undefined') - homeslider_speed = 500; - if (typeof(homeslider_pause) == 'undefined') - homeslider_pause = 3000; - if (typeof(homeslider_loop) == 'undefined') - homeslider_loop = true; - if (typeof(homeslider_width) == 'undefined') - homeslider_width = 779; - - - $('.homeslider-description').click(function () { - window.location.href = $(this).prev('a').prop('href'); - }); - - if ($('#htmlcontent_top').length > 0) - $('#homepage-slider').addClass('col-xs-8'); - else - $('#homepage-slider').addClass('col-xs-12'); - - if (!!$.prototype.bxSlider) - $('#homeslider').bxSlider({ - useCSS: false, - maxSlides: 1, - slideWidth: homeslider_width, - infiniteLoop: homeslider_loop, - hideControlOnEnd: true, - pager: false, - autoHover: true, - auto: homeslider_loop, - speed: parseInt(homeslider_speed), - pause: homeslider_pause, - controls: true - }); -}); \ No newline at end of file diff --git a/themes/hotel-reservation-theme/js/modules/homeslider/js/index.php b/themes/hotel-reservation-theme/js/modules/homeslider/js/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/js/modules/homeslider/js/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 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; diff --git a/themes/hotel-reservation-theme/modules/homeslider/header.tpl b/themes/hotel-reservation-theme/modules/homeslider/header.tpl deleted file mode 100644 index 1ceab61f9..000000000 --- a/themes/hotel-reservation-theme/modules/homeslider/header.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{if isset($homeslider)} - {addJsDef homeslider_loop=$homeslider.loop|intval} - {addJsDef homeslider_width=$homeslider.width|intval} - {addJsDef homeslider_speed=$homeslider.speed|intval} - {addJsDef homeslider_pause=$homeslider.pause|intval} -{/if} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/modules/homeslider/homeslider.tpl b/themes/hotel-reservation-theme/modules/homeslider/homeslider.tpl deleted file mode 100644 index 3db8b869c..000000000 --- a/themes/hotel-reservation-theme/modules/homeslider/homeslider.tpl +++ /dev/null @@ -1,48 +0,0 @@ -{* -* 2007-2017 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2017 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} -{if $page_name =='index'} - - {if isset($homeslider_slides)} -
- {if isset($homeslider_slides.0) && isset($homeslider_slides.0.sizes.1)}{capture name='height'}{$homeslider_slides.0.sizes.1}{/capture}{/if} -
    - {foreach from=$homeslider_slides item=slide} - {if $slide.active} -
  • - - {$slide.legend|escape:'htmlall':'UTF-8'} - - {if isset($slide.description) && trim($slide.description) != ''} -
    {$slide.description}
    - {/if} -
  • - {/if} - {/foreach} -
-
- {/if} - -{/if} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/modules/homeslider/index.php b/themes/hotel-reservation-theme/modules/homeslider/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/modules/homeslider/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 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;