public static function execute($data) { $language = Languages::get($data['id']); $export_array = array(); if ($data['include_data'] === true) { $export_array['language']['data'] = array('title-CDATA' => $language['name'], 'code-CDATA' => $language['code'], 'locale-CDATA' => $language['locale'], 'character_set-CDATA' => $language['charset'], 'text_direction-CDATA' => $language['text_direction'], 'date_format_short-CDATA' => $language['date_format_short'], 'date_format_long-CDATA' => $language['date_format_long'], 'time_format-CDATA' => $language['time_format'], 'default_currency-CDATA' => Currencies::get($language['currencies_id'], 'code'), 'numerical_decimal_separator-CDATA' => $language['numeric_separator_decimal'], 'numerical_thousands_separator-CDATA' => $language['numeric_separator_thousands']); if ($language['parent_id'] > 0) { $export_array['language']['data']['parent_language_code'] = Languages::get($language['parent_id'], 'code'); } } $definitions = Languages::getDefinitions($data['id'], $data['groups']); $definitions = $definitions['entries']; foreach ($definitions as $def) { $export_array['language']['definitions']['definition'][] = array('key' => $def['definition_key'], 'value-CDATA' => $def['definition_value'], 'group' => $def['content_group']); } $xml = XML::fromArray($export_array, $language['charset']); header('Content-disposition: attachment; filename=' . $language['code'] . '.xml'); header('Content-Type: application/force-download'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . strlen($xml)); header('Pragma: no-cache'); header('Expires: 0'); echo $xml; exit; }
public static function execute(ApplicationAbstract $application) { if (Currencies::delete($_GET['id'])) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } OSCOM::redirect(OSCOM::getLink()); }
public static function execute(ApplicationAbstract $application) { $data = array('id' => isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, 'title' => $_POST['title'], 'code' => $_POST['code'], 'symbol_left' => $_POST['symbol_left'], 'symbol_right' => $_POST['symbol_right'], 'decimal_places' => $_POST['decimal_places'], 'value' => $_POST['value'], 'set_default' => isset($_POST['default']) && $_POST['default'] == 'on' || isset($_POST['is_default']) && $_POST['is_default'] == 'true' && $_POST['code'] != DEFAULT_CURRENCY); if (Currencies::save($data)) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } osc_redirect_admin(OSCOM::getLink()); }
public static function execute(ApplicationAbstract $application) { if (isset($_POST['service']) && ($_POST['service'] == 'oanda' || $_POST['service'] == 'xe')) { $results = Currencies::updateRates($_POST['service']); foreach ($results[0] as $result) { Registry::get('MessageStack')->add(null, sprintf(OSCOM::getDef('ms_error_invalid_currency'), $result['title'], $result['code']), 'error'); } foreach ($results[1] as $result) { Registry::get('MessageStack')->add(null, sprintf(OSCOM::getDef('ms_success_currency_updated'), $result['title'], $result['code']), 'success'); } } osc_redirect_admin(OSCOM::getLink()); }
public static function execute(ApplicationAbstract $application) { $error = false; foreach ($_POST['batch'] as $id) { if (!Currencies::delete($id)) { $error = true; break; } } if ($error === false) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } osc_redirect_admin(OSCOM::getLink()); }
public static function execute() { if (!isset($_GET['search'])) { $_GET['search'] = ''; } if (!isset($_GET['page']) || !is_numeric($_GET['page'])) { $_GET['page'] = 1; } if (!empty($_GET['search'])) { $result = Currencies::find($_GET['search'], $_GET['page']); } else { $result = Currencies::getAll($_GET['page']); } $result['rpcStatus'] = RPC::STATUS_SUCCESS; echo json_encode($result); }
public static function execute($service) { $updated = array('0' => array(), '1' => array()); $currencies = Currencies::getAll(-1); $currencies = $currencies['entries']; foreach ($currencies as $currency) { $data = array('id' => $currency['currencies_id'], 'rate' => call_user_func('quote_' . $service . '_currency', $currency['code'])); if (!empty($data['rate']) && OSCOM::callDB('Admin\\Currencies\\UpdateRate', $data)) { $updated[1][] = array('title' => $currency['title'], 'code' => $currency['code']); } else { $updated[0][] = array('title' => $currency['title'], 'code' => $currency['code']); } } if (!empty($updated[1])) { Cache::clear('currencies'); } return $updated; }
public static function execute($data) { $source = array('language' => XML::toArray(simplexml_load_file(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $data['code'] . '.xml'))); $language = array('name' => $source['language']['data']['title'], 'code' => $source['language']['data']['code'], 'locale' => $source['language']['data']['locale'], 'charset' => $source['language']['data']['character_set'], 'date_format_short' => $source['language']['data']['date_format_short'], 'date_format_long' => $source['language']['data']['date_format_long'], 'time_format' => $source['language']['data']['time_format'], 'text_direction' => $source['language']['data']['text_direction'], 'currency' => $source['language']['data']['default_currency'], 'numeric_separator_decimal' => $source['language']['data']['numerical_decimal_separator'], 'numeric_separator_thousands' => $source['language']['data']['numerical_thousands_separator'], 'parent_language_code' => isset($source['language']['data']['parent_language_code']) ? $source['language']['data']['parent_language_code'] : '', 'parent_id' => 0); if (!Currencies::exists($language['currency'])) { $language['currency'] = DEFAULT_CURRENCY; } $language['currencies_id'] = Currencies::get($language['currency'], 'currencies_id'); if (!empty($language['parent_language_code']) && Languages::exists($language['parent_language_code'])) { $language['parent_id'] = Languages::get($language['parent_language_code'], 'languages_id'); } $language['id'] = Languages::get($language['code'], 'languages_id'); $language['default_language_id'] = Languages::get(DEFAULT_LANGUAGE, 'languages_id'); $language['import_type'] = $data['type']; $definitions = array(); if (isset($source['language']['definitions']['definition'])) { $definitions = $source['language']['definitions']['definition']; if (isset($definitions['key']) && isset($definitions['value']) && isset($definitions['group'])) { $definitions = array(array('key' => $definitions['key'], 'value' => $definitions['value'], 'group' => $definitions['group'])); } } unset($source); $OSCOM_DirectoryListing = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $data['code']); $OSCOM_DirectoryListing->setRecursive(true); $OSCOM_DirectoryListing->setIncludeDirectories(false); $OSCOM_DirectoryListing->setAddDirectoryToFilename(true); $OSCOM_DirectoryListing->setCheckExtension('xml'); foreach ($OSCOM_DirectoryListing->getFiles() as $files) { $definitions = array_merge($definitions, Language::extractDefinitions($data['code'] . '/' . $files['name'])); } $language['definitions'] = $definitions; if (OSCOM::callDB('Admin\\Languages\\Import', $language)) { Cache::clear('languages'); return true; } return false; }
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation. */ use osCommerce\OM\Core\OSCOM; use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages; use osCommerce\OM\Core\Site\Admin\Application\Currencies\Currencies; use osCommerce\OM\Core\ObjectInfo; $languages_array = array(array('id' => '0', 'text' => OSCOM::getDef('none'))); foreach (osc_toObjectInfo(Languages::getAll(-1))->get('entries') as $l) { if ($l['languages_id'] != $_GET['id']) { $languages_array[] = array('id' => $l['languages_id'], 'text' => $l['name'] . ' (' . $l['code'] . ')'); } } $currencies_array = array(); foreach (osc_toObjectInfo(Currencies::getAll(-1))->get('entries') as $c) { $currencies_array[] = array('id' => $c['currencies_id'], 'text' => $c['title']); } $OSCOM_ObjectInfo = new ObjectInfo(Languages::get($_GET['id'])); ?> <h1><?php echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?>
public static function import($file, $type) { $OSCOM_Database = Registry::get('Database'); if (file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $file . '.xml')) { $source = array('language' => XML::toArray(simplexml_load_file(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $file . '.xml'))); $language = array('name' => $source['language']['data']['title'], 'code' => $source['language']['data']['code'], 'locale' => $source['language']['data']['locale'], 'charset' => $source['language']['data']['character_set'], 'date_format_short' => $source['language']['data']['date_format_short'], 'date_format_long' => $source['language']['data']['date_format_long'], 'time_format' => $source['language']['data']['time_format'], 'text_direction' => $source['language']['data']['text_direction'], 'currency' => $source['language']['data']['default_currency'], 'numeric_separator_decimal' => $source['language']['data']['numerical_decimal_separator'], 'numeric_separator_thousands' => $source['language']['data']['numerical_thousands_separator'], 'parent_language_code' => isset($source['language']['data']['parent_language_code']) ? $source['language']['data']['parent_language_code'] : '', 'parent_id' => 0); if (!Currencies::exists($language['currency'])) { $language['currency'] = DEFAULT_CURRENCY; } if (!empty($language['parent_language_code']) && self::exists($language['parent_language_code'])) { $language['parent_id'] = self::get($language['parent_language_code'], 'languages_id'); } $definitions = array(); if (isset($source['language']['definitions']['definition'])) { $definitions = $source['language']['definitions']['definition']; if (isset($definitions['key']) && isset($definitions['value']) && isset($definitions['group'])) { $definitions = array(array('key' => $definitions['key'], 'value' => $definitions['value'], 'group' => $definitions['group'])); } } unset($source); $error = false; $add_category_and_product_placeholders = true; $OSCOM_Database->startTransaction(); $language_id = self::get($language['code'], 'languages_id'); if ($language_id !== false) { $add_category_and_product_placeholders = false; $Qlanguage = $OSCOM_Database->query('update :table_languages set name = :name, code = :code, locale = :locale, charset = :charset, date_format_short = :date_format_short, date_format_long = :date_format_long, time_format = :time_format, text_direction = :text_direction, currencies_id = :currencies_id, numeric_separator_decimal = :numeric_separator_decimal, numeric_separator_thousands = :numeric_separator_thousands, parent_id = :parent_id where languages_id = :languages_id'); $Qlanguage->bindInt(':languages_id', $language_id); } else { $Qlanguage = $OSCOM_Database->query('insert into :table_languages (name, code, locale, charset, date_format_short, date_format_long, time_format, text_direction, currencies_id, numeric_separator_decimal, numeric_separator_thousands, parent_id) values (:name, :code, :locale, :charset, :date_format_short, :date_format_long, :time_format, :text_direction, :currencies_id, :numeric_separator_decimal, :numeric_separator_thousands, :parent_id)'); } $Qlanguage->bindValue(':name', $language['name']); $Qlanguage->bindValue(':code', $language['code']); $Qlanguage->bindValue(':locale', $language['locale']); $Qlanguage->bindValue(':charset', $language['charset']); $Qlanguage->bindValue(':date_format_short', $language['date_format_short']); $Qlanguage->bindValue(':date_format_long', $language['date_format_long']); $Qlanguage->bindValue(':time_format', $language['time_format']); $Qlanguage->bindValue(':text_direction', $language['text_direction']); $Qlanguage->bindInt(':currencies_id', Currencies::get($language['currency'], 'currencies_id')); $Qlanguage->bindValue(':numeric_separator_decimal', $language['numeric_separator_decimal']); $Qlanguage->bindValue(':numeric_separator_thousands', $language['numeric_separator_thousands']); $Qlanguage->bindInt(':parent_id', $language['parent_id']); $Qlanguage->setLogging(null, $language_id !== false ? $language_id : null); $Qlanguage->execute(); if ($OSCOM_Database->isError()) { $error = true; } else { if ($language_id === false) { $language_id = $OSCOM_Database->nextID(); } $default_language_id = self::get(DEFAULT_LANGUAGE, 'languages_id'); if ($type == 'replace') { $Qdel = $OSCOM_Database->query('delete from :table_languages_definitions where languages_id = :languages_id'); $Qdel->bindInt(':languages_id', $language_id); $Qdel->execute(); if ($OSCOM_Database->isError()) { $error = true; } } } if ($error === false) { $OSCOM_DirectoryListing = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $file); $OSCOM_DirectoryListing->setRecursive(true); $OSCOM_DirectoryListing->setIncludeDirectories(false); $OSCOM_DirectoryListing->setAddDirectoryToFilename(true); $OSCOM_DirectoryListing->setCheckExtension('xml'); foreach ($OSCOM_DirectoryListing->getFiles() as $files) { $definitions = array_merge($definitions, Language::extractDefinitions($file . '/' . $files['name'])); } foreach ($definitions as $def) { $insert = false; $update = false; if ($type == 'replace') { $insert = true; } else { $Qcheck = $OSCOM_Database->query('select definition_key, content_group from :table_languages_definitions where definition_key = :definition_key and languages_id = :languages_id and content_group = :content_group'); $Qcheck->bindValue(':definition_key', $def['key']); $Qcheck->bindInt(':languages_id', $language_id); $Qcheck->bindValue(':content_group', $def['group']); $Qcheck->execute(); if ($Qcheck->numberOfRows() > 0) { if ($type == 'update') { $update = true; } } elseif ($type == 'add') { $insert = true; } } if ($insert === true || $update === true) { if ($insert === true) { $Qdef = $OSCOM_Database->query('insert into :table_languages_definitions (languages_id, content_group, definition_key, definition_value) values (:languages_id, :content_group, :definition_key, :definition_value)'); } else { $Qdef = $OSCOM_Database->query('update :table_languages_definitions set content_group = :content_group, definition_key = :definition_key, definition_value = :definition_value where definition_key = :definition_key and languages_id = :languages_id and content_group = :content_group'); $Qdef->bindValue(':definition_key', $def['key']); $Qdef->bindValue(':content_group', $def['group']); } $Qdef->bindInt(':languages_id', $language_id); $Qdef->bindValue(':content_group', $def['group']); $Qdef->bindValue(':definition_key', $def['key']); $Qdef->bindValue(':definition_value', $def['value']); $Qdef->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } } if ($add_category_and_product_placeholders === true) { if ($error === false) { $Qcategories = $OSCOM_Database->query('select categories_id, categories_name from :table_categories_description where language_id = :language_id'); $Qcategories->bindInt(':language_id', $default_language_id); $Qcategories->execute(); while ($Qcategories->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_categories_description (categories_id, language_id, categories_name) values (:categories_id, :language_id, :categories_name)'); $Qinsert->bindInt(':categories_id', $Qcategories->valueInt('categories_id')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':categories_name', $Qcategories->value('categories_name')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qproducts = $OSCOM_Database->query('select products_id, products_name, products_description, products_keyword, products_tags, products_url from :table_products_description where language_id = :language_id'); $Qproducts->bindInt(':language_id', $default_language_id); $Qproducts->execute(); while ($Qproducts->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_keyword, products_tags, products_url) values (:products_id, :language_id, :products_name, :products_description, :products_keyword, :products_tags, :products_url)'); $Qinsert->bindInt(':products_id', $Qproducts->valueInt('products_id')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':products_name', $Qproducts->value('products_name')); $Qinsert->bindValue(':products_description', $Qproducts->value('products_description')); $Qinsert->bindValue(':products_keyword', $Qproducts->value('products_keyword')); $Qinsert->bindValue(':products_tags', $Qproducts->value('products_tags')); $Qinsert->bindValue(':products_url', $Qproducts->value('products_url')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qattributes = $OSCOM_Database->query('select products_id, value from :table_product_attributes where languages_id = :languages_id'); $Qattributes->bindInt(':languages_id', $default_language_id); $Qattributes->execute(); while ($Qattributes->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_product_attributes (products_id, languages_id, value) values (:products_id, :languages_id, :value)'); $Qinsert->bindInt(':products_id', $Qattributes->valueInt('products_id')); $Qinsert->bindInt(':languages_id', $language_id); $Qinsert->bindValue(':value', $Qattributes->value('value')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qgroups = $OSCOM_Database->query('select id, title, sort_order, module from :table_products_variants_groups where languages_id = :languages_id'); $Qgroups->bindInt(':languages_id', $default_language_id); $Qgroups->execute(); while ($Qgroups->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_products_variants_groups (id, languages_id, title, sort_order, module) values (:id, :languages_id, :title, :sort_order, :module)'); $Qinsert->bindInt(':id', $Qgroups->valueInt('id')); $Qinsert->bindInt(':languages_id', $language_id); $Qinsert->bindValue(':title', $Qgroups->value('title')); $Qinsert->bindInt(':sort_order', $Qgroups->valueInt('sort_order')); $Qinsert->bindValue(':module', $Qgroups->value('module')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qvalues = $OSCOM_Database->query('select id, products_variants_groups_id, title, sort_order from :table_products_variants_values where languages_id = :languages_id'); $Qvalues->bindInt(':languages_id', $default_language_id); $Qvalues->execute(); while ($Qvalues->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_products_variants_values (id, languages_id, products_variants_groups_id, title, sort_order) values (:id, :languages_id, :products_variants_groups_id, :title, :sort_order)'); $Qinsert->bindInt(':id', $Qvalues->valueInt('id')); $Qinsert->bindInt(':languages_id', $language_id); $Qinsert->bindInt(':products_variants_groups_id', $Qvalues->valueInt('products_variants_groups_id')); $Qinsert->bindValue(':title', $Qvalues->value('title')); $Qinsert->bindInt(':sort_order', $Qvalues->valueInt('sort_order')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qmanufacturers = $OSCOM_Database->query('select manufacturers_id, manufacturers_url from :table_manufacturers_info where languages_id = :languages_id'); $Qmanufacturers->bindInt(':languages_id', $default_language_id); $Qmanufacturers->execute(); while ($Qmanufacturers->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_manufacturers_info (manufacturers_id, languages_id, manufacturers_url) values (:manufacturers_id, :languages_id, :manufacturers_url)'); $Qinsert->bindInt(':manufacturers_id', $Qmanufacturers->valueInt('manufacturers_id')); $Qinsert->bindInt(':languages_id', $language_id); $Qinsert->bindValue(':manufacturers_url', $Qmanufacturers->value('manufacturers_url')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qstatus = $OSCOM_Database->query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id'); $Qstatus->bindInt(':language_id', $default_language_id); $Qstatus->execute(); while ($Qstatus->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_orders_status (orders_status_id, language_id, orders_status_name) values (:orders_status_id, :language_id, :orders_status_name)'); $Qinsert->bindInt(':orders_status_id', $Qstatus->valueInt('orders_status_id')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':orders_status_name', $Qstatus->value('orders_status_name')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qstatus = $OSCOM_Database->query('select id, status_name from :table_orders_transactions_status where language_id = :language_id'); $Qstatus->bindInt(':language_id', $default_language_id); $Qstatus->execute(); while ($Qstatus->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_orders_transactions_status (id, language_id, status_name) values (:id, :language_id, :status_name)'); $Qinsert->bindInt(':id', $Qstatus->valueInt('id')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':status_name', $Qstatus->value('status_name')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qstatus = $OSCOM_Database->query('select id, title, css_key from :table_shipping_availability where languages_id = :languages_id'); $Qstatus->bindInt(':languages_id', $default_language_id); $Qstatus->execute(); while ($Qstatus->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_shipping_availability (id, languages_id, title, css_key) values (:id, :languages_id, :title, :css_key)'); $Qinsert->bindInt(':id', $Qstatus->valueInt('id')); $Qinsert->bindInt(':languages_id', $language_id); $Qinsert->bindValue(':title', $Qstatus->value('title')); $Qinsert->bindValue(':css_key', $Qstatus->value('css_key')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qstatus = $OSCOM_Database->query('select weight_class_id, weight_class_key, weight_class_title from :table_weight_classes where language_id = :language_id'); $Qstatus->bindInt(':language_id', $default_language_id); $Qstatus->execute(); while ($Qstatus->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_weight_classes (weight_class_id, weight_class_key, language_id, weight_class_title) values (:weight_class_id, :weight_class_key, :language_id, :weight_class_title)'); $Qinsert->bindInt(':weight_class_id', $Qstatus->valueInt('weight_class_id')); $Qinsert->bindValue(':weight_class_key', $Qstatus->value('weight_class_key')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':weight_class_title', $Qstatus->value('weight_class_title')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } if ($error === false) { $Qgroup = $OSCOM_Database->query('select id, title, code, size_width, size_height, force_size from :table_products_images_groups where language_id = :language_id'); $Qgroup->bindInt(':language_id', $default_language_id); $Qgroup->execute(); while ($Qgroup->next()) { $Qinsert = $OSCOM_Database->query('insert into :table_products_images_groups (id, language_id, title, code, size_width, size_height, force_size) values (:id, :language_id, :title, :code, :size_width, :size_height, :force_size)'); $Qinsert->bindInt(':id', $Qgroup->valueInt('id')); $Qinsert->bindInt(':language_id', $language_id); $Qinsert->bindValue(':title', $Qgroup->value('title')); $Qinsert->bindValue(':code', $Qgroup->value('code')); $Qinsert->bindInt(':size_width', $Qgroup->value('size_width')); $Qinsert->bindInt(':size_height', $Qgroup->value('size_height')); $Qinsert->bindInt(':force_size', $Qgroup->value('force_size')); $Qinsert->execute(); if ($OSCOM_Database->isError()) { $error = true; break; } } } } } if ($error === false) { $OSCOM_Database->commitTransaction(); Cache::clear('languages'); return true; } else { $OSCOM_Database->rollbackTransaction(); } return false; }
<?php /* osCommerce Online Merchant $osCommerce-SIG$ Copyright (c) 2010 osCommerce (http://www.oscommerce.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation. */ use osCommerce\OM\Core\ObjectInfo; use osCommerce\OM\Core\Site\Admin\Application\Currencies\Currencies; use osCommerce\OM\Core\OSCOM; $OSCOM_ObjectInfo = new ObjectInfo(Currencies::get($_GET['id'])); ?> <h1><?php echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?> <div class="infoBox"> <h3><?php echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('title'); ?>
* @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com * @license BSD License; http://www.oscommerce.com/bsdlicense.txt */ use osCommerce\OM\Core\HTML; use osCommerce\OM\Core\ObjectInfo; use osCommerce\OM\Core\OSCOM; use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages; use osCommerce\OM\Core\Site\Admin\Application\Currencies\Currencies; $languages_array = array(array('id' => '0', 'text' => OSCOM::getDef('none'))); foreach (ObjectInfo::to(Languages::getAll(-1))->get('entries') as $l) { if ($l['languages_id'] != $_GET['id']) { $languages_array[] = array('id' => $l['languages_id'], 'text' => $l['name'] . ' (' . $l['code'] . ')'); } } $currencies_array = array(); foreach (ObjectInfo::to(Currencies::getAll(-1))->get('entries') as $c) { $currencies_array[] = array('id' => $c['currencies_id'], 'text' => $c['title']); } $OSCOM_ObjectInfo = new ObjectInfo(Languages::get($_GET['id'])); ?> <h1><?php echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?>
public static function execute($id) { return Currencies::get($id) !== false; }