[*] MO : updated module blockcurrencies for mobile theme

This commit is contained in:
mBertholino
2012-02-27 16:55:00 +00:00
parent f96e6f6321
commit fa05c2f59f
3 changed files with 55 additions and 21 deletions
+14 -9
View File
@@ -49,6 +49,16 @@ class BlockCurrencies extends Module
return parent::install() && $this->registerHook('top') && $this->registerHook('header');
}
private function _prepareHook($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return;
if (!count(Currency::getCurrencies()))
return '';
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
}
/**
* Returns module content for header
*
@@ -57,12 +67,7 @@ class BlockCurrencies extends Module
*/
public function hookTop($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return;
if (!count(Currency::getCurrencies()))
return '';
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
$this->_prepareHook($params);
return $this->display(__FILE__, 'blockcurrencies.tpl');
}
@@ -73,10 +78,10 @@ class BlockCurrencies extends Module
$this->context->controller->addCSS(($this->_path).'blockcurrencies.css', 'all');
}
public function hookMobileFooterChoice($params)
public function hookDisplayMobileFooterChoice($params)
{
$this->smarty->assign('hook_mobile', true);
$this->hookTop($params);
$this->_prepareHook($params);
return $this->display(__FILE__, 'blockmobilecurrencies.tpl');
}
}
@@ -61,16 +61,4 @@ $(document).ready(function () {
</ul>
</form>
</div>
{if isset($hook_mobile)}
<div class="ui-block-a">
<div data-role="fieldcontain">
<select name="select-choice-1" id="select-choice-1">
<option value="standard">€ Euros</option>
<option value="rush">$ Dollars</option>
</select>
</div>
</div>
{/if}
<!-- /Block currencies module -->
@@ -0,0 +1,41 @@
{*
* 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 <contact@prestashop.com>
* @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
*}
<!-- Block Mobile currencies module -->
<div class="ui-block-a">
<div data-role="fieldcontain">
<form id="setCurrency" action="{$request_uri}" method="post">
<select onchange="javascript:setCurrency(this.value)" name="select-choice-1" id="select-choice-1">
{foreach from=$currencies key=k item=f_currency}
<option value="{$f_currency.id_currency}" {if $cookie->id_currency == $f_currency.id_currency}selected="selected"{/if}>{$f_currency.sign} {$f_currency.name}</option>
{/foreach}
</select>
</form>
</div>
</div>
<!-- /Block Mobile currencies module -->