first commit
This commit is contained in:
30
class/smarty_plugins/block.change_currency.php
Normal file
30
class/smarty_plugins/block.change_currency.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: block.change_currency.php
|
||||
* Type: block
|
||||
* Name: change_currency
|
||||
* Purpose: Override active currency for content inside block
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_block_change_currency($params, $content, Smarty_Internal_Template $template, &$repeat)
|
||||
{
|
||||
// Initial call
|
||||
if ($repeat) {
|
||||
if (!array_key_exists('currency', $params)) {
|
||||
user_error('Block change_currency: Missing parameter "currency"');
|
||||
$params['currency'] = 'CZK';
|
||||
}
|
||||
|
||||
changeCurrency($params['currency']);
|
||||
}
|
||||
|
||||
// Ending call
|
||||
if (!$repeat) {
|
||||
changeCurrency();
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user