Example #1
0
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version //autogentag//
 * @package kernel
 */
$module = $Params['Module'];
$offset = $Params['Offset'];
$error = false;
if ($module->hasActionParameter('Offset')) {
    $offset = $module->actionParameter('Offset');
}
if ($module->isCurrentAction('NewCurrency')) {
    $module->redirectTo($module->functionURI('editcurrency'));
} else {
    if ($module->isCurrentAction('RemoveCurrency')) {
        $currencyList = $module->hasActionParameter('DeleteCurrencyList') ? $module->actionParameter('DeleteCurrencyList') : array();
        eZShopFunctions::removeCurrency($currencyList);
        eZContentCacheManager::clearAllContentCache();
    } else {
        if ($module->isCurrentAction('ApplyChanges')) {
            $updateDataList = $module->hasActionParameter('CurrencyList') ? $module->actionParameter('CurrencyList') : array();
            $currencyList = eZCurrencyData::fetchList();
            $db = eZDB::instance();
            $db->begin();
            foreach ($currencyList as $currency) {
                $currencyCode = $currency->attribute('code');
                if (isset($updateDataList[$currencyCode])) {
                    $updateData = $updateDataList[$currencyCode];
                    if (isset($updateData['status'])) {
                        $currency->setStatus($updateData['status']);
                    }
                    if (is_numeric($updateData['custom_rate_value'])) {