diff --git a/modules/blockcms/blockcms.php b/modules/blockcms/blockcms.php index 489079a68..60bc07afd 100755 --- a/modules/blockcms/blockcms.php +++ b/modules/blockcms/blockcms.php @@ -672,6 +672,31 @@ class BlockCms extends Module return $this->display(__FILE__, 'blockcms.tpl'); } + private function _prepareHook($params) + { + $block_activation = Configuration::get('FOOTER_BLOCK_ACTIVATION'); + + if (!$block_activation) + return false; + + $cms_titles = BlockCMSModel::getCMSTitlesFooter(); + $display_footer = Configuration::get('PS_STORES_DISPLAY_FOOTER'); + $display_poweredby = Configuration::get('FOOTER_POWEREDBY'); + $footer_text = Configuration::get('FOOTER_CMS_TEXT_'.(int)$this->context->language->id); + + $this->smarty->assign( + array( + 'block' => 0, + 'cmslinks' => $cms_titles, + 'display_stores_footer' => $display_footer, + 'display_poweredby' => ((int)$display_poweredby === 1 || $display_poweredby === false), + 'footer_text' => $footer_text + ) + ); + return true; + } + + public function hookHeader($params) { $this->context->controller->addCSS(($this->_path).'blockcms.css', 'all'); @@ -689,27 +714,16 @@ class BlockCms extends Module public function hookFooter() { - $block_activation = Configuration::get('FOOTER_BLOCK_ACTIVATION'); + if (!$this->_prepareHook($params)) + return ; + return $this->display(__FILE__, 'blockcms.tpl'); + } - if ($block_activation) - { - $cms_titles = BlockCMSModel::getCMSTitlesFooter(); - $display_footer = Configuration::get('PS_STORES_DISPLAY_FOOTER'); - $display_poweredby = Configuration::get('FOOTER_POWEREDBY'); - $footer_text = Configuration::get('FOOTER_CMS_TEXT_'.(int)$this->context->language->id); - - $this->smarty->assign( - array( - 'block' => 0, - 'cmslinks' => $cms_titles, - 'display_stores_footer' => $display_footer, - 'display_poweredby' => ((int)$display_poweredby === 1 || $display_poweredby === false), - 'footer_text' => $footer_text - ) - ); - return $this->display(__FILE__, 'blockcms.tpl'); - } - return; + public function hookDisplayMobileFooterCms($params) + { + if (!$this->_prepareHook($params)) + return ; + return $this->display(__FILE__, 'blockmobilecms.tpl'); } } diff --git a/modules/blockcms/blockmobilecms.tpl b/modules/blockcms/blockmobilecms.tpl new file mode 100644 index 000000000..ba2e1164e --- /dev/null +++ b/modules/blockcms/blockmobilecms.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2012 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-2012 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + \ No newline at end of file diff --git a/modules/blocknewsletter/blockmobilenewsletter.tpl b/modules/blocknewsletter/blockmobilenewsletter.tpl new file mode 100644 index 000000000..4921b0c59 --- /dev/null +++ b/modules/blocknewsletter/blockmobilenewsletter.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2012 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-2012 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
+

Newsletter

+
+
+ + +
+ +
+
+
+
\ No newline at end of file diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index fa3cba8f5..89068d9dc 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -462,7 +462,7 @@ class Blocknewsletter extends Module return $this->hookDisplayLeftColumn($params); } - public function hookDisplayLeftColumn($params) + private function _prepareHook($params) { if (Tools::isSubmit('submitNewsletter')) { @@ -470,21 +470,26 @@ class Blocknewsletter extends Module if ($this->error) { $this->smarty->assign(array('color' => 'red', - 'msg' => $this->error, - 'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false, - 'nw_error' => true, - 'action' => $_POST['action']) + 'msg' => $this->error, + 'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false, + 'nw_error' => true, + 'action' => $_POST['action']) ); } else if ($this->valid) { $this->smarty->assign(array('color' => 'green', - 'msg' => $this->valid, - 'nw_error' => false) + 'msg' => $this->valid, + 'nw_error' => false) ); } } $this->smarty->assign('this_path', $this->_path); + } + + public function hookDisplayLeftColumn($params) + { + $this->_prepareHook($params); return $this->display(__FILE__, 'blocknewsletter.tpl'); } @@ -492,6 +497,13 @@ class Blocknewsletter extends Module { $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); } + + public function hookDisplayMobileIndex() + { + $this->_prepareHook($params); + return $this->display(__FILE__, 'blockmobilenewsletter.tpl'); + } +} }