diff --git a/admin-dev/themes/default/js/calendar.js b/admin-dev/themes/default/js/calendar.js index 0c9215857..da16ddcc1 100644 --- a/admin-dev/themes/default/js/calendar.js +++ b/admin-dev/themes/default/js/calendar.js @@ -378,8 +378,13 @@ $( document ).ready(function() { } $('#datepickerExpand').on('click',function() { - $('#datepicker').removeClass('hide'); - $('#date-start').focus(); + if ($('#datepicker').hasClass('hide')) + { + $('#datepicker').removeClass('hide'); + $('#date-start').focus(); + } + else + $('#datepicker').addClass('hide'); }); $('.submitDateDay').on('click',function(e){ diff --git a/admin-dev/themes/default/js/tree.js b/admin-dev/themes/default/js/tree.js index 992ec6b78..976492e39 100644 --- a/admin-dev/themes/default/js/tree.js +++ b/admin-dev/themes/default/js/tree.js @@ -11,6 +11,8 @@ Tree.prototype = init: function () { + var that = $(this); + this.$element.find("label.tree-toggler").click( function () { @@ -19,12 +21,16 @@ Tree.prototype = $(this).parent().children(".icon-folder-open") .removeClass("icon-folder-open") .addClass("icon-folder-close"); + + that.trigger('collapse'); } else { $(this).parent().children(".icon-folder-close") .removeClass("icon-folder-close") .addClass("icon-folder-open"); + + that.trigger('expand'); } $(this).parent().parent().children("ul.tree").toggle(300); } @@ -36,6 +42,8 @@ Tree.prototype = $('li input:checked').parent().addClass("tree-selected"); } ); + + return $(this); }, collapseAll : function($speed) @@ -49,6 +57,8 @@ Tree.prototype = $(this).parent().parent().children("ul.tree").hide($speed); } ); + + return $(this); }, expandAll : function($speed) @@ -62,6 +72,8 @@ Tree.prototype = $(this).parent().parent().children("ul.tree").show($speed); } ); + + return $(this); }, }; diff --git a/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl index c39de195c..ffe85bf5c 100644 --- a/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl @@ -128,6 +128,22 @@
{l s="Go to prestashop.com"}
+ +
+

{l s="Simulation Mode"}

+ + + + + + + +
+ \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/login/content.tpl b/admin-dev/themes/default/template/controllers/login/content.tpl index 265c6f749..8bcb2a867 100755 --- a/admin-dev/themes/default/template/controllers/login/content.tpl +++ b/admin-dev/themes/default/template/controllers/login/content.tpl @@ -177,7 +177,7 @@ diff --git a/admin-dev/themes/default/template/controllers/modules/configure.tpl b/admin-dev/themes/default/template/controllers/modules/configure.tpl index 41348d418..a8941f8ee 100644 --- a/admin-dev/themes/default/template/controllers/modules/configure.tpl +++ b/admin-dev/themes/default/template/controllers/modules/configure.tpl @@ -25,19 +25,37 @@

- {l s='Configure'} : {$module_name} + {l s='Configure:'} {$module_display_name} ({$module_name})

-

{l s='LiveEdit'}

+

{l s='Live Edit'}

{if $live_edit}

{l s='You have to select a shop to use LiveEdit'}

{else} diff --git a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl index 78f662c03..cc62f3259 100644 --- a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl +++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl @@ -80,7 +80,17 @@ }); {/if} $(document).ready(function () { - $("#{$id}").tree("collapseAll"); + var tree = $("#{$id}").tree("collapseAll"); + + tree.on('collapse', function() { + $('#expand-all-{$id}').show(); + }); + + tree.on('expand', function() { + $('#collapse-all-{$id}').show(); + }); + + $('#collapse-all-{$id}').hide(); $("#{$id}").find(":input[type=radio]").click( function() { diff --git a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl index d41eddd1a..7a4cda93f 100644 --- a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl +++ b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl @@ -61,7 +61,7 @@ - +
-
-
- '.$this->l('Errors:').' -
    -
  • '.$this->l('Filter template name required (cannot be empty)').'
  • -
-
-

'.$this->l('Step 3/3 - Name your template').'

+
 
+
+
'.$this->l('Filter template name required (cannot be empty)').'
+

'.$this->l('Step 3/3 - Name your template').'

+

'.$this->l('Template name:').' ('.$this->l('only as a reminder').')

-
-

'.$this->l('No filters selected, the blocklayered will be disable for the categories seleted.').'

-
-
+
'.$this->l('No filters selected, the blocklayered will be disable for the categories seleted.').'
+
@@ -2132,92 +2126,178 @@ class BlockLayered extends Module

'.$this->l('Configuration').'

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'.$this->l('Option').''.$this->l('Value').'
'.$this->l('Hide filter values with no product is matching').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Show the number of matching products').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Show products from subcategories').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Category filter depth (0 for no limits, 1 by default)').' + +
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
-
'.$this->l('Use tax to filter price').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Allow indexing robots (google, yahoo, bing, ...) to use condition filter').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Allow indexing robots (google, yahoo, bing, ...) to use availability filter').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Allow indexing robots (google, yahoo, bing, ...) to use manufacturer filter').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
'.$this->l('Allow indexing robots (google, yahoo, bing, ...) to use category filter').' - '.$this->l('Yes').' - '.$this->l('Yes').' - '.$this->l('No').' - '.$this->l('No').' -
-

+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+
+
+ +
+
'; @@ -3497,12 +3577,11 @@ class BlockLayered extends Module $n_elements = 20; $html = ' -
-

'.$this->l('Available filters').' (0)

+
+

'.$this->l('Available filters').' (0)

    • - '.$this->l('Sub-categories filter').' @@ -3791,9 +3870,9 @@ class BlockLayered extends Module $helper->table = 'layered_filter'; $helper->identifier = 'id_layered_filter'; $helper->base_folder = Tools::getValue('base_folder').'/themes/default/template/helpers/form/'; - + $html .= ' -
      '.$helper->renderAssoShop().'
      +
      '.$helper->renderAssoShop(false, Tools::getValue('base_folder').'/themes/default/template/helpers/tree/').'
      \ No newline at end of file diff --git a/modules/blockwishlist/config.xml b/modules/blockwishlist/config.xml index b2769a8d2..43c96a918 100755 --- a/modules/blockwishlist/config.xml +++ b/modules/blockwishlist/config.xml @@ -2,7 +2,7 @@ blockwishlist - + diff --git a/modules/blockwishlist/upgrade/install-0.3.php b/modules/blockwishlist/upgrade/install-0.3.php new file mode 100644 index 000000000..1d2b8f3d3 --- /dev/null +++ b/modules/blockwishlist/upgrade/install-0.3.php @@ -0,0 +1,9 @@ +registerHook('displayProductListFunctionalButtons') && $object->registerHook('top')); +} diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php index b77ba9f32..11043100d 100644 --- a/modules/dashactivity/dashactivity.php +++ b/modules/dashactivity/dashactivity.php @@ -97,6 +97,45 @@ class Dashactivity extends Module public function hookDashboardData($params) { + if (Configuration::get('PS_DASHBOARD_SIMULATION')) + { + $days = round((strtotime($params['date_to']) - strtotime($params['date_from'])) / 3600 / 24); + $online_visitor = round(rand(10, 50)); + $visits = round(rand(200, 2000) * $days); + + return array( + 'data_value' => array( + 'pending_orders' => round(rand(0, 5)), + 'return_exchanges' => round(rand(0, 5)), + 'abandoned_cart' => round(rand(5, 50)), + 'products_out_of_stock' => round(rand(1, 10)), + 'new_messages' => round(rand(1, 10) * $days), + 'order_inquires' => 42, + 'product_reviews' => round(rand(5, 50) * $days), + 'new_customers' => round(rand(1, 5) * $days), + 'online_visitor' => $online_visitor, + 'active_shopping_cart' => round($online_visitor / 10), + 'new_registrations' => round(rand(1, 5) * $days), + 'total_suscribers' => round(rand(200, 2000)), + 'visits' => $visits, + 'unique_visitors' => round($visits * 0.6), + ), + 'data_trends' => array( + 'orders_trends' => array('way' => 'down', 'value' => 0.42), + ), + 'data_list_small' => array( + 'dash_traffic_source' => array('prestashop.com' => round($visits / 2), 'google.com' => round($visits / 3), 'Direct Traffic' => round($visits / 4)) + ), + 'data_chart' => array( + 'dash_trends_chart1' => array('chart_type' => 'pie_chart_trends', 'data' => array( + array('key' => 'prestashop.com', 'y' => round($visits / 2)), + array('key' => 'google.com', 'y' => round($visits / 3)), + array('key' => 'Direct Traffic', 'y' => round($visits / 4)) + )) + ) + ); + } + $gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false; if (Validate::isLoadedObject($gapi) && $gapi->isConfigured()) { diff --git a/modules/dashgoals/views/templates/hook/config.tpl b/modules/dashgoals/views/templates/hook/config.tpl index 03cf67c73..3b7771571 100644 --- a/modules/dashgoals/views/templates/hook/config.tpl +++ b/modules/dashgoals/views/templates/hook/config.tpl @@ -29,10 +29,10 @@ - - - - + + + + diff --git a/modules/dashtrends/dashtrends.php b/modules/dashtrends/dashtrends.php index 80c8583d9..015945ff4 100644 --- a/modules/dashtrends/dashtrends.php +++ b/modules/dashtrends/dashtrends.php @@ -75,11 +75,30 @@ class Dashtrends extends Module 'total_expenses' => array() ); - $tmp_data['visits'] = AdminStatsControllerCore::getVisits(false, $date_from, $date_to, 'day'); - $tmp_data['orders'] = AdminStatsControllerCore::getOrders($date_from, $date_to, 'day'); - $tmp_data['total_paid_tax_excl'] = AdminStatsControllerCore::getTotalSales($date_from, $date_to, 'day'); - $tmp_data['total_purchases'] = AdminStatsControllerCore::getPurchases($date_from, $date_to, 'day'); - $tmp_data['total_expenses'] = AdminStatsControllerCore::getExpenses($date_from, $date_to, 'day'); + if (Configuration::get('PS_DASHBOARD_SIMULATION')) + { + $from = strtotime($date_from.' 00:00:00'); + $to = min(time(), strtotime($date_to.' 23:59:59')); + for ($date = $from; $date <= $to; $date = strtotime('+1 day', $date)) + { + $tmp_data['visits'][$date] = round(rand(2000, 20000)); + $tmp_data['conversion_rate'][$date] = rand(80, 250) / 100; + $tmp_data['average_cart_value'][$date] = round(rand(60, 200), 2); + $tmp_data['orders'][$date] = round($tmp_data['visits'][$date] * $tmp_data['conversion_rate'][$date] / 100); + $tmp_data['total_paid_tax_excl'][$date] = $tmp_data['orders'][$date] * $tmp_data['average_cart_value'][$date]; + $tmp_data['total_purchases'][$date] = $tmp_data['total_paid_tax_excl'][$date] * rand(50, 70) / 100; + $tmp_data['total_expenses'][$date] = $tmp_data['total_paid_tax_excl'][$date] * rand(0, 10) / 100; + } + } + else + { + $tmp_data['visits'] = AdminStatsControllerCore::getVisits(false, $date_from, $date_to, 'day'); + $tmp_data['orders'] = AdminStatsControllerCore::getOrders($date_from, $date_to, 'day'); + $tmp_data['total_paid_tax_excl'] = AdminStatsControllerCore::getTotalSales($date_from, $date_to, 'day'); + $tmp_data['total_purchases'] = AdminStatsControllerCore::getPurchases($date_from, $date_to, 'day'); + $tmp_data['total_expenses'] = AdminStatsControllerCore::getExpenses($date_from, $date_to, 'day'); + } + return $tmp_data; } @@ -93,7 +112,10 @@ class Dashtrends extends Module 'conversion_rate' => array(), 'net_profits' => array() ); - $from = max(strtotime(_PS_CREATION_DATE_.' 00:00:00'), strtotime($date_from.' 00:00:00')); + + $from = strtotime($date_from.' 00:00:00'); + if (!Configuration::get('PS_DASHBOARD_SIMULATION')) + $from = max(strtotime(_PS_CREATION_DATE_.' 00:00:00'), $from); $to = min(time(), strtotime($date_to.' 23:59:59')); for ($date = $from; $date <= $to; $date = strtotime('+1 day', $date)) { diff --git a/modules/productcomments/config.xml b/modules/productcomments/config.xml index d2ca5525e..c9413f84f 100755 --- a/modules/productcomments/config.xml +++ b/modules/productcomments/config.xml @@ -2,7 +2,7 @@ productcomments - + diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index 20f8d74ba..caea20fb4 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -41,7 +41,7 @@ class ProductComments extends Module { $this->name = 'productcomments'; $this->tab = 'front_office_features'; - $this->version = '2.3'; + $this->version = '2.4'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->secure_key = Tools::encrypt($this->name); @@ -70,6 +70,8 @@ class ProductComments extends Module !$this->registerHook('productTabContent') || !$this->registerHook('header') || !$this->registerHook('productOutOfStock') || + !$this->registerHook('displayProductListReviews') || + !$this->registerHook('top') || !Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', 30) || !Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', 0) || !Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1)) @@ -87,7 +89,9 @@ class ProductComments extends Module !$this->unregisterHook('productOutOfStock') || !$this->unregisterHook('productTabContent') || !$this->unregisterHook('header') || - !$this->unregisterHook('productTab')) + !$this->unregisterHook('productTab') || + !$this->unregisterHook('top') || + !$this->unregisterHook('displayProductListReviews')) return false; return true; } @@ -691,6 +695,24 @@ class ProductComments extends Module return ($this->display(__FILE__, '/tab.tpl')); } + public function hookTop($params) + { + $this->context->controller->addJS($this->_path.'js/jquery.rating.pack.js'); + return $this->display(__FILE__, 'productcomments_top.tpl'); + } + + public function hookDisplayProductListReviews($params) + { + require_once(dirname(__FILE__).'/ProductComment.php'); + + $average = ProductComment::getAverageGrade((int)$params['product']['id_product']); + $this->smarty->assign(array( + 'product' => $params['product'], + 'averageTotal' => round($average['grade']), + )); + return $this->display(__FILE__, 'productcomments_reviews.tpl'); + } + public function hookproductOutOfStock($params) { require_once(dirname(__FILE__).'/ProductComment.php'); diff --git a/modules/productcomments/productcomments_reviews.tpl b/modules/productcomments/productcomments_reviews.tpl new file mode 100644 index 000000000..cccaf240b --- /dev/null +++ b/modules/productcomments/productcomments_reviews.tpl @@ -0,0 +1,37 @@ + {* +* 2007-2013 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-2013 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 +*} +
      +
      + {section name="i" start=0 loop=5 step=1} + {if $averageTotal le $smarty.section.i.index} +
      + {else} +
      + {/if} + {/section} +
      + {l s='%s Review(s)'|sprintf:$averageTotal mod='productcomments'}  +
      \ No newline at end of file diff --git a/modules/productcomments/productcomments_top.tpl b/modules/productcomments/productcomments_top.tpl new file mode 100644 index 000000000..a09be2a77 --- /dev/null +++ b/modules/productcomments/productcomments_top.tpl @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/modules/productcomments/upgrade/index.php b/modules/productcomments/upgrade/index.php new file mode 100644 index 000000000..3f6561f72 --- /dev/null +++ b/modules/productcomments/upgrade/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 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/productcomments/upgrade/install-2.4.php b/modules/productcomments/upgrade/install-2.4.php new file mode 100644 index 000000000..8c0ee51f4 --- /dev/null +++ b/modules/productcomments/upgrade/install-2.4.php @@ -0,0 +1,9 @@ +registerHook('displayProductListReviews') && $object->registerHook('top')); +} diff --git a/modules/productpaymentlogos/config.xml b/modules/productpaymentlogos/config.xml new file mode 100644 index 000000000..0c85eaeab --- /dev/null +++ b/modules/productpaymentlogos/config.xml @@ -0,0 +1,12 @@ + + + productpaymentlogos + + + + + + 1 + 0 + + \ No newline at end of file diff --git a/modules/productpaymentlogos/e4ee7a7ece2c90b3186c362c26d22a83.png b/modules/productpaymentlogos/e4ee7a7ece2c90b3186c362c26d22a83.png new file mode 100644 index 000000000..fc09af124 Binary files /dev/null and b/modules/productpaymentlogos/e4ee7a7ece2c90b3186c362c26d22a83.png differ diff --git a/modules/productpaymentlogos/index.php b/modules/productpaymentlogos/index.php new file mode 100644 index 000000000..3f6561f72 --- /dev/null +++ b/modules/productpaymentlogos/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 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/productpaymentlogos/logo.gif b/modules/productpaymentlogos/logo.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/modules/productpaymentlogos/logo.gif differ diff --git a/modules/productpaymentlogos/logo.png b/modules/productpaymentlogos/logo.png new file mode 100644 index 000000000..a4b55f7d6 Binary files /dev/null and b/modules/productpaymentlogos/logo.png differ diff --git a/modules/productpaymentlogos/payment-logo.png b/modules/productpaymentlogos/payment-logo.png new file mode 100644 index 000000000..fc09af124 Binary files /dev/null and b/modules/productpaymentlogos/payment-logo.png differ diff --git a/modules/productpaymentlogos/productpaymentlogos.php b/modules/productpaymentlogos/productpaymentlogos.php new file mode 100644 index 000000000..c64a3d81f --- /dev/null +++ b/modules/productpaymentlogos/productpaymentlogos.php @@ -0,0 +1,184 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +class ProductPaymentLogos extends Module +{ + public function __construct() + { + $this->name = 'productpaymentlogos'; + $this->tab = 'other'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + $this->need_instance = 0; + + $this->bootstrap = true; + parent::__construct(); + + $this->displayName = $this->l('Product payment logos block'); + $this->description = $this->l('Displays payment system logos at the product page.'); + } + + public function install() + { + Configuration::updateValue('PRODUCTPAYMENTLOGOS_IMG', 'payment-logo.png'); + Configuration::updateValue('PRODUCTPAYMENTLOGOS_LINK', ''); + Configuration::updateValue('PRODUCTPAYMENTLOGOS_TITLE', ''); + return parent::install() && $this->registerHook('displayProductButtons') && $this->registerHook('header'); + } + + public function uninstall() + { + Configuration::deleteByName('PRODUCTPAYMENTLOGOS_IMG'); + Configuration::deleteByName('PRODUCTPAYMENTLOGOS_LINK'); + Configuration::deleteByName('PRODUCTPAYMENTLOGOS_TITLE'); + return parent::uninstall(); + } + + public function hookDisplayProductButtons($params) + { + if (!$this->isCached('productpaymentlogos.tpl', $this->getCacheId())) + { + $this->smarty->assign('banner_img', Configuration::get('PRODUCTPAYMENTLOGOS_IMG')); + $this->smarty->assign('banner_link', Configuration::get('PRODUCTPAYMENTLOGOS_LINK')); + $this->smarty->assign('banner_title', Configuration::get('PRODUCTPAYMENTLOGOS_TITLE')); + $sql = 'SELECT COUNT(*) + FROM '._DB_PREFIX_.'store s' + .Shop::addSqlAssociation('store', 's'); + $total = Db::getInstance()->getValue($sql); + + if ($total <= 0) + return; + } + return $this->display(__FILE__, 'productpaymentlogos.tpl', $this->getCacheId()); + } + + public function hookHeader($params) + { + $this->context->controller->addCSS($this->_path.'productpaymentlogos.css', 'all'); + } + + public function postProcess() + { + if (Tools::isSubmit('submitStoreConf')) + { + if (isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']) && isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name']) && !empty($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name'])) + { + if ($error = ImageManager::validateUpload($_FILES['PRODUCTPAYMENTLOGOS_IMG'], 4000000)) + return $this->displayError($this->l('Invalid image')); + else + { + $ext = substr($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], strrpos($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], '.') + 1); + $file_name = md5($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name']).'.'.$ext; + if (!move_uploaded_file($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name'], dirname(__FILE__).'/'.$file_name)) + return $this->displayError($this->l('An error occurred while attempting to upload the file.')); + else + { + if (Configuration::hasContext('PRODUCTPAYMENTLOGOS_IMG', null, Shop::getContext()) && Configuration::get('PRODUCTPAYMENTLOGOS_IMG') != $file_name) + @unlink(dirname(__FILE__).'/'.Configuration::get('PRODUCTPAYMENTLOGOS_IMG')); + Configuration::updateValue('PRODUCTPAYMENTLOGOS_IMG', $file_name); + $this->_clearCache('productpaymentlogos.tpl'); + return $this->displayConfirmation($this->l('The settings have been updated.')); + } + } + } + Configuration::updateValue('PRODUCTPAYMENTLOGOS_LINK', Tools::getValue('PRODUCTPAYMENTLOGOS_LINK')); + Configuration::updateValue('PRODUCTPAYMENTLOGOS_TITLE', Tools::getValue('PRODUCTPAYMENTLOGOS_TITLE')); + } + return ''; + } + + public function getContent() + { + return $this->postProcess().$this->renderForm(); + return $output; + } + + 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('Logos heading'), + 'name' => 'PRODUCTPAYMENTLOGOS_TITLE', + 'desc' => $this->l('Please input logos heading') + ), + array( + 'type' => 'file', + 'label' => $this->l('Block image'), + 'name' => 'PRODUCTPAYMENTLOGOS_IMG', + 'desc' => $this->l('Please upload banner image'), + 'thumb' => '../modules/'.$this->name.'/'.Configuration::get('PRODUCTPAYMENTLOGOS_IMG'), + ), + array( + 'type' => 'text', + 'label' => $this->l('Image Link'), + 'name' => 'PRODUCTPAYMENTLOGOS_LINK', + 'desc' => $this->l('Please input banner link') + ) + ), + 'submit' => array( + 'title' => $this->l('Save'), + 'class' => 'btn btn-default') + ), + ); + + $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; + $helper->identifier = $this->identifier; + $helper->submit_action = 'submitStoreConf'; + $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() + { + return array( + 'PRODUCTPAYMENTLOGOS_IMG' => Tools::getValue('PRODUCTPAYMENTLOGOS_IMG', Configuration::get('PRODUCTPAYMENTLOGOS_IMG')), + 'PRODUCTPAYMENTLOGOS_LINK' => Tools::getValue('PRODUCTPAYMENTLOGOS_LINK', Configuration::get('PRODUCTPAYMENTLOGOS_LINK')), + 'PRODUCTPAYMENTLOGOS_TITLE' => Tools::getValue('PRODUCTPAYMENTLOGOS_TITLE', Configuration::get('PRODUCTPAYMENTLOGOS_TITLE')), + ); + } +} \ No newline at end of file diff --git a/modules/productpaymentlogos/productpaymentlogos.tpl b/modules/productpaymentlogos/productpaymentlogos.tpl new file mode 100644 index 000000000..2952718e5 --- /dev/null +++ b/modules/productpaymentlogos/productpaymentlogos.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2013 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-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +{if !$content_only} + +
      +
      +
      {$banner_title}
      + {$banner_title} +
      +{/if} + + + + diff --git a/modules/productpaymentlogos/translations/index.php b/modules/productpaymentlogos/translations/index.php new file mode 100644 index 000000000..3f6561f72 --- /dev/null +++ b/modules/productpaymentlogos/translations/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 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/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 a2531c613..6d2bf81bb 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -26,20 +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->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')) @@ -70,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', @@ -96,6 +445,7 @@ class ThemeConfigurator extends Module ) ), ); + } $fields_form = array( 'form' => array( @@ -130,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() { @@ -137,56 +533,55 @@ 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', 'value' => (int)Tools::getValue('PS_QUICK_VIEW', Configuration::get('PS_QUICK_VIEW')) + ), + array( + 'label' => $this->l('Enable top banner'), + 'name' => 'blockbanner', + 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockbanner')) && $module->active), + 'is_module' => true, + ), + array( + 'label' => $this->l('Enable product payment logos'), + 'name' => 'productpaymentlogos', + 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('productpaymentlogos')) && $module->active), + 'is_module' => true, ) ); } @@ -198,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 78% rename from modules/tmhtmlcontent/views/css/admin.css rename to modules/themeconfigurator/views/css/admin.css index c260e6160..f68e3251e 100644 --- a/modules/tmhtmlcontent/views/css/admin.css +++ b/modules/themeconfigurator/views/css/admin.css @@ -27,33 +27,13 @@ font-size:16px; color:#090; } -.new-item .languages { - float:left; - overflow:hidden; -} -.new-item .languages li { - float:left; - margin-right:5px; - padding:5px; - width:26px; - height:18px; - text-align:center; -} -.new-item .languages li.active { - background:#d1d1d1; -} - - .lang-tabs { position:relative; z-index:99; - clear:both; - overflow:hidden; - margin-top:20px; } .lang-tabs li { border:1px solid #f3f3f3; - border-bottom:1px solid #e9e9e9; + border-bottom:none; background:#FAFAFA; float:left; padding:15px; @@ -61,6 +41,7 @@ line-height:24px; margin-right:5px; cursor:pointer; + margin-bottom:0; } .lang-tabs li img { vertical-align:baseline; @@ -83,19 +64,22 @@ } -h3.hook-title { +h4.hook-title { border:1px solid #d1d1d1; background:#e5e5e5; padding:10px 10px; + margin:20px 0 !important; text-transform:capitalize; clear:both; } - +#items { + padding-left:0; +} .item { margin:0 0 5px; padding:10px; border:1px solid #e5e5e5; - background:#F1F1F1; + background:#fff; line-height:25px; font-weight:bold; color:#444; @@ -125,15 +109,6 @@ h3.hook-title { padding-left:10px; font-size:18px; } - -.item .button{ - float:right; - margin-left:10px; - cursor:pointer; - font-size:14px; - line-height:18px; - vertical-align: bottom; -} .item .button i{ margin-right:5px; font-size:16px; @@ -175,26 +150,13 @@ h3.hook-title { line-height:normal; position:relative; overflow:hidden; + padding-top:10px; } .new-item .item-container { display:none; - padding:10px; - border:1px solid #ccc; - background:#F1F1F1; - line-height:normal; - position:relative; - overflow:hidden; - clear:both; -} -.item .item-field, .new-item .item-field { - padding:10px 0; - clear:both; - overflow:hidden; } .item .image-display, .new-item .image-display { - position:absolute; - top:20px; - right:20px; + text-align:center; } .item .image-display img, .new-item .image-display img { max-width:400px; 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 94% rename from modules/tmhtmlcontent/views/js/admin.js rename to modules/themeconfigurator/views/js/admin.js index de5c2de25..d2f7a8a02 100644 --- a/modules/tmhtmlcontent/views/js/admin.js +++ b/modules/themeconfigurator/views/js/admin.js @@ -1,6 +1,6 @@ jQuery(document).ready(function() { $('.button.new-item').click(function() { - var item_container = $(this).parent('.new-item'); + var item_container = $(this).parent().parent('.new-item'); item_container.toggleClass('active').children('.item-container').slideToggle(); }); $('.button-edit').click(function() { 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/themeconfigurator/views/templates/admin/items.tpl b/modules/themeconfigurator/views/templates/admin/items.tpl new file mode 100644 index 000000000..8cd6e246f --- /dev/null +++ b/modules/themeconfigurator/views/templates/admin/items.tpl @@ -0,0 +1,116 @@ + +
      +{foreach name=langs from=$htmlitems.items key=lang item=langItems} + +
      + {foreach name=hooks from=$langItems key=hook item=hookItems} + +

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

      + {if $hookItems} +
        + {foreach name=items from=$hookItems item=hItem} +
      • + {if $hItem.item_order le 9}0{/if}{$hItem.item_order} + + {$hItem.title} + {l s='Edit' mod='themeconfigurator'} + {l s='Close' mod='themeconfigurator'} + +
        +
        + + + +
        + +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        + + +
        +
        + +
        +
      • + {/foreach} +
      + {else} +
      + {l s='No items available' mod='themeconfigurator'} +
      + {/if} + {/foreach} +
      +{/foreach} +
      diff --git a/modules/themeconfigurator/views/templates/admin/messages.tpl b/modules/themeconfigurator/views/templates/admin/messages.tpl new file mode 100644 index 000000000..da285bda9 --- /dev/null +++ b/modules/themeconfigurator/views/templates/admin/messages.tpl @@ -0,0 +1,3 @@ +
      +
      {if isset($text)}{$text}{/if}
      +
      \ No newline at end of file diff --git a/modules/themeconfigurator/views/templates/admin/new.tpl b/modules/themeconfigurator/views/templates/admin/new.tpl new file mode 100644 index 000000000..4d7c13e2d --- /dev/null +++ b/modules/themeconfigurator/views/templates/admin/new.tpl @@ -0,0 +1,91 @@ +
      +
      + {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} +
      -
      -{foreach name=langs from=$htmlitems.items key=lang item=langItems} - -
      - {foreach name=hooks from=$langItems key=hook item=hookItems} - -

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

      - {if $hookItems} -
        - {foreach name=items from=$hookItems item=hItem} -
      • - {if $hItem.item_order le 9}0{/if}{$hItem.item_order} - - {$hItem.title} - {l s='Edit' mod='tmhtmlcontent'} - {l s='Close' mod='tmhtmlcontent'} - -
        -
        - - - -
        - - -
        -
        - - -
        -
        - - -
        -
        - - -
        -
        - - -
        -
        - -
        -
        - -
        -
        -
        - - -
        -
        - - -
        -
        - - -
        -
        - - -
        - - - -
        -
      • - {/foreach} -
      - {else} -
      - {l s='No items available' mod='tmhtmlcontent'} -
      - {/if} - {/foreach} -
      -{/foreach} -
      diff --git a/modules/tmhtmlcontent/views/templates/admin/messages.tpl b/modules/tmhtmlcontent/views/templates/admin/messages.tpl deleted file mode 100644 index 45f30c839..000000000 --- a/modules/tmhtmlcontent/views/templates/admin/messages.tpl +++ /dev/null @@ -1,3 +0,0 @@ -
      -
      {if isset($text)}{$text}{/if}
      -
      \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/admin/new.tpl b/modules/tmhtmlcontent/views/templates/admin/new.tpl deleted file mode 100644 index 3df5064f6..000000000 --- a/modules/tmhtmlcontent/views/templates/admin/new.tpl +++ /dev/null @@ -1,57 +0,0 @@ -
      - {l s='Add item' mod='tmhtmlcontent'} -
      -
      -
      - -
        - {foreach from=$htmlitems.lang.all item=lang} -
      • {$lang.name}
      • - {/foreach} -
      - -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      -
      -
      -
      - -
      -
      - - -
      -
      - - -
      -
      - - -
      - - -
      -
      diff --git a/modules/tmhtmlcontent/views/templates/hooks/footer.tpl b/modules/tmhtmlcontent/views/templates/hooks/footer.tpl deleted file mode 100644 index ddf20e55d..000000000 --- a/modules/tmhtmlcontent/views/templates/hooks/footer.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{if isset($htmlitems.items) && $htmlitems.items} -
      -{/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 @@ - li { float: left; border-right: 1px solid #d6d4d4; margin-bottom: -3px; } +@media (max-width: 767px) { + .sf-menu > li { + float: none; + position: relative; + border-right: none; + } + .sf-menu > li span { + position: absolute; + right: 6px; + top: 20px; + display: none; + width: 30px; + height: 30px; + z-index: 2; + } + .sf-menu > li span:after { + font-family: "FontAwesome"; + content: ""; + font-size: 26px; + } +} .sf-menu > li > a { font: 600 18px/22px "Open Sans", sans-serif; text-transform: uppercase; @@ -62,14 +90,25 @@ padding: 17px 20px; border-bottom: 3px solid #e9e9e9; } +@media (max-width: 767px) { + .sf-menu > li > a.sf-with-ul:after { + position: absolute; + right: 15px; + top: 18px; + font-family: "FontAwesome"; + content: ""; + font-size: 26px; + z-index: 1; + } +} .sf-menu > li.sfHover > a, .sf-menu > li > a:hover, .sf-menu > li.sfHoverForce > a { background: #333333; border-bottom-color: #666666; color: white; } -.sf-menu li li a { - display: block; +.sf-menu li li li a { + display: inline-block; position: relative; color: #777777; font-size: 13px; @@ -77,13 +116,13 @@ font-weight: bold; padding-bottom: 10px; } -.sf-menu li li a:before { +.sf-menu li li li a:before { content: ""; display: inline-block; font-family: "FontAwesome"; padding-right: 10px; } -.sf-menu li li a:hover { +.sf-menu li li li a:hover { color: #333333; } @@ -93,12 +132,34 @@ top: 59px; /* match top ul list item height */ z-index: 99; - width: 220px; - padding: 25px 30px; + padding: 12px 0px 18px 0px; -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 13px; -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 13px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 13px; } +@media (max-width: 767px) { + .sf-menu li ul { + top: 0; + } +} + +.sf-menu li li ul { + position: static; + display: block !important; + opacity: 1 !important; + background: none; + -webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px; + -moz-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px; + box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px; +} + +.sf-menu li li li ul { + padding: 0 0 0 20px; +} + +.sf-menu li li li ul { + width: 220px; +} ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { @@ -123,3 +184,113 @@ ul.sf-menu li li li.sfHover ul { /* match ul width */ top: 0; } + +.sf-menu > li > ul { + padding: 26px 30px 31px; + width: 100%; +} +.sf-menu > li > ul > li > a { + text-transform: uppercase; + font: 600 16px/20px "Open Sans", sans-serif; + color: #333333; +} +.sf-menu > li > ul > li > a:hover { + color: #515151; +} + +.sf-menu > li > ul > li:not(#category-thumbnail) { + float: left; + width: 20%; + padding-right: 15px; +} +@media (max-width: 767px) { + .sf-menu > li > ul > li:not(#category-thumbnail) { + width: 50%; + } +} +@media (max-width: 479px) { + .sf-menu > li > ul > li:not(#category-thumbnail) { + width: 100%; + } +} +@media (min-width: 768px) { + .sf-menu > li > ul > li:not(#category-thumbnail).first-in-line-lg { + clear: left; + } +} +@media (min-width: 480px) and (max-width: 767px) { + .sf-menu > li > ul > li:not(#category-thumbnail).first-in-line-xs { + clear: left; + } +} + +.sf-menu > li > ul > li#category-thumbnail { + width: 100%; + clear: both; + overflow: hidden; +} +.sf-menu > li > ul > li#category-thumbnail > div { + float: left; + padding-left: 10px; + width: 33.333%; +} +@media (max-width: 479px) { + .sf-menu > li > ul > li#category-thumbnail > div { + width: 100%; + padding-left: 0; + padding-top: 10px; + text-align: center; + } +} +.sf-menu > li > ul > li#category-thumbnail > div:first-child { + padding-left: 0; +} +.sf-menu > li > ul > li#category-thumbnail > div img { + max-width: 100%; + width: 100%; + display: block; +} + +.cat-title { + display: none; +} +@media (max-width: 767px) { + .cat-title { + display: block; + font: 600 18px/22px "Open Sans", sans-serif; + text-transform: uppercase; + color: #484848; + display: block; + padding: 17px 20px; + border-bottom: 3px solid #e9e9e9; + background: #f6f6f6; + position: relative; + } + .cat-title:hover { + background: #333333; + border-bottom-color: #666666; + color: white; + } + .cat-title:after { + display: block; + font-family: "FontAwesome"; + content: ""; + position: absolute; + right: 15px; + top: 18px; + font-size: 26px; + } + .cat-title.active:after { + content: ""; + } +} + +@media (max-width: 767px) { + .sf-menu > li.sfHover > a.sf-with-ul:after, .sf-menu > li.sfHoverForce > a.sf-with-ul:after { + display: none; + } + + .sf-menu > li.sfHover > span, .sf-menu > li.sfHoverForce > span { + display: block; + } +} diff --git a/themes/default-bootstrap/css/modules/blockwishlist/blockwishlist.css b/themes/default-bootstrap/css/modules/blockwishlist/blockwishlist.css index c0e3eddc0..26ec29c50 100644 --- a/themes/default-bootstrap/css/modules/blockwishlist/blockwishlist.css +++ b/themes/default-bootstrap/css/modules/blockwishlist/blockwishlist.css @@ -65,6 +65,11 @@ #wishlist_block .lnk .form-group select { max-width: 192px; } +@media (max-width: 767px) { + #wishlist_block .lnk .form-group select { + width: 192px; + } +} #wishlist_block .ajax_cart_block_remove_link { font-size: 14px; line-height: 14px; diff --git a/themes/default-bootstrap/header.tpl b/themes/default-bootstrap/header.tpl index be2963702..6abefce27 100644 --- a/themes/default-bootstrap/header.tpl +++ b/themes/default-bootstrap/header.tpl @@ -100,13 +100,6 @@
      {/if}
      -
      diff --git a/themes/default-bootstrap/modules/blockspecials/blockspecials.tpl b/themes/default-bootstrap/modules/blockspecials/blockspecials.tpl index 0b01e23d2..5a63f521e 100644 --- a/themes/default-bootstrap/modules/blockspecials/blockspecials.tpl +++ b/themes/default-bootstrap/modules/blockspecials/blockspecials.tpl @@ -51,11 +51,11 @@
      -

      +

      {else} -

      {l s='No specials at this time' mod='blockspecials'}

      +
      {l s='No specials at this time' mod='blockspecials'}
      {/if} diff --git a/themes/default-bootstrap/modules/blocktopmenu/blocktopmenu.tpl b/themes/default-bootstrap/modules/blocktopmenu/blocktopmenu.tpl index a2914e0df..2257fe616 100644 --- a/themes/default-bootstrap/modules/blocktopmenu/blocktopmenu.tpl +++ b/themes/default-bootstrap/modules/blocktopmenu/blocktopmenu.tpl @@ -2,7 +2,8 @@
      -
        +
        {l s="Categories" mod="blocktopmenu"}
        +
      -{/if} \ No newline at end of file + {literal} + + {/literal} +{/if} diff --git a/themes/default-bootstrap/modules/favoriteproducts/views/templates/front/favoriteproducts-account.tpl b/themes/default-bootstrap/modules/favoriteproducts/views/templates/front/favoriteproducts-account.tpl index 471bfec44..cec9cacf7 100644 --- a/themes/default-bootstrap/modules/favoriteproducts/views/templates/front/favoriteproducts-account.tpl +++ b/themes/default-bootstrap/modules/favoriteproducts/views/templates/front/favoriteproducts-account.tpl @@ -83,6 +83,6 @@ $('document').ready(function() \ No newline at end of file diff --git a/themes/default-bootstrap/product-list.tpl b/themes/default-bootstrap/product-list.tpl index 532bcde2b..f902f8e78 100644 --- a/themes/default-bootstrap/product-list.tpl +++ b/themes/default-bootstrap/product-list.tpl @@ -91,6 +91,7 @@ {/if}
      + {hook h='displayProductListReviews' product=$product} {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity > 0)} {if isset($static_token)} diff --git a/themes/default-bootstrap/product.tpl b/themes/default-bootstrap/product.tpl index 0a59c37c8..b1e59efe2 100644 --- a/themes/default-bootstrap/product.tpl +++ b/themes/default-bootstrap/product.tpl @@ -493,15 +493,6 @@ var contentOnly = {if $content_only}true{else}false{/if}
      - - {if !$content_only} -
      -
      {l s='Your Security Guaranteed'}
      - - -
      - - {/if} diff --git a/themes/default-bootstrap/sass/global.scss b/themes/default-bootstrap/sass/global.scss index d3cdd5367..791efec70 100644 --- a/themes/default-bootstrap/sass/global.scss +++ b/themes/default-bootstrap/sass/global.scss @@ -240,6 +240,9 @@ input.button_large, input.button_large_disabled, input.exclusive_large, input.ex /*width: 180px; background-image: url('../img/button-large.png')*/ } +.btn.disabled, .btn[disabled]:hover { + opacity:0.3; +} .button.button-small { font:bold 13px/17px $font-famaly; color:$button-text-color; @@ -824,8 +827,20 @@ table.table_block td { margin-bottom:34px; } } -.block {margin-bottom:30px} -.block { +.block { + margin-bottom:30px; + @media (max-width: $screen-xs-max) { // max 767px + margin-bottom:0px; + } + .block_content { + @media (max-width: $screen-xs-max) { // max 767px + margin-bottom:20px; + } + } + +} +.block { + .title_block, h4 { font:600 18px/22px $font-custom; @@ -837,7 +852,27 @@ table.table_block td { margin-bottom:20px; @media (min-width: $screen-sm) and (max-width: $screen-sm-max) { font-size:14px; - } + } + // heading style for devices smaller that 767px width + @media (max-width: $screen-xs-max) { // max 767px + position:relative; + + &:after { + display:block; + font-family:$font-icon; + content:""; + position:absolute; + right:0; + top:15px; + height:36px; + width:36px; + font-size:26px; + font-weight:normal; + } + &.active:after { + content:""; + } + } a { color:$base-heading-color; @@ -860,6 +895,9 @@ table.table_block td { } .list-block { margin-top:-8px; + @media (max-width: $screen-xs-max) { // max 767px + margin-top:0; + } li { padding:5px 0 6px 20px; @@ -888,9 +926,13 @@ table.table_block td { .form-group { padding-top:20px; border-top:1px solid $base-border-color; + margin-bottom:0; select { - max-width:270px; + max-width:270px; + @media (max-width: $screen-xs-max) { // max 767px + width:270px; + } } } @@ -1858,7 +1900,10 @@ div.star_hover a, div.star a:hover { background-position: 0 -32px } color:#777; position:relative; .footer-block { - margin-top:45px; + margin-top:45px; + @media (max-width: $screen-xs-max) { // max 767px + margin-top:20px; + } } a { @@ -1873,6 +1918,23 @@ div.star_hover a, div.star a:hover { background-position: 0 -32px } font:600 18px/22px $font-custom; color:$light-text-color; margin:0 0 13px 0; + @media (max-width: $screen-xs-max) { // max 767px + position:relative; + margin-bottom:0; + padding-bottom:13px; + + &:after { + display:block; + content:""; + font-family:$font-icon; + position:absolute; + right:0; + top:1px; + } + &.active:after { + content:""; + } + } a {color:$light-text-color;} } @@ -2946,7 +3008,7 @@ div.star_hover a, div.star a:hover { background-position: 0 -13px } input, textarea { border:1px solid #46a74e; color:#35b33f; - background: url(../img/icon/form-ok.png) 98% 5px no-repeat #87f590; + background: url(../img/icon/form-ok.png) 98% 5px no-repeat #ddf9e1; } } &.form-error, &.form-ok { diff --git a/themes/default-bootstrap/sass/modules/blockcontact/blockcontact.scss b/themes/default-bootstrap/sass/modules/blockcontact/blockcontact.scss index 6c4b4284e..ffa3d05de 100644 --- a/themes/default-bootstrap/sass/modules/blockcontact/blockcontact.scss +++ b/themes/default-bootstrap/sass/modules/blockcontact/blockcontact.scss @@ -1,7 +1,9 @@ @import '../../_theme_variables'; /* block CONTACT ******************************************************************************* */ #contact_block { - + @media (max-width: $screen-xs-max) { // max 767px + margin-bottom:20px; + } .label {display: none} .block_content { diff --git a/themes/default-bootstrap/sass/modules/blocknewsletter/blocknewsletter.scss b/themes/default-bootstrap/sass/modules/blocknewsletter/blocknewsletter.scss index d3664ce0c..a6257c622 100644 --- a/themes/default-bootstrap/sass/modules/blocknewsletter/blocknewsletter.scss +++ b/themes/default-bootstrap/sass/modules/blocknewsletter/blocknewsletter.scss @@ -52,6 +52,7 @@ font-size:21px; line-height:25px; border:none; + &:after {display:none;} } .block_content { diff --git a/themes/default-bootstrap/sass/modules/blocktopmenu/css/superfish-modified.scss b/themes/default-bootstrap/sass/modules/blocktopmenu/css/superfish-modified.scss index a3f7c34a7..c38417b6a 100644 --- a/themes/default-bootstrap/sass/modules/blocktopmenu/css/superfish-modified.scss +++ b/themes/default-bootstrap/sass/modules/blocktopmenu/css/superfish-modified.scss @@ -2,6 +2,15 @@ /*** ESSENTIAL STYLES ***/ .sf-contener { clear:both; + float:left; + width:100%; + margin: 50px 0 0; + @media (min-width: $screen-xs) and (max-width: $screen-xs-max) { // min 480px max 767px + margin-top:80px; + } + @media (max-width: $screen-xs - 1) { // max 479px + margin-top:70px; + } } .sf-right { } @@ -11,23 +20,22 @@ list-style: none; } .sf-menu { - margin: 50px 0 0; + position: relative; padding: 0; width: 100%; border-bottom: 3px solid #e9e9e9; background: #f6f6f6; - @media (min-width: $screen-xs) and (max-width: $screen-xs-max) { // min 480px max 767px - margin-top:80px; - } - @media (max-width: $screen-xs - 1) { // max 479px - margin-top:70px; + @media (max-width: $screen-xs-max) { // max 767px + display:none; } } .sf-menu ul { position: absolute; top: -999em; - width: 10em; /* left offset of submenus need to match (see below) */ background: $light-background; + @media (max-width: $screen-xs-max) { // max 767px + position:relative; + } } .sf-menu ul li { width: 100%; @@ -35,14 +43,31 @@ .sf-menu li:hover { visibility: inherit; /* fixes IE7 'sticky bug' */ } -.sf-menu li { - position: relative; -} .sf-menu > li { float: left; border-right: 1px solid $base-border-color; margin-bottom: -3px; - + @media (max-width: $screen-xs-max) { // max 767px + float:none; + position:relative; + border-right:none; + + span { + position:absolute; + right:6px; + top:20px; + display:none; + width:30px; + height:30px; + z-index:2; + + &:after { + font-family:$font-icon; + content:""; + font-size:26px; + } + } + } > a { font: 600 18px/22px $font-custom; text-transform: uppercase; @@ -50,6 +75,19 @@ display: block; padding: 17px 20px; border-bottom: 3px solid #e9e9e9; + @media (max-width: $screen-xs-max) { // max 767px + &.sf-with-ul { + &:after { + position:absolute; + right:15px; + top:18px; + font-family:$font-icon; + content:""; + font-size:26px; + z-index:1; + } + } + } } &.sfHover > a, > a:hover, &.sfHoverForce > a { @@ -58,8 +96,8 @@ color: $light-text-color; } } -.sf-menu li li a { - display: block; +.sf-menu li li li a { + display: inline-block; position: relative; color: #777777; font-size: 13px; @@ -83,9 +121,24 @@ left: 0; top: 59px; /* match top ul list item height */ z-index: 99; - width: 220px; - padding: 25px 30px; + padding: 12px 0px 18px 0px; @include box-shadow(rgba(black, 0.20) 0px 5px 13px); + @media (max-width: $screen-xs-max) { // max 767px + top:0; + } +} +.sf-menu li li ul { + position:static; + display:block !important; + opacity:1 !important; + background:none; + @include box-shadow(rgba(black, 0) 0px 0px 0px); +} +.sf-menu li li li ul { + padding:0 0 0 20px; +} +.sf-menu li li li ul { + width: 220px; } ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { @@ -105,3 +158,100 @@ ul.sf-menu li li li.sfHover ul { left: 200px; /* match ul width */ top: 0; } +.sf-menu > li > ul { + padding:26px 30px 31px; + width:100%; + + > li { + > a { + text-transform:uppercase; + font:600 16px/20px $font-custom; + color:$base-text-color; + + &:hover { + color:$link-hover-color; + } + } + } +} +.sf-menu > li > ul > li:not(#category-thumbnail) { + float:left; + width:20%; + padding-right:15px; + @media (max-width: $screen-xs-max) { // max 767px + width:50%; + } + @media (max-width: $screen-xs - 1) { // max 479px + width:100%; + } + @media (min-width: $screen-sm) { // min 768px + &.first-in-line-lg {clear:left;} + } + @media (min-width: $screen-xs) and (max-width: $screen-xs-max) { // min 480px max 767px + &.first-in-line-xs {clear:left;} + } +} +.sf-menu > li > ul > li#category-thumbnail { + width:100%; + clear:both; + overflow:hidden; + + > div { + float:left; + padding-left:10px; + width:33.333%; + @media (max-width: $screen-xs - 1) { // max 479px + width:100%; + padding-left:0; + padding-top:10px; + text-align:center; + } + + &:first-child {padding-left:0;} + img { + max-width:100%; + width:100%; + display:block; + } + } +} +.cat-title { + display:none; + @media (max-width: $screen-xs-max) { // max 767px + display: block; + font: 600 18px/22px $font-custom; + text-transform: uppercase; + color: #484848; + display: block; + padding: 17px 20px; + border-bottom: 3px solid #e9e9e9; + background: #f6f6f6; + position:relative; + + &:hover { + background: $dark-background; + border-bottom-color: #666666; + color: $light-text-color; + } + &:after { + display:block; + font-family:$font-icon; + content:""; + position:absolute; + right:15px; + top:18px; + font-size:26px; + } + &.active:after{ + content:""; + } + } +} +@media (max-width: $screen-xs-max) { // max 767px +.sf-menu > li.sfHover > a.sf-with-ul:after, .sf-menu > li.sfHoverForce > a.sf-with-ul:after { + display:none; +} +.sf-menu > li.sfHover > span, .sf-menu > li.sfHoverForce > span { + display:block; +} +} \ No newline at end of file diff --git a/themes/default-bootstrap/sass/modules/blockwishlist/blockwishlist.scss b/themes/default-bootstrap/sass/modules/blockwishlist/blockwishlist.scss index 5c665959f..18a423054 100644 --- a/themes/default-bootstrap/sass/modules/blockwishlist/blockwishlist.scss +++ b/themes/default-bootstrap/sass/modules/blockwishlist/blockwishlist.scss @@ -77,7 +77,10 @@ margin-bottom:20px; select { - max-width:192px; + max-width:192px; + @media (max-width: $screen-xs-max) { // max 767px + width:192px; + } } } }
      {$goals_year}{l s='Traffic' mod='dashgoals'}{l s='Conversion Rate' mod='dashgoals'}{l s='Average Cart Value' mod='dashgoals'}{$goals_year}{l s='Traffic' mod='dashgoals'}{l s='Conversion Rate' mod='dashgoals'}{l s='Average Cart Value' mod='dashgoals'} {l s='Sales' mod='dashgoals'}