diff --git a/README.md b/README.md index 04215ad99..30298ba8b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ - [Softaculous](https://github.com/gburton/CE-Phoenix#softaculous) - [Language Packs](https://github.com/gburton/CE-Phoenix#language-packs) * [Certified Service Providers](https://github.com/gburton/CE-Phoenix#certified-service-providers) -* [Supporting the Project](https://github.com/gburton/CE-Phoenix#supporting-the-project) +* [Supporting the Project](https://github.com/gburton/CE-Phoenix#how-to-support-the-phoenix-project) - [Join the Phoenix Club](https://github.com/gburton/CE-Phoenix#join-the-phoenix-club) +* [Links](https://github.com/gburton/CE-Phoenix#helpful-links) * [Credits](https://github.com/gburton/CE-Phoenix#credits) # Phoenix @@ -25,12 +26,18 @@ Phoenix is the official Community Version of osCommerce. ## Demo Site -https://template.me.uk/phoenix/index.php +https://template.me.uk/index.php # Installation Installation of Phoenix takes no more than a few minutes - you will need a hosting account that supports PHP (programming language) and has at least one SQL database. Phoenix can even be installed on your home computer for testing purposes. +## PHP Version + +Minimum | Maximum (tested) +------------ | ------------- +7.0 | 7.4 + ## User Checklist - [x] read this README document @@ -47,7 +54,7 @@ Installation of Phoenix takes no more than a few minutes - you will need a hosti - [ ] perform a test checkout - [ ] load your categories and products -## Softaculous +## Installation via Softaculous
CE Phoenix can now be installed easily with just one click via [Softaculous](http://www.softaculous.com/apps/ecommerce/CE_Phoenix)

@@ -56,6 +63,7 @@ Installation of Phoenix takes no more than a few minutes - you will need a hosti Language | URL | Credit & Thanks | Comments ------------ | ------------- | ------------- | ------------- DE | https://apps.oscommerce.com/zXxXN&german-language-deutsches-sprachpaket&v=cephoenix10 | cupidare | +DK | https://apps.oscommerce.com/n6qft&danish-dansk-for-phoenix-1-0-7-9 | Kofod | Shop Side only ES | https://github.com/raiwa/OSCOM-CE-Phoenix-Spanish-language-idioma-espanol | raiwa | Certified Developer FR | https://apps.oscommerce.com/oqfJg&ce-phoenix-1-0-5-0-french-language-pack | artfulweb | NL | https://apps.oscommerce.com/NShzV&vertaling-nederlands | Fiber | @@ -73,17 +81,7 @@ Rainer
[@raiwa](https://forums.oscommerce.com/profile/249059-raiwa/) | [oscad John
[@BrockleyJohn](https://forums.oscommerce.com/profile/220375-brockleyjohn/) | [sewebsites.net](https://sewebsites.net/) | Custom jobs, big or small, including adapting existing addons to CE Phoenix. Integration of stock systems and new payment methods. Addons both free and great value, soon to be added to the site. Preston
[@zipurman](https://forums.oscommerce.com/profile/406830-zipurman/) | [phoenixaddons.com](https://phoenixaddons.com/) | Any need for programming in your CE Phoenix online store, or any PHP/JS/CSS/SQL, I am happy to help. We also offer hosting on our own VMWare servers and have been building web solutions and hosting for over 20 years. The website offers some free add-ons and more coming soon. Thanks for any consideration on your projects. (CST Canada) -# External Libraries - -https://github.com/gburton/Responsive-osCommerce/wiki/External-Libraries - -# PHP Version - -Minimum | Maximum (tested) ------------- | ------------- -7.0 | 7.3 - -# Supporting the Project +# How to Support the Phoenix Project Help Phoenix fly high...if you or your employer is commercially dependent on Phoenix (or a previous incarnation), please help to sponsor forward movement in the code-base. Phoenix needs you as much as you need Phoenix... @@ -91,8 +89,18 @@ Thank you to all shopowners, developers, consultants and business owners who are ## Join the Phoenix Club -If you wish to help steer the future direction of the software please join the Phoenix Club -https://forums.oscommerce.com/clubs/1-phoenix/ +If you wish to help steer the future direction of the software you need to join the [Phoenix Club](https://forums.oscommerce.com/clubs/1-phoenix/) + +# Helpful Links + +Channel | URL +------------ | ------------- +Phoenix Club | https://forums.oscommerce.com/forum/117-topics/ +Youtube | https://www.youtube.com/channel/UCjJe0ZX3-nGzeJFEzcVUyIA/ +Discord | https://discord.com/channels/769158803769655306/769158864523231252 +External Libraries | https://github.com/gburton/Responsive-osCommerce/wiki/External-Libraries +Phoenix Cart Wiki | https://phoenixcart.org/phoenixcartwiki/index.php +Phoenix Cart Forum | https://phoenixcart.org/forum/ # Credits @@ -106,4 +114,4 @@ Oranges, Lemons, Pears, Apples | Eelffica from Pixabay | https://pixabay.com/ser Tomatoes | Rocky_H from Pixabay | https://pixabay.com/service/license/ Heart | Gerhard Gellinger from Pixabay | https://pixabay.com/service/license/ -Other fruit images are based on modified images from Eelffica, Rocky_H and Gerhard Gellinger +Other fruit images are based on modified images from the named Owners. diff --git a/admin/advert_manager.php b/admin/advert_manager.php index ff08a8fe2..d2c43da05 100644 --- a/admin/advert_manager.php +++ b/admin/advert_manager.php @@ -19,18 +19,31 @@ if (tep_not_null($action)) { switch ($action) { case 'import': + $languages = tep_get_languages(); + $import_query = tep_db_query("select * from banners order by banners_id"); while ($import = tep_db_fetch_array($import_query)) { $sql_data_array = ['advert_title' => $import['banners_title'], 'advert_url' => $import['banners_url'], 'advert_image' => $import['banners_image'], 'advert_group' => $import['banners_group'], - 'advert_html_text' => $import['banners_html_text'], 'date_added' => $import['date_added'], 'date_status_change' => $import['date_status_change'], 'status' => $import['status']]; tep_db_perform('advert', $sql_data_array); + + $advert_id = tep_db_insert_id(); + + for ($i=0, $n=count($languages); $i<$n; $i++) { + $language_id = $languages[$i]['id']; + + $lng_data_array = ['advert_id' => $advert_id, + 'languages_id' => $language_id, + 'advert_html_text' => $import['banners_html_text']]; + + tep_db_perform('advert_info', $lng_data_array); + } } $OSCOM_Hooks->call('advert_manager', 'importAction'); @@ -101,8 +114,7 @@ 'advert_fragment' => $advert_fragment, 'advert_image' => $db_image_location, 'advert_group' => $advert_group, - 'sort_order' => $sort_order, - 'advert_html_text' => $advert_html_text]; + 'sort_order' => $sort_order]; if ($action == 'insert') { $insert_sql_data = ['date_added' => 'now()', 'status' => '1']; @@ -123,6 +135,25 @@ $messageStack->add_session(SUCCESS_IMAGE_UPDATED, 'success'); } + + $languages = tep_get_languages(); + for ($i=0, $n=count($languages); $i<$n; $i++) { + $advert_html_text_array = $_POST['advert_html_text']; + + $language_id = $languages[$i]['id']; + + $lng_data_array['advert_html_text'] = tep_db_prepare_input($advert_html_text_array[$language_id]); + + if ($action == 'insert') { + $insert_sql_data = ['advert_id' => $advert_id, 'languages_id' => $language_id]; + + $lng_data_array = array_merge($lng_data_array, $insert_sql_data); + + tep_db_perform('advert_info', $lng_data_array); + } elseif ($action == 'update') { + tep_db_perform('advert_info', $lng_data_array, 'update', "advert_id = '" . (int)$advert_id . "' and languages_id = '" . (int)$language_id . "'"); + } + } $OSCOM_Hooks->call('advert_manager', 'insertUpdateAction'); @@ -150,6 +181,7 @@ } tep_db_query("delete from advert where advert_id = '" . (int)$advert_id . "'"); + tep_db_query("delete from advert_info where advert_id = '" . (int)$advert_id . "'"); $OSCOM_Hooks->call('advert_manager', 'deleteConfirmAction'); @@ -182,6 +214,8 @@ '', 'advert_url' => '', 'advert_fragment' => '', 'advert_group' => '', 'advert_image' => '', 'sort_order' => '', 'advert_html_text' => '']; @@ -281,12 +315,24 @@
- -
- -
advert_html_text, 'class="form-control" id="cText"'); ?> + + +
+ +
+
+
+ +
+ advert_id ?? 0, $languages[$i]['id']), 'class="form-control" id="cText_' . $languages[$i]['id'] . '"'); ?> +
+
-
+
diff --git a/admin/backup.php b/admin/backup.php index 700042a72..5034dcb5f 100644 --- a/admin/backup.php +++ b/admin/backup.php @@ -99,7 +99,7 @@ foreach ($index as $kname => $info) { $schema .= ',' . "\n"; - $columns = implode($info['columns'], ', '); + $columns = implode(', ', $info['columns']); if ($kname == 'PRIMARY') { $schema .= ' PRIMARY KEY (' . $columns . ')'; diff --git a/admin/certified_addons.php b/admin/certified_addons.php index c3ed911ba..d4d3c537c 100644 --- a/admin/certified_addons.php +++ b/admin/certified_addons.php @@ -10,37 +10,37 @@ Released under the GNU General Public License */ - require('includes/application_top.php'); + require 'includes/application_top.php'; - require('includes/template_top.php'); + require 'includes/template_top.php'; - $feed = simplexml_load_file('http://feeds.feedburner.com/PhoenixAddons'); + $feed = Web::load_xml('https://feeds.feedburner.com/PhoenixAddons'); $num = 0; ?>
-

+

- +
- +
-
channel->description); ?>
+
channel->description) ?>
- - - - - + + + + + @@ -62,11 +62,11 @@
-

+

- + diff --git a/admin/configuration.php b/admin/configuration.php index 1b9ae8616..9df2f2efd 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -10,10 +10,10 @@ Released under the GNU General Public License */ - require('includes/application_top.php'); + require 'includes/application_top.php'; $action = $_GET['action'] ?? ''; - + $OSCOM_Hooks->call('configuration', 'preAction'); if (tep_not_null($action)) { @@ -22,82 +22,91 @@ $configuration_value = tep_db_prepare_input($_POST['configuration_value']); $cID = tep_db_prepare_input($_GET['cID']); - tep_db_query("update configuration set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'"); + tep_db_query("UPDATE configuration SET configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = NOW() WHERE configuration_id = " . (int)$cID); $OSCOM_Hooks->call('configuration', 'saveAction'); - + tep_redirect(tep_href_link('configuration.php', 'gID=' . $_GET['gID'] . '&cID=' . $cID)); break; } } - + $OSCOM_Hooks->call('configuration', 'postAction'); - $gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1; + $gID = $_GET['gID'] ?? 1; - $cfg_group_query = tep_db_query("select configuration_group_title from configuration_group where configuration_group_id = '" . (int)$gID . "'"); + $cfg_group_query = tep_db_query("SELECT configuration_group_title FROM configuration_group WHERE configuration_group_id = " . (int)$gID); $cfg_group = tep_db_fetch_array($cfg_group_query); - require('includes/template_top.php'); + require 'includes/template_top.php'; ?> -

- +

+
- - - + + + /', $use_function)) { - $class_method = explode('->', $use_function); - if (!is_object(${$class_method[0]})) { - include('includes/classes/' . $class_method[0] . '.php'); - ${$class_method[0]} = new $class_method[0](); - } - $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]}); + if (strpos($configuration['use_function'], '->')) { + // if there is a -> with something before it + // make sure that the something is instantiated + $class_method = explode('->', $configuration['use_function'], 2); + $use_function = [Guarantor::ensure_global($class_method[0]), $class_method[1]]; } else { - if (function_exists($use_function)) { - $cfgValue = tep_call_function($use_function, $configuration['configuration_value']); - } + $use_function = $configuration['use_function']; + } + + if (is_callable($use_function)) { + $cfgValue = call_user_func($use_function, $configuration['configuration_value']); + } else { + $cfgValue = 0; + $messageStack->add( + sprintf( + WARNING_INVALID_USE_FUNCTION, + $configuration['use_function'], + $configuration['configuration_title']), + 'warning'); } } else { $cfgValue = $configuration['configuration_value']; } - - if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) { - $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from configuration where configuration_id = '" . (int)$configuration['configuration_id'] . "'"); + + if (!isset($cInfo) && (!isset($_GET['cID']) || ($_GET['cID'] == $configuration['configuration_id'])) && (substr($action, 0, strlen('new')) !== 'new')) { + $cfg_extra_query = tep_db_query("SELECT configuration_key, configuration_description, date_added, last_modified, use_function, set_function FROM configuration WHERE configuration_id = " . (int)$configuration['configuration_id']); $cfg_extra = tep_db_fetch_array($cfg_extra_query); $cInfo_array = array_merge($configuration, $cfg_extra); $cInfo = new objectInfo($cInfo_array); } - if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { + if ( isset($cInfo->configuration_id) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo '' . "\n"; + $icon = ''; } else { echo '' . "\n"; + $icon = ''; } ?> - - - + + + +
configuration_id) ) { echo ''; } else { echo ''; } ?>  
@@ -127,22 +136,24 @@ $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . (int)$cInfo->configuration_id . '&action=edit'), null, null, 'btn-warning mr-2')]; $contents[] = ['text' => $cInfo->configuration_description]; $contents[] = ['text' => TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added)]; - if (tep_not_null($cInfo->last_modified)) $contents[] = ['text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified)]; + if (tep_not_null($cInfo->last_modified)) { + $contents[] = ['text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified)]; + } } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo '
'; - $box = new box; + $box = new box(); echo $box->infoBox($heading, $contents); echo '
'; } ?> - +
diff --git a/admin/customers.php b/admin/customers.php index b4abcb423..62d6a62bb 100644 --- a/admin/customers.php +++ b/admin/customers.php @@ -249,7 +249,9 @@ $contents = ['form' => tep_draw_form('customers', 'customers.php', tep_get_all_get_params(['cID', 'action']) . 'cID=' . $cInfo->id . '&action=deleteconfirm')]; $contents[] = ['text' => TEXT_DELETE_INTRO . '

' . $cInfo->name . '']; - if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = ['text' => '
' . tep_draw_selection_field('delete_reviews', 'checkbox', 'on', 1, 'class="custom-control-input" id="cDeleteReview"') . '
']; + if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews > 0)) { + $contents[] = ['text' => '
' . tep_draw_selection_field('delete_reviews', 'checkbox', 'on', 1, 'class="custom-control-input" id="cDeleteReview"') . '
']; + } $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', null, 'primary', null, 'btn-danger mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('customers.php', tep_get_all_get_params(['cID', 'action']) . 'cID=' . $cInfo->id), null, null, 'btn-light')]; break; default: @@ -263,11 +265,9 @@ $contents[] = ['text' => sprintf(TEXT_INFO_DATE_LAST_LOGON, tep_date_short($cInfo->date_last_logon))]; $contents[] = ['text' => sprintf(TEXT_INFO_NUMBER_OF_LOGONS, $cInfo->number_of_logons)]; - if ($customer_data->has('country_name') && isset($cInfo->country_id)) { - $country_query = tep_db_query("SELECT * FROM countries WHERE countries_id = " . (int)$cInfo->country_id); - $country = (array)tep_db_fetch_array($country_query); - - $contents[] = ['text' => sprintf(TEXT_INFO_COUNTRY, $country['countries_name'])]; + if ($customer_data->has('country_name') && !empty($cInfo->country_id)) { + $customers = (array)$cInfo; + $contents[] = ['text' => sprintf(TEXT_INFO_COUNTRY, $customer_data->get('country_name', $customers))]; } $contents[] = ['text' => sprintf(TEXT_INFO_NUMBER_OF_REVIEWS, $cInfo->number_of_reviews)]; diff --git a/admin/includes/classes/order.php b/admin/includes/classes/order.php deleted file mode 100644 index 915271109..000000000 --- a/admin/includes/classes/order.php +++ /dev/null @@ -1,134 +0,0 @@ -info = []; - $this->totals = []; - $this->products = []; - $this->customer = []; - $this->delivery = []; - - $this->query($order_id); - } - - public function query($order_id) { - global $languages_id; - - $order_id = tep_db_prepare_input($order_id); - - $order_query = tep_db_query("SELECT * FROM orders WHERE orders_id = " . (int)$order_id); - $order = tep_db_fetch_array($order_query); - - $totals_query = tep_db_query("SELECT title, text FROM orders_total WHERE orders_id = " . (int)$order_id . " ORDER BY sort_order"); - while ($totals = tep_db_fetch_array($totals_query)) { - $this->totals[] = [ - 'title' => $totals['title'], - 'text' => $totals['text'], - ]; - } - - $order_total_query = tep_db_query("SELECT text FROM orders_total WHERE orders_id = " . (int)$order_id . " AND class = 'ot_total'"); - $order_total = tep_db_fetch_array($order_total_query); - - $shipping_method_query = tep_db_query("SELECT title FROM orders_total WHERE orders_id = " . (int)$order_id . " AND class = 'ot_shipping'"); - $shipping_method = tep_db_fetch_array($shipping_method_query); - - $order_status_query = tep_db_query("SELECT orders_status_name FROM orders_status WHERE orders_status_id = " . (int)$order['orders_status'] . " AND language_id = " . (int)$languages_id); - $order_status = tep_db_fetch_array($order_status_query); - - $this->info = [ - 'currency' => $order['currency'], - 'currency_value' => $order['currency_value'], - 'payment_method' => $order['payment_method'], - 'date_purchased' => $order['date_purchased'], - 'orders_status_id' => $order['orders_status'], - 'orders_status' => $order_status['orders_status_name'], - 'last_modified' => $order['last_modified'], - 'total' => strip_tags($order_total['text']), - 'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])), - ]; - - $this->customer = [ - 'id' => $order['customers_id'], - 'name' => $order['customers_name'], - 'company' => $order['customers_company'], - 'street_address' => $order['customers_street_address'], - 'suburb' => $order['customers_suburb'], - 'city' => $order['customers_city'], - 'postcode' => $order['customers_postcode'], - 'state' => $order['customers_state'], - 'country' => ['title' => $order['customers_country']], - 'format_id' => $order['customers_address_format_id'], - 'telephone' => $order['customers_telephone'], - 'email_address' => $order['customers_email_address'], - ]; - - $this->delivery = [ - 'name' => trim($order['delivery_name']), - 'company' => $order['delivery_company'], - 'street_address' => $order['delivery_street_address'], - 'suburb' => $order['delivery_suburb'], - 'city' => $order['delivery_city'], - 'postcode' => $order['delivery_postcode'], - 'state' => $order['delivery_state'], - 'country' => [ 'title' => $order['delivery_country']], - 'format_id' => $order['delivery_address_format_id']]; - - if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) { - $this->delivery = false; - } - - $this->billing = [ - 'name' => $order['billing_name'], - 'company' => $order['billing_company'], - 'street_address' => $order['billing_street_address'], - 'suburb' => $order['billing_suburb'], - 'city' => $order['billing_city'], - 'postcode' => $order['billing_postcode'], - 'state' => $order['billing_state'], - 'country' => ['title' => $order['billing_country']], - 'format_id' => $order['billing_address_format_id'], - ]; - - $orders_products_query = tep_db_query("SELECT orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price FROM orders_products WHERE orders_id = " . (int)$order_id); - while ($orders_products = tep_db_fetch_array($orders_products_query)) { - $current = [ - 'qty' => $orders_products['products_quantity'], - 'id' => $orders_products['products_id'], - 'name' => $orders_products['products_name'], - 'model' => $orders_products['products_model'], - 'tax' => $orders_products['products_tax'], - 'price' => $orders_products['products_price'], - 'final_price' => $orders_products['final_price'], - ]; - - $attributes_query = tep_db_query("SELECT products_options, products_options_values, options_values_price, price_prefix FROM orders_products_attributes WHERE orders_id = " . (int)$order_id . " AND orders_products_id = " . (int)$orders_products['orders_products_id']); - while ($attributes = tep_db_fetch_array($attributes_query)) { - $current['attributes'][] = [ - 'option' => $attributes['products_options'], - 'value' => $attributes['products_options_values'], - 'prefix' => $attributes['price_prefix'], - 'price' => $attributes['options_values_price'], - ]; - } - - $this->info['tax_groups']["{$current['tax']}"] = '1'; - - $this->products[] = $current; - } - } - - } diff --git a/admin/includes/classes/web.php b/admin/includes/classes/web.php new file mode 100644 index 000000000..4457072fa --- /dev/null +++ b/admin/includes/classes/web.php @@ -0,0 +1,35 @@ +send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); } + function tep_notify($trigger, $subject) { + $notified = false; + + if (defined('MODULE_NOTIFICATIONS_INSTALLED') && tep_not_null(MODULE_NOTIFICATIONS_INSTALLED)) { + foreach ((array)explode(';', MODULE_NOTIFICATIONS_INSTALLED) as $basename) { + $class = pathinfo($basename, PATHINFO_FILENAME); + + if (!isset($GLOBALS[$class])) { + $GLOBALS[$class] = new $class(); + } + + if (!$GLOBALS[$class]->isEnabled()) { + continue; + } + + if (in_array($trigger, $class::TRIGGERS)) { + $result = $GLOBALS[$class]->notify($subject); + if (!is_null($result)) { + $notified = $notified || $result; + } + } + } + } + + return $notified; + } + function tep_get_tax_class_title($tax_class_id) { if ($tax_class_id == '0') { return TEXT_NONE; @@ -1158,6 +1185,7 @@ function tep_get_tax_rate_value($class_id) { } function tep_call_function($function, $parameter, $object = '') { + trigger_error('The tep_call_function function has been deprecated.', E_USER_DEPRECATED); if ($object == '') { return call_user_func($function, $parameter); } else { @@ -1350,7 +1378,7 @@ function tep_get_manufacturer_seo_title($manufacturer_id, $language_id) { return $manufacturer['manufacturers_seo_title']; } - + function tep_get_products_seo_description($product_id, $language_id = 0) { global $languages_id; @@ -1462,12 +1490,6 @@ function tep_draw_account_edit_pages($key_values, $key_name = null) { return tep_cfg_multiple_select_option($pages, $key_values, $key_name); } - -//// -// Check if product has attributes - function tep_has_product_attributes($products_id) { - return true; - } function tep_block_form_processing() { $GLOBALS['error'] = true; diff --git a/admin/includes/languages/english/configuration.php b/admin/includes/languages/english/configuration.php index b64b1de1d..f6850ea5c 100644 --- a/admin/includes/languages/english/configuration.php +++ b/admin/includes/languages/english/configuration.php @@ -5,16 +5,17 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ -define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title'); -define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value'); -define('TABLE_HEADING_ACTION', 'Action'); +const TABLE_HEADING_CONFIGURATION_TITLE = 'Title'; +const TABLE_HEADING_CONFIGURATION_VALUE = 'Value'; +const TABLE_HEADING_ACTION = 'Action'; -define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes'); -define('TEXT_INFO_DATE_ADDED', 'Date Added:'); -define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:'); -?> \ No newline at end of file +const TEXT_INFO_EDIT_INTRO = 'Please make any necessary changes'; +const TEXT_INFO_DATE_ADDED = 'Date Added:'; +const TEXT_INFO_LAST_MODIFIED = 'Last Modified:'; + +const WARNING_INVALID_USE_FUNCTION = 'The use function (%s) for "%s" is invalid.'; diff --git a/admin/includes/languages/english/invoice.php b/admin/includes/languages/english/invoice.php index e2f473842..cb6478b75 100644 --- a/admin/includes/languages/english/invoice.php +++ b/admin/includes/languages/english/invoice.php @@ -10,25 +10,25 @@ Released under the GNU General Public License */ -define('TABLE_HEADING_COMMENTS', 'Comments'); +const TABLE_HEADING_COMMENTS = 'Comments'; -define('TABLE_HEADING_QTY', 'Qty'); -define('TABLE_HEADING_PRODUCTS_MODEL', 'Model'); -define('TABLE_HEADING_PRODUCTS', 'Products'); -define('TABLE_HEADING_TAX', 'Tax'); -define('TABLE_HEADING_TOTAL', 'Total'); -define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)'); -define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)'); -define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)'); -define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)'); +const TABLE_HEADING_QTY = 'Qty'; +const TABLE_HEADING_PRODUCTS_MODEL = 'Model'; +const TABLE_HEADING_PRODUCTS = 'Products'; +const TABLE_HEADING_TAX = 'Tax'; +const TABLE_HEADING_TOTAL = 'Total'; +const TABLE_HEADING_PRICE_EXCLUDING_TAX = 'Price (ex)'; +const TABLE_HEADING_PRICE_INCLUDING_TAX = 'Price (inc)'; +const TABLE_HEADING_TOTAL_EXCLUDING_TAX = 'Total (ex)'; +const TABLE_HEADING_TOTAL_INCLUDING_TAX = 'Total (inc)'; -define('ENTRY_SOLD_TO', 'SOLD TO:'); -define('ENTRY_SHIP_TO', 'SHIP TO:'); -define('ENTRY_PAYMENT_METHOD', 'Payment Method: %s'); -define('ENTRY_SUB_TOTAL', 'Sub-Total:'); -define('ENTRY_TAX', 'Tax:'); -define('ENTRY_SHIPPING', 'Shipping:'); -define('ENTRY_TOTAL', 'Total:'); +const ENTRY_SOLD_TO = 'SOLD TO:'; +const ENTRY_SHIP_TO = 'SHIP TO:'; +const ENTRY_PAYMENT_METHOD = 'Payment Method: %s'; +const ENTRY_SUB_TOTAL = 'Sub-Total:'; +const ENTRY_TAX = 'Tax:'; +const ENTRY_SHIPPING = 'Shipping:'; +const ENTRY_TOTAL = 'Total:'; -define('ENTRY_INVOICE_NUMBER', 'Invoice: %s'); -define('ENTRY_INVOICE_DATE', 'Date: %s'); +const ENTRY_INVOICE_NUMBER = 'Order ID: %s'; +const ENTRY_INVOICE_DATE = 'Order Date: %s'; diff --git a/admin/includes/languages/english/modules.php b/admin/includes/languages/english/modules.php index 11a716877..d53539a59 100644 --- a/admin/includes/languages/english/modules.php +++ b/admin/includes/languages/english/modules.php @@ -23,3 +23,4 @@ const ERROR_MODULE_UNMET_REQUIREMENT = 'This module has an unmet dependency.'; const ERROR_MODULE_HAS_DEPENDENTS = 'Other modules are dependent on this module.'; +const WARNING_INVALID_USE_FUNCTION = 'The use function (%s) for "%s" is invalid.'; diff --git a/admin/includes/languages/english/modules/security_check/fopen_wrapper.php b/admin/includes/languages/english/modules/security_check/fopen_wrapper.php index 466d799ef..371732900 100644 --- a/admin/includes/languages/english/modules/security_check/fopen_wrapper.php +++ b/admin/includes/languages/english/modules/security_check/fopen_wrapper.php @@ -10,6 +10,8 @@ Released under the GNU General Public License */ -define('MODULE_SECURITY_CHECK_FOPEN_WRAPPER_TITLE', 'allow_url_fopen'); -define('MODULE_SECURITY_CHECK_FOPEN_WRAPPER_ERROR', 'allow_url_fopen must be enabled in php.ini
This is a hosting setting and may be able to be performed via your hosting control panel - if not, ask your host.'); - +const MODULE_SECURITY_CHECK_FOPEN_WRAPPER_TITLE = 'allow_url_fopen'; +const MODULE_SECURITY_CHECK_FOPEN_WRAPPER_ERROR = <<<'EOT' +allow_url_fopen should be enabled in php.ini
+This is a hosting setting and may be able to be performed via your hosting control panel - if not, ask your host. +EOT; diff --git a/admin/includes/languages/english/modules_content.php b/admin/includes/languages/english/modules_content.php index b8adad8c8..a071c74a1 100644 --- a/admin/includes/languages/english/modules_content.php +++ b/admin/includes/languages/english/modules_content.php @@ -5,21 +5,23 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2019 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ -define('HEADING_TITLE', 'Content Modules'); +const HEADING_TITLE = 'Content Modules'; -define('TABLE_HEADING_MODULES', 'Modules'); -define('TABLE_HEADING_GROUP', 'Group'); -define('TABLE_HEADING_SORT_ORDER', 'Sort Order'); -define('TABLE_HEADING_MODULE_ACTIVE', 'Active'); -define('TABLE_HEADING_ACTION', 'Action'); +const TABLE_HEADING_MODULES = 'Modules'; +const TABLE_HEADING_GROUP = 'Group'; +const TABLE_HEADING_SORT_ORDER = 'Sort Order'; +const TABLE_HEADING_MODULE_ACTIVE = 'Active'; +const TABLE_HEADING_ACTION = 'Action'; -define('TEXT_INFO_VERSION', 'Version:'); -define('TEXT_INFO_ONLINE_STATUS', 'online status'); -define('TEXT_INFO_API_VERSION', 'API Version:'); +const TEXT_INFO_VERSION = 'Version:'; +const TEXT_INFO_ONLINE_STATUS = 'online status'; +const TEXT_INFO_API_VERSION = 'API Version:'; -define('TEXT_MODULE_DIRECTORY', 'Module Directory:'); +const TEXT_MODULE_DIRECTORY = 'Module Directory:'; + +const WARNING_INVALID_USE_FUNCTION = 'The use function (%s) for "%s" is invalid.'; diff --git a/admin/includes/languages/english/modules_pi.php b/admin/includes/languages/english/modules_pi.php index bb5d7c9a2..94259da48 100644 --- a/admin/includes/languages/english/modules_pi.php +++ b/admin/includes/languages/english/modules_pi.php @@ -10,18 +10,20 @@ Released under the GNU General Public License */ -define('HEADING_TITLE', 'π Modules'); +const HEADING_TITLE = 'π Modules'; -define('TABLE_HEADING_MODULES', 'Modules'); -define('TABLE_HEADING_GROUP', 'Group'); -define('TABLE_HEADING_SORT_ORDER', 'Sort Order'); -define('TABLE_HEADING_ENABLED', 'Enabled'); -define('TABLE_HEADING_ACTION', 'Action'); -define('TABLE_HEADING_WIDTH', 'Width'); +const TABLE_HEADING_MODULES = 'Modules'; +const TABLE_HEADING_GROUP = 'Group'; +const TABLE_HEADING_SORT_ORDER = 'Sort Order'; +const TABLE_HEADING_ENABLED = 'Enabled'; +const TABLE_HEADING_ACTION = 'Action'; +const TABLE_HEADING_WIDTH = 'Width'; -define('TEXT_INFO_VERSION', 'Version:'); -define('TEXT_INFO_ONLINE_STATUS', 'online status'); -define('TEXT_INFO_API_VERSION', 'API Version:'); +const TEXT_INFO_VERSION = 'Version:'; +const TEXT_INFO_ONLINE_STATUS = 'online status'; +const TEXT_INFO_API_VERSION = 'API Version:'; -define('TEXT_MODULE_DIRECTORY', 'Module Directory:'); -define('SORT_ORDER_WARNING', 'ALL Sort Order numbers MUST be UNIQUE.
Any Group with no active module(s) will NOT display.'); +const TEXT_MODULE_DIRECTORY = 'Module Directory:'; +const SORT_ORDER_WARNING = 'ALL Sort Order numbers MUST be UNIQUE.
Any Group with no active module(s) will NOT display.'; + +const WARNING_INVALID_USE_FUNCTION = 'The use function (%s) for "%s" is invalid.'; diff --git a/admin/includes/languages/english/orders.php b/admin/includes/languages/english/orders.php index 1ccf5a935..a44f4fb6d 100644 --- a/admin/includes/languages/english/orders.php +++ b/admin/includes/languages/english/orders.php @@ -10,83 +10,75 @@ Released under the GNU General Public License */ -define('HEADING_TITLE', 'Orders'); -define('HEADING_TITLE_SEARCH', 'Order ID:'); -define('HEADING_TITLE_STATUS', 'Status:'); -define('HEADING_TITLE_ORDER', 'Order #%s'); +const HEADING_TITLE = 'Orders'; +const HEADING_TITLE_SEARCH = 'Order ID:'; +const HEADING_TITLE_STATUS = 'Status:'; +const HEADING_TITLE_ORDER = 'Order #%s'; -define('TAB_TITLE_SUMMARY','Summary'); -define('TAB_TITLE_PRODUCTS','Products'); -define('TAB_TITLE_STATUS_HISTORY','Status History'); +const TAB_TITLE_SUMMARY = 'Summary'; +const TAB_TITLE_PRODUCTS = 'Products'; +const TAB_TITLE_STATUS_HISTORY = 'Status History'; -define('TABLE_HEADING_OID', 'Order'); -define('TABLE_HEADING_COMMENTS', 'Comments'); -define('TABLE_HEADING_CUSTOMERS', 'Customer'); -define('TABLE_HEADING_ORDER_TOTAL', 'Order Total'); -define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased'); -define('TABLE_HEADING_STATUS', 'Status'); -define('TABLE_HEADING_ACTION', 'Action'); -define('TABLE_HEADING_QUANTITY', 'Qty.'); -define('TABLE_HEADING_PRODUCTS_MODEL', 'Model'); -define('TABLE_HEADING_PRODUCTS', 'Products'); -define('TABLE_HEADING_TAX', 'Tax'); -define('TABLE_HEADING_TOTAL', 'Total'); -define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)'); -define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)'); -define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)'); -define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)'); +const TABLE_HEADING_OID = 'Order'; +const TABLE_HEADING_COMMENTS = 'Comments'; +const TABLE_HEADING_CUSTOMERS = 'Customer'; +const TABLE_HEADING_ORDER_TOTAL = 'Order Total'; +const TABLE_HEADING_DATE_PURCHASED = 'Date Purchased'; +const TABLE_HEADING_STATUS = 'Status'; +const TABLE_HEADING_ACTION = 'Action'; +const TABLE_HEADING_QUANTITY = 'Qty.'; +const TABLE_HEADING_PRODUCTS_MODEL = 'Model'; +const TABLE_HEADING_PRODUCTS = 'Products'; +const TABLE_HEADING_TAX = 'Tax'; +const TABLE_HEADING_TOTAL = 'Total'; +const TABLE_HEADING_PRICE_EXCLUDING_TAX = 'Price (ex)'; +const TABLE_HEADING_PRICE_INCLUDING_TAX = 'Price (inc)'; +const TABLE_HEADING_TOTAL_EXCLUDING_TAX = 'Total (ex)'; +const TABLE_HEADING_TOTAL_INCLUDING_TAX = 'Total (inc)'; -define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified'); -define('TABLE_HEADING_DATE_ADDED', 'Date Added'); +const TABLE_HEADING_CUSTOMER_NOTIFIED = 'Customer Notified'; +const TABLE_HEADING_DATE_ADDED = 'Date Added'; -define('ENTRY_CUSTOMER', 'Customer'); -define('ENTRY_SOLD_TO', 'SOLD TO:'); -define('ENTRY_DELIVERY_TO', 'Delivery To:'); -define('ENTRY_SHIP_TO', 'SHIP TO:'); -define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address'); -define('ENTRY_BILLING_ADDRESS', 'Billing Address'); -define('ENTRY_PAYMENT_METHOD', 'Payment Method'); -define('ENTRY_CREDIT_CARD_TYPE', 'Credit Card Type:'); -define('ENTRY_CREDIT_CARD_OWNER', 'Credit Card Owner:'); -define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:'); -define('ENTRY_CREDIT_CARD_EXPIRES', 'Credit Card Expires:'); -define('ENTRY_SUB_TOTAL', 'Sub-Total'); -define('ENTRY_TAX', 'Tax'); -define('ENTRY_SHIPPING', 'Shipping'); -define('ENTRY_TOTAL', 'Total'); -define('ENTRY_DATE_PURCHASED', 'Date Purchased'); -define('ENTRY_STATUS', 'Status'); -define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated'); -define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer'); -define('ENTRY_NOTIFY_COMMENTS', 'Append Comments'); -define('ENTRY_PRINTABLE', 'Print Invoice'); +const ENTRY_CUSTOMER = 'Customer'; +const ENTRY_SOLD_TO = 'SOLD TO:'; +const ENTRY_DELIVERY_TO = 'Delivery To:'; +const ENTRY_SHIP_TO = 'SHIP TO:'; +const ENTRY_SHIPPING_ADDRESS = 'Shipping Address'; +const ENTRY_BILLING_ADDRESS = 'Billing Address'; +const ENTRY_PAYMENT_METHOD = 'Payment Method'; +const ENTRY_CREDIT_CARD_TYPE = 'Credit Card Type:'; +const ENTRY_CREDIT_CARD_OWNER = 'Credit Card Owner:'; +const ENTRY_CREDIT_CARD_NUMBER = 'Credit Card Number:'; +const ENTRY_CREDIT_CARD_EXPIRES = 'Credit Card Expires:'; +const ENTRY_SUB_TOTAL = 'Sub-Total'; +const ENTRY_TAX = 'Tax'; +const ENTRY_SHIPPING = 'Shipping'; +const ENTRY_TOTAL = 'Total'; +const ENTRY_DATE_PURCHASED = 'Date Purchased'; +const ENTRY_STATUS = 'Status'; +const ENTRY_DATE_LAST_UPDATED = 'Date Last Updated'; +const ENTRY_NOTIFY_CUSTOMER = 'Notify Customer'; +const ENTRY_NOTIFY_COMMENTS = 'Append Comments'; +const ENTRY_PRINTABLE = 'Print Invoice'; -define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order'); -define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?'); -define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity'); -define('TEXT_DATE_ORDER_CREATED', 'Date Created: %s'); -define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified: %s'); -define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method: %s'); +const TEXT_INFO_HEADING_DELETE_ORDER = 'Delete Order'; +const TEXT_INFO_DELETE_INTRO = 'Are you sure you want to delete this order?'; +const TEXT_INFO_RESTOCK_PRODUCT_QUANTITY = 'Restock product quantity'; +const TEXT_DATE_ORDER_CREATED = 'Date Created: %s'; +const TEXT_DATE_ORDER_LAST_MODIFIED = 'Last Modified: %s'; +const TEXT_INFO_PAYMENT_METHOD = 'Payment Method: %s'; -define('TEXT_ALL_ORDERS', 'All Orders'); -define('TEXT_NO_ORDER_HISTORY', 'No Order History Available'); +const TEXT_ALL_ORDERS = 'All Orders'; +const TEXT_NO_ORDER_HISTORY = 'No Order History Available'; -define('EMAIL_SEPARATOR', '------------------------------------------------------'); -define('EMAIL_TEXT_SUBJECT', 'Order Update'); -define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:'); -define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:'); -define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:'); -define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n"); -define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n"); +const ERROR_ORDER_DOES_NOT_EXIST = 'Error: Order %s does not exist.'; +const SUCCESS_ORDER_UPDATED = 'Success: Order has been successfully updated.'; +const WARNING_ORDER_NOT_UPDATED = 'Warning: Nothing to change. The order was not updated.'; -define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order %s does not exist.'); -define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.'); -define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.'); +const ENTRY_ADD_COMMENT = 'Add Comment:'; -define('ENTRY_ADD_COMMENT', 'Add Comment:'); +const ENTRY_NOTIFY_CUSTOMER_TEXT = 'This will notify the customer that their order has been updated.'; +const ENTRY_NOTIFY_COMMENTS_TEXT = 'This will append your comments to the order and the email.'; -define('ENTRY_NOTIFY_CUSTOMER_TEXT', 'This will notify the customer that their order has been updated.'); -define('ENTRY_NOTIFY_COMMENTS_TEXT', 'This will append your comments to the order and the email.'); - -define('TEXT_ORDER_STATUS', '%s [%s]'); -define('TEXT_ORDER_PAYMENT', '%s [%s]'); +const TEXT_ORDER_STATUS = '%s [%s]'; +const TEXT_ORDER_PAYMENT = '%s [%s]'; diff --git a/admin/includes/languages/english/packingslip.php b/admin/includes/languages/english/packingslip.php index 785cd11b5..11b103b04 100644 --- a/admin/includes/languages/english/packingslip.php +++ b/admin/includes/languages/english/packingslip.php @@ -10,14 +10,14 @@ Released under the GNU General Public License */ -define('TABLE_HEADING_COMMENTS', 'Comments'); -define('TABLE_HEADING_PRODUCTS_MODEL', 'Model'); -define('TABLE_HEADING_PRODUCTS', 'Products'); -define('TABLE_HEADING_QTY', 'Qty'); +const TABLE_HEADING_COMMENTS = 'Comments'; +const TABLE_HEADING_PRODUCTS_MODEL = 'Model'; +const TABLE_HEADING_PRODUCTS = 'Products'; +const TABLE_HEADING_QTY = 'Qty'; -define('ENTRY_SOLD_TO', 'SOLD TO:'); -define('ENTRY_SHIP_TO', 'SHIP TO:'); -define('ENTRY_PAYMENT_METHOD', 'Payment Method: %s'); +const ENTRY_SOLD_TO = 'SOLD TO:'; +const ENTRY_SHIP_TO = 'SHIP TO:'; +const ENTRY_PAYMENT_METHOD = 'Payment Method: %s'; -define('ENTRY_INVOICE_NUMBER', 'Invoice: %s'); -define('ENTRY_INVOICE_DATE', 'Date: %s'); +const ENTRY_INVOICE_NUMBER = 'Order ID: %s'; +const ENTRY_INVOICE_DATE = 'Order Date: %s'; diff --git a/admin/includes/languages/english/products_attributes.php b/admin/includes/languages/english/products_attributes.php index b2ae6e086..c4d3127d8 100644 --- a/admin/includes/languages/english/products_attributes.php +++ b/admin/includes/languages/english/products_attributes.php @@ -10,27 +10,29 @@ Released under the GNU General Public License */ -define('HEADING_TITLE_OPT', 'Product Options'); -define('HEADING_TITLE_VAL', 'Option Values'); -define('HEADING_TITLE_ATRIB', 'Products Attributes'); - -define('TABLE_HEADING_ID', 'ID'); -define('TABLE_HEADING_PRODUCT', 'Product Name'); -define('TABLE_HEADING_OPT_NAME', 'Option Name'); -define('TABLE_HEADING_OPT_VALUE', 'Option Value'); -define('TABLE_HEADING_OPT_PRICE', 'Value Price'); -define('TABLE_HEADING_OPT_PRICE_PREFIX', 'Prefix'); -define('TABLE_HEADING_ACTION', 'Action'); -define('TABLE_HEADING_DOWNLOAD', 'Downloadable products:'); -define('TABLE_TEXT_FILENAME', 'Filename:'); -define('TABLE_TEXT_MAX_DAYS', 'Expiry days:'); -define('TABLE_TEXT_MAX_COUNT', 'Maximum download count:'); - -define('MAX_ROW_LISTS_OPTIONS', 10); - -define('TEXT_WARNING_OF_DELETE', 'This option has products and values linked to it - it is not safe to delete it.'); -define('TEXT_OK_TO_DELETE', 'This option has no products and values linked to it - it is safe to delete it.'); -define('TEXT_OPTION_ID', 'Option ID'); -define('TEXT_OPTION_NAME', 'Option Name'); - -const PLEASE_SELECT_OPTION = '--- Please Select ---'; \ No newline at end of file +const HEADING_TITLE_OPT = 'Options'; +const HEADING_TITLE_VAL = 'Values'; +const HEADING_TITLE_ATRIB = 'Attributes'; + +const TABLE_HEADING_ID = 'ID'; +const TABLE_HEADING_PRODUCT = 'Product Name'; +const TABLE_HEADING_OPT_NAME = 'Option Name'; +const TABLE_HEADING_OPT_VALUE = 'Option Value'; +const TABLE_HEADING_OPT_PRICE = 'Value Price'; +const TABLE_HEADING_OPT_PRICE_PREFIX = 'Prefix'; +const TABLE_HEADING_ACTION = 'Action'; +const TABLE_HEADING_DOWNLOAD = 'Downloadable products:'; +const TABLE_TEXT_FILENAME = 'Filename:'; +const TABLE_TEXT_MAX_DAYS = 'Expiry days:'; +const TABLE_TEXT_MAX_COUNT = 'Maximum download count:'; + +const MAX_ROW_LISTS_OPTIONS = 10; + +const TEXT_WARNING_OF_DELETE = 'This option has products and values linked to it - it is not safe to delete it.'; +const TEXT_OK_TO_DELETE = 'This option has no products and values linked to it - it is safe to delete it.'; +const TEXT_OPTION_ID = 'Option ID'; +const TEXT_OPTION_NAME = 'Option Name'; + +const PLEASE_SELECT_OPTION = '--- Please Select ---'; + +const TABLE_HEADING_OPT_SORT_ORDER = 'Sort Order'; \ No newline at end of file diff --git a/admin/includes/modules/currencies/c_ecb.php b/admin/includes/modules/currencies/c_ecb.php index a69f433e5..6e9c0a3c6 100644 --- a/admin/includes/modules/currencies/c_ecb.php +++ b/admin/includes/modules/currencies/c_ecb.php @@ -1,93 +1,69 @@ title = MODULE_ADMIN_CURRENCIES_ECB_TITLE; - $this->description = MODULE_ADMIN_CURRENCIES_ECB_DESCRIPTION; + class c_ecb extends abstract_module { - if ( defined('MODULE_ADMIN_CURRENCIES_ECB_STATUS') ) { - $this->sort_order = MODULE_ADMIN_CURRENCIES_ECB_SORT_ORDER; - $this->enabled = (MODULE_ADMIN_CURRENCIES_ECB_STATUS == 'True'); - } - } + const CONFIG_KEY_BASE = 'MODULE_ADMIN_CURRENCIES_ECB_'; - static function execute() { - global $messageStack; - - $xml = simplexml_load_file('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); + public static function execute() { + $xml = Web::load_xml('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); $xml = json_decode(json_encode($xml), JSON_FORCE_OBJECT); - - $currency_query = tep_db_query("select currencies_id, code, title from currencies"); + + $currency_query = tep_db_query("SELECT currencies_id, code, title FROM currencies"); while ($currency = tep_db_fetch_array($currency_query)) { $to[$currency['code']] = $currency['code']; } $from = DEFAULT_CURRENCY; - - $ecb_currencies = array('EUR' => 1); + + $ecb_currencies = ['EUR' => 1.0]; foreach ($xml as $a) { - foreach ($a['Cube']['Cube'] as $b) { + foreach ($a['Cube']['Cube'] as $b) { $ecb_currencies[$b['@attributes']['currency']] = $b['@attributes']['rate']; } } - if ($from != 'EUR') { + if ($from !== 'EUR') { $exchange = $ecb_currencies[$from]; foreach ($ecb_currencies as $x => $y) { $ecb_currencies[$x] = $y/$exchange; } } - - $to_exchange = array_intersect_key($ecb_currencies, $to); - - foreach($to_exchange as $k => $v) { - $rate = tep_db_prepare_input($v); - tep_db_query("update currencies set value = '" . tep_db_input($rate) . "', last_updated = now() where code = '" . $k . "'"); - - $messageStack->add_session(sprintf(MODULE_ADMIN_CURRENCIES_ECB_CURRENCIES_UPDATED, $k), 'success'); - } - } + $to_exchange = array_intersect_key($ecb_currencies, $to); - function isEnabled() { - return $this->enabled; - } + foreach ($to_exchange as $k => $v) { + $rate = tep_db_prepare_input($v); + tep_db_query("UPDATE currencies SET value = '" . tep_db_input($rate) . "', last_updated = NOW() WHERE code = '" . tep_db_input($k) . "'"); - function check() { - return defined('MODULE_ADMIN_CURRENCIES_ECB_STATUS'); - } + $GLOBALS['messageStack']->add_session(sprintf(MODULE_ADMIN_CURRENCIES_ECB_CURRENCIES_UPDATED, $k), 'success'); + } - function install() { - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable ECB Module', 'MODULE_ADMIN_CURRENCIES_ECB_STATUS', 'True', 'Do you want to install this Currency Conversion Module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_CURRENCIES_ECB_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } - function remove() { - tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + protected function get_parameters() { + return [ + 'MODULE_ADMIN_CURRENCIES_ECB_STATUS' => [ + 'title' => 'Enable ECB Module', + 'value' => 'True', + 'desc' => 'Do you want to install this Currency Conversion Module?', + 'set_func' => "tep_cfg_select_option(['True', 'False'], ", + ], + 'MODULE_ADMIN_CURRENCIES_ECB_SORT_ORDER' => [ + 'title' => 'Sort Order', + 'value' => '0', + 'desc' => 'Sort order of display. Lowest is displayed first.', + ], + ]; } - function keys() { - return array('MODULE_ADMIN_CURRENCIES_ECB_STATUS', 'MODULE_ADMIN_CURRENCIES_ECB_SORT_ORDER'); - } } - \ No newline at end of file diff --git a/admin/includes/modules/dashboard/d_latest_news.php b/admin/includes/modules/dashboard/d_latest_news.php index 91744fef4..1685e3ab4 100644 --- a/admin/includes/modules/dashboard/d_latest_news.php +++ b/admin/includes/modules/dashboard/d_latest_news.php @@ -5,36 +5,29 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ - class d_latest_news { - var $code = 'd_latest_news'; - var $title; - var $description; - var $sort_order; - var $enabled = false; - var $content_width = 6; + class d_latest_news extends abstract_module { + + const CONFIG_KEY_BASE = 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_'; + + public $content_width = 6; function __construct() { - $this->title = MODULE_ADMIN_DASHBOARD_LATEST_NEWS_TITLE; - $this->description = MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DESCRIPTION; + parent::__construct(); - if ( defined('MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS') ) { - $this->sort_order = MODULE_ADMIN_DASHBOARD_LATEST_NEWS_SORT_ORDER; - $this->enabled = (MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS == 'True'); + if ( $this->enabled ) { $this->content_width = (int)MODULE_ADMIN_DASHBOARD_LATEST_NEWS_CONTENT_WIDTH; } } function getOutput() { - $feed = simplexml_load_file('http://feeds.feedburner.com/osCommerceNewsAndBlogs'); - - $output = null; $count = 0; - - $output .= ''; + $feed = Web::load_xml('https://feeds.feedburner.com/osCommerceNewsAndBlogs'); + + $output = '
'; $output .= ''; $output .= ''; $output .= ''; @@ -43,18 +36,22 @@ function getOutput() { $output .= ''; $output .= ''; + $count = 0; foreach ($feed->channel->item as $item) { $output .= ''; $output .= ''; $output .= ''; $output .= ''; - - $count++; if ($count == (int)MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DISPLAY) break; - } - + + $count++; + if ($count == (int)MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DISPLAY) { + break; + } + } + $output .= ''; $output .= '
' . MODULE_ADMIN_DASHBOARD_LATEST_NEWS_TITLE . '
' . $item->title . '' . date("F j, Y", strtotime($item->pubDate)) . '
'; - + $output .= '
'; $output .= '' . tep_image('images/icon_phoenix.png', 'Phoenix') . ' '; $output .= '' . tep_image('images/icon_oscommerce.png', MODULE_ADMIN_DASHBOARD_LATEST_NEWS_ICON_NEWS) . ' '; @@ -67,27 +64,31 @@ function getOutput() { return $output; } - function isEnabled() { - return $this->enabled; + protected function get_parameters() { + return [ + 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS' => [ + 'title' => 'Enable Latest News Module', + 'value' => 'True', + 'desc' => 'Do you want to show the latest osCommerce News on the dashboard?', + 'set_func' => "tep_cfg_select_option(['True', 'False'], ", + ], + 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DISPLAY' => [ + 'title' => 'Items to display', + 'value' => '5', + 'desc' => 'This number of items will display, ordered by latest published.', + ], + 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_CONTENT_WIDTH' => [ + 'title' => 'Content Width', + 'value' => '6', + 'desc' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", + ], + 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_SORT_ORDER' => [ + 'title' => 'Sort Order', + 'value' => '700', + 'desc' => 'Sort order of display. Lowest is displayed first.', + ], + ]; } - function check() { - return defined('MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS'); - } - - function install() { - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Latest News Module', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS', 'True', 'Do you want to show the latest osCommerce News on the dashboard?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Items to display', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DISPLAY', '5', 'This number of items will display, ordered by latest published.', '6', '2', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_CONTENT_WIDTH', '6', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '3', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_SORT_ORDER', '700', 'Sort order of display. Lowest is displayed first.', '6', '4', now())"); - } - - function remove() { - tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_ADMIN_DASHBOARD_LATEST_NEWS_STATUS', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_DISPLAY', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_CONTENT_WIDTH', 'MODULE_ADMIN_DASHBOARD_LATEST_NEWS_SORT_ORDER'); - } } - \ No newline at end of file diff --git a/admin/includes/modules/dashboard/d_paypal_app.php b/admin/includes/modules/dashboard/d_paypal_app.php index 84aee9b0c..107375d94 100644 --- a/admin/includes/modules/dashboard/d_paypal_app.php +++ b/admin/includes/modules/dashboard/d_paypal_app.php @@ -55,54 +55,9 @@ function getOutput() { $get_balance_url = tep_href_link('paypal.php', 'action=balance&subaction=retrieve&type=PPTYPE'); $output = << -.pp-container { - font-size: 12px; - line-height: 1.5; -} - -.pp-panel { - padding: 1px 10px; - margin-bottom: 15px; -} - -.pp-panel.pp-panel-success { - background-color: #e8ffe1; - border-left: 2px solid #a0e097; - color: #349a20; -} - -.pp-panel-header-success { - background-color: #a0e097; - background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1)); - font-size: 12px; - color: #fff; - margin: 0; - padding: 3px 15px; -} - -.pp-panel.pp-panel-warning { - background-color: #fff4dd; - border-left: 2px solid #e2ab62; - color: #cd7c20; -} - -.pp-panel-header-warning { - background-color: #e2ab62; - background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1)); - font-size: 12px; - color: #fff; - margin: 0; - padding: 3px 15px; -} - -small .pp-button { - font-size: 11px !important; -} -
-