diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 15f3dc69d..a7046cef1 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -435,6 +435,7 @@ class FrontControllerCore extends Controller $this->context->smarty->assign(array( 'HOOK_HEADER' => Hook::exec('displayHeader'), 'HOOK_TOP' => Hook::exec('displayTop'), + 'HOOK_TOP_COLUMN' => ($this->display_column_left ? Hook::exec('displayTopColumn') : ''), 'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''), 'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''), )); diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml index 3b5fa296d..ec011ffe7 100644 --- a/install-dev/data/xml/hook.xml +++ b/install-dev/data/xml/hook.xml @@ -279,6 +279,9 @@ displayHomeTabContentHome Page Tabs ContentThis hook displays new elements on the homepage tabs content + + + displayTopColumnTop column blocksThis hook displays new elements in the top of columns displayBackOfficeCategoryDisplay new elements in the Back Office, tab AdminCategoriesThis hook launches modules when the AdminCategories tab is displayed in the Back Office diff --git a/modules/homeslider/bx_styles.css b/modules/homeslider/bx_styles.css index 21a5c1f1a..aaf9d062b 100755 --- a/modules/homeslider/bx_styles.css +++ b/modules/homeslider/bx_styles.css @@ -4,13 +4,11 @@ * 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; @@ -21,11 +19,9 @@ width: 30px; height: 30px; text-indent: -999999px; - background: url(gray_next.png) no-repeat 0 -30px; + background: url(../images/gray_next.png) no-repeat 0 -30px; } - /*previous button*/ - .bx-prev { display:none; position:absolute; @@ -35,9 +31,8 @@ width: 30px; height: 30px; text-indent: -999999px; - background: url(gray_prev.png) no-repeat 0 -30px; + background: url(../images/gray_prev.png) no-repeat 0 -30px; } - /*pager links*/ .bx-pager { position: absolute; @@ -60,20 +55,17 @@ font-size: 11px; color:#000; text-decoration:none; - background:url(gray_pager.png) no-repeat 0 -20px; + background:url(../images/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 { @@ -81,7 +73,6 @@ text-decoration:none; background-position: 0 0; } - /*captions*/ .bx-captions { text-align:center; @@ -89,14 +80,12 @@ padding: 7px 0; color: #666; } - /*auto controls*/ .bx-auto { text-align: center; padding-top: 15px; } - .bx-auto a { color: #666; font-size: 12px; -} +} \ No newline at end of file diff --git a/modules/homeslider/config.xml b/modules/homeslider/config.xml index 1a559ea17..c3725fe22 100644 --- a/modules/homeslider/config.xml +++ b/modules/homeslider/config.xml @@ -2,7 +2,7 @@ homeslider - + diff --git a/modules/homeslider/homeslider.php b/modules/homeslider/homeslider.php index 13211641a..04a4ecae3 100644 --- a/modules/homeslider/homeslider.php +++ b/modules/homeslider/homeslider.php @@ -26,7 +26,7 @@ /** * @since 1.5.0 - * @version 1.2 (2012-03-14) + * @version 1.3 (2012-03-14) */ if (!defined('_PS_VERSION_')) @@ -42,7 +42,7 @@ class HomeSlider extends Module { $this->name = 'homeslider'; $this->tab = 'front_office_features'; - $this->version = '1.2.2'; + $this->version = '1.2.3'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->secure_key = Tools::encrypt($this->name); @@ -60,7 +60,7 @@ class HomeSlider extends Module public function install() { /* Adds Module */ - if (parent::install() && $this->registerHook('displayTop') && $this->registerHook('actionShopDataDuplication')) + if (parent::install() && $this->registerHook('displayTopColumn') && $this->registerHook('actionShopDataDuplication')) { /* Sets up configuration */ $res = Configuration::updateValue('HOMESLIDER_WIDTH', '779'); @@ -660,18 +660,17 @@ class HomeSlider extends Module return true; } - public function hookDisplayTop() + public function hookdisplayTopColumn() { - if(!$this->_prepareHook()) - return; - - // Check if not a mobile theme - if ($this->context->getMobileDevice() != false) + if ($this->context->smarty->tpl_vars['page_name'] != 'index' || $this->context->getMobileDevice() != false) return false; + if(!$this->_prepareHook()) + return false; $this->context->controller->addJS($this->_path.'js/jquery.bxSlider.min.js'); $this->context->controller->addCSS($this->_path.'bx_styles.css'); $this->context->controller->addJS($this->_path.'js/homeslider.js'); + return $this->display(__FILE__, 'homeslider.tpl', $this->getCacheId()); } diff --git a/modules/homeslider/homeslider.tpl b/modules/homeslider/homeslider.tpl index f14a77273..c2df7b4d7 100644 --- a/modules/homeslider/homeslider.tpl +++ b/modules/homeslider/homeslider.tpl @@ -23,34 +23,37 @@ * @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)} +
+
    + {foreach from=$homeslider_slides item=slide} + {if $slide.active} +
  • + + {$slide.legend|escape:'html':'UTF-8'} + +
  • + {/if} + {/foreach} +
+
{if isset($homeslider)} {/if} -{if isset($homeslider_slides)} - {/if} +{/if} \ No newline at end of file diff --git a/modules/homeslider/gray_next.png b/modules/homeslider/images/gray_next.png old mode 100755 new mode 100644 similarity index 100% rename from modules/homeslider/gray_next.png rename to modules/homeslider/images/gray_next.png diff --git a/modules/homeslider/gray_pager.png b/modules/homeslider/images/gray_pager.png old mode 100755 new mode 100644 similarity index 100% rename from modules/homeslider/gray_pager.png rename to modules/homeslider/images/gray_pager.png diff --git a/modules/homeslider/gray_prev.png b/modules/homeslider/images/gray_prev.png old mode 100755 new mode 100644 similarity index 100% rename from modules/homeslider/gray_prev.png rename to modules/homeslider/images/gray_prev.png diff --git a/modules/homeslider/upgrade/install-1.2.3.php b/modules/homeslider/upgrade/install-1.2.3.php new file mode 100644 index 000000000..017e14f10 --- /dev/null +++ b/modules/homeslider/upgrade/install-1.2.3.php @@ -0,0 +1,9 @@ +unregisterHook('displayHome') && $object->registerHook('displayTopColumn')); +} \ No newline at end of file diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index caabfdead..c9cf4df17 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -73,7 +73,7 @@ class ThemeConfigurator extends Module !$this->installDB() || !$this->installFixtures() || !$this->registerHook('displayHeader') || - !$this->registerHook('displayTop') || + !$this->registerHook('displayTopColumn') || !$this->registerHook('displayLeftColumn') || !$this->registerHook('displayRightColumn') || !$this->registerHook('displayHome') || @@ -203,7 +203,7 @@ class ThemeConfigurator extends Module } } - public function hookDisplayTop() + public function hookdisplayTopColumn() { if ((int)Tools::getValue('live_configurator', 0) == 1) { @@ -285,8 +285,8 @@ class ThemeConfigurator extends Module protected function deleteImage($image) { $file_name = $this->uploads_path.$image; - if (realpath(dirname($file_name)) != $this->uploads_path) - die; + if (realpath(dirname($file_name)).DIRECTORY_SEPARATOR != $this->uploads_path) + Tools::dieOrLog(sprintf('Could not find upload directory')); if ($image != '' && is_file($file_name)) unlink($file_name); diff --git a/themes/default-bootstrap/css/modules/themeconfigurator/views/css/hooks.css b/themes/default-bootstrap/css/modules/themeconfigurator/views/css/hooks.css index eef234ead..830d76f9e 100644 --- a/themes/default-bootstrap/css/modules/themeconfigurator/views/css/hooks.css +++ b/themes/default-bootstrap/css/modules/themeconfigurator/views/css/hooks.css @@ -30,11 +30,12 @@ /* Top hook CSS */ #htmlcontent_top { - float: left; - padding-top: 40px; - width: 33.4%; - max-width: 391px; - padding-left: 10px; + float: left; + padding-top: 40px; + width: 33.4%; + max-width: 391px; + padding-left: 10px; + margin-bottom: 15px; } @media (max-width: 767px) { #htmlcontent_top { diff --git a/themes/default-bootstrap/header.tpl b/themes/default-bootstrap/header.tpl index b64881274..2da5ae370 100644 --- a/themes/default-bootstrap/header.tpl +++ b/themes/default-bootstrap/header.tpl @@ -116,7 +116,6 @@ {/if} - {if count($languages) > 1} - {/if} - {if count($currencies) > 1}
@@ -184,20 +180,16 @@
{/if} -
- {if $shop_phone} {l s='Call us now toll free:'} {$shop_phone} {/if} - -