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) ?>
-
-
-
-
-
+ = TABLE_CERTIFIED_ADDONS_TITLE ?>
+ = TABLE_CERTIFIED_ADDONS_OWNER ?>
+ = TABLE_CERTIFIED_ADDONS_RATING ?>
+ = TABLE_CERTIFIED_ADDONS_REMARKS ?>
+ = TABLE_CERTIFIED_ADDONS_DATE ?>
@@ -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';
?>
-
-
+
= $cfg_group['configuration_group_title']; ?>
+
-
-
-
+ = TABLE_HEADING_CONFIGURATION_TITLE; ?>
+ = TABLE_HEADING_CONFIGURATION_VALUE; ?>
+ = TABLE_HEADING_ACTION; ?>
/', $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 ' '; } ?>
+ = $configuration['configuration_title']; ?>
+ = htmlspecialchars($cfgValue); ?>
+ = $icon ?>
+
@@ -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"') . '' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews) . '
'];
+ 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"') . '' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews) . '
'];
+ }
$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 .= '' . MODULE_ADMIN_DASHBOARD_LATEST_NEWS_TITLE . ' ';
@@ -43,18 +36,22 @@ function getOutput() {
$output .= ' ';
$output .= '';
+ $count = 0;
foreach ($feed->channel->item as $item) {
$output .= '';
$output .= '' . $item->title . ' ';
$output .= '' . date("F j, Y", strtotime($item->pubDate)) . ' ';
$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 .= '
';
-
+
$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;
-}
-
-
-
- {$new_update_notice}
+
+
-
-
-
-
-
-
{$receiving_balance_progress}
+
+
+
{$receiving_balance_progress}
+
-
-
-
-
-
{$receiving_balance_progress}
+
+
+
+
+
+
{$receiving_balance_progress}
+
-
+
display_links($values_query_numrows, MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $value_page, 'option_page=' . $option_page . '&attribute_page=' . $attribute_page, 'value_page'); ?>
+
diff --git a/admin/reviews.php b/admin/reviews.php
index 43bddd5b6..1e17495b9 100644
--- a/admin/reviews.php
+++ b/admin/reviews.php
@@ -10,17 +10,17 @@
Released under the GNU General Public License
*/
- require('includes/application_top.php');
+ require 'includes/application_top.php';
$action = $_GET['action'] ?? '';
-
+
$OSCOM_Hooks->call('reviews', 'preAction');
if (tep_not_null($action)) {
switch ($action) {
case 'setflag':
- tep_db_query("UPDATE reviews SET reviews_status = '" . $_GET['flag'] . "', last_modified = NOW() WHERE reviews_id = " . (int)$_GET['rID']);
-
+ tep_db_query("UPDATE reviews SET reviews_status = " . (int)$_GET['flag'] . ", last_modified = NOW() WHERE reviews_id = " . (int)$_GET['rID']);
+
$OSCOM_Hooks->call('reviews', 'setFlagAction');
tep_redirect(tep_href_link('reviews.php', 'page=' . (int)$_GET['page'] . '&rID=' . $_GET['rID']));
@@ -31,9 +31,9 @@
$reviews_text = tep_db_prepare_input($_POST['reviews_text']);
$reviews_status = tep_db_prepare_input($_POST['reviews_status']);
- tep_db_query("update reviews set reviews_rating = '" . tep_db_input($reviews_rating) . "', reviews_status = '" . tep_db_input($reviews_status) . "', last_modified = now() where reviews_id = '" . (int)$reviews_id . "'");
- tep_db_query("update reviews_description set reviews_text = '" . tep_db_input($reviews_text) . "' where reviews_id = '" . (int)$reviews_id . "'");
-
+ tep_db_query("UPDATE reviews SET reviews_rating = '" . tep_db_input($reviews_rating) . "', reviews_status = '" . tep_db_input($reviews_status) . "', last_modified = NOW() WHERE reviews_id = " . (int)$reviews_id);
+ tep_db_query("UPDATE reviews_description SET reviews_text = '" . tep_db_input($reviews_text) . "' WHERE reviews_id = " . (int)$reviews_id);
+
$OSCOM_Hooks->call('reviews', 'updateAction');
tep_redirect(tep_href_link('reviews.php', 'page=' . (int)$_GET['page'] . '&rID=' . $reviews_id));
@@ -41,45 +41,44 @@
case 'deleteconfirm':
$reviews_id = tep_db_prepare_input($_GET['rID']);
- tep_db_query("delete from reviews where reviews_id = '" . (int)$reviews_id . "'");
- tep_db_query("delete from reviews_description where reviews_id = '" . (int)$reviews_id . "'");
-
+ tep_db_query("DELETE FROM reviews WHERE reviews_id = " . (int)$reviews_id);
+ tep_db_query("DELETE FROM reviews_description WHERE reviews_id = " . (int)$reviews_id);
+
$OSCOM_Hooks->call('reviews', 'deleteConfirmAction');
tep_redirect(tep_href_link('reviews.php', 'page=' . (int)$_GET['page']));
break;
case 'addnew':
$products_id = tep_db_prepare_input($_POST['products_id']);
- $customers_id = tep_db_prepare_input($_POST['customer_id']);
+ $customer_id = tep_db_prepare_input($_POST['customer_id']);
$review = tep_db_prepare_input($_POST['reviews_text']);
$rating = tep_db_prepare_input($_POST['reviews_rating']);
- tep_db_query("insert into reviews (products_id, customers_id, customers_name, reviews_rating, date_added, reviews_status) values ('" . (int)$products_id . "', '" . (int)$customers_id . "', '" . tep_customers_name($customers_id) . "', '" . (int)$rating . "', now(), 1)");
+ tep_db_query("INSERT INTO reviews (products_id, customers_id, customers_name, reviews_rating, date_added, reviews_status) VALUES (" . (int)$products_id . ", " . (int)$customer_id . ", '" . tep_customers_name($customer_id) . "', " . (int)$rating . ", NOW(), 1)");
$insert_id = tep_db_insert_id();
- tep_db_query("insert into reviews_description (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . $review . "')");
-
+ tep_db_query("INSERT INTO reviews_description (reviews_id, languages_id, reviews_text) VALUES (" . (int)$insert_id . ", " . (int)$_SESSION['languages_id'] . ", '" . tep_db_input($review) . "')");
+
$OSCOM_Hooks->call('reviews', 'addNewAction');
tep_redirect(tep_href_link('reviews.php', tep_get_all_get_params(['action'])));
- break;
+ break;
}
}
-
+
$OSCOM_Hooks->call('reviews', 'postAction');
- require('includes/template_top.php');
+ require 'includes/template_top.php';
?>