Permalink
Browse files

standards updates

  • Loading branch information...
1 parent 08ef256 commit 0ad7fb1c67cae1e05943afd898f244fe57871172 @haraldpdl haraldpdl committed with Aug 3, 2010
@@ -1,53 +1,51 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
- function osc_cfg_set_boolean_value($select_array, $default, $key = null) {
- global $osC_Language;
+ use osCommerce\OM\Core\OSCOM;
+ function osc_cfg_set_boolean_value($select_array, $default, $key = null) {
$string = '';
$select_array = explode(',', substr($select_array, 6, -1));
$name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
- for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
+ for ( $i = 0, $n = count($select_array); $i < $n; $i++ ) {
$value = trim($select_array[$i]);
- if (strpos($value, '\'') !== false) {
+ if ( strpos($value, '\'') !== false ) {
$value = substr($value, 1, -1);
} else {
$value = (int)$value;
}
$select_array[$i] = $value;
- if ($value === -1) {
- $value = $osC_Language->get('parameter_false');
- } elseif ($value === 0) {
- $value = $osC_Language->get('parameter_optional');
- } elseif ($value === 1) {
- $value = $osC_Language->get('parameter_true');
+ if ( $value === -1 ) {
+ $value = OSCOM::getDef('parameter_false');
+ } elseif ( $value === 0 ) {
+ $value = OSCOM::getDef('parameter_optional');
+ } elseif ( $value === 1 ) {
+ $value = OSCOM::getDef('parameter_true');
}
$string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
- if ($default == $select_array[$i]) $string .= ' checked="checked"';
+ if ( $default == $select_array[$i] ) {
+ $string .= ' checked="checked"';
+ }
$string .= '> ' . $value . '<br />';
}
- if (!empty($string)) {
+ if ( !empty($string) ) {
$string = substr($string, 0, -6);
}
@@ -1,23 +1,21 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2006 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Site\Shop\Address;
+
function osc_cfg_set_countries_pulldown_menu($default, $key = null) {
$name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
$countries_array = array();
- foreach (osC_Address::getCountries() as $country) {
+ foreach ( Address::getCountries() as $country ) {
$countries_array[] = array('id' => $country['id'],
'text' => $country['name']);
}
@@ -1,30 +1,27 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2006 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Registry;
+
function osc_cfg_set_credit_cards_checkbox_field($default, $key = null) {
- global $osC_Database;
+ $OSCOM_Database = Registry::get('Database');
$name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . '][]';
$cc_array = array();
- $Qcc = $osC_Database->query('select id, credit_card_name from :table_credit_cards where credit_card_status = :credit_card_status order by sort_order, credit_card_name');
- $Qcc->bindTable(':table_credit_cards', TABLE_CREDIT_CARDS);
+ $Qcc = $OSCOM_Database->query('select id, credit_card_name from :table_credit_cards where credit_card_status = :credit_card_status order by sort_order, credit_card_name');
$Qcc->bindInt(':credit_card_status', 1);
$Qcc->execute();
- while ($Qcc->next()) {
+ while ( $Qcc->next() ) {
$cc_array[] = array('id' => $Qcc->valueInt('id'),
'text' => $Qcc->value('credit_card_name'));
}
@@ -1,31 +1,30 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
function osc_cfg_set_order_statuses_pull_down_menu($default, $key = null) {
- global $osC_Database, $osC_Language;
+ $OSCOM_Database = Registry::get('Database');
+ $OSCOM_Language = Registry::get('Language');
$name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
$statuses_array = array(array('id' => '0',
- 'text' => $osC_Language->get('default_entry')));
+ 'text' => OSCOM::getDef('default_entry')));
- $Qstatuses = $osC_Database->query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id order by orders_status_name');
- $Qstatuses->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
- $Qstatuses->bindInt(':language_id', $osC_Language->getID());
+ $Qstatuses = $OSCOM_Database->query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id order by orders_status_name');
+ $Qstatuses->bindInt(':language_id', $OSCOM_Language->getID());
$Qstatuses->execute();
- while ($Qstatuses->next()) {
+ while ( $Qstatuses->next() ) {
$statuses_array[] = array('id' => $Qstatuses->valueInt('orders_status_id'),
'text' => $Qstatuses->value('orders_status_name'));
}
@@ -1,30 +1,29 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\OSCOM;
+ use osCommerce\OM\Core\Registry;
+
function osc_cfg_set_tax_classes_pull_down_menu($default, $key = null) {
- global $osC_Database, $osC_Language;
+ $OSCOM_Language = Registry::get('Language');
+ $OSCOM_Database = Registry::get('Database');
$name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
$tax_class_array = array(array('id' => '0',
- 'text' => $osC_Language->get('parameter_none')));
+ 'text' => OSCOM::getDef('parameter_none')));
- $Qclasses = $osC_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
- $Qclasses->bindTable(':table_tax_class', TABLE_TAX_CLASS);
+ $Qclasses = $OSCOM_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
$Qclasses->execute();
- while ($Qclasses->next()) {
+ while ( $Qclasses->next() ) {
$tax_class_array[] = array('id' => $Qclasses->valueInt('tax_class_id'),
'text' => $Qclasses->value('tax_class_title'));
}
@@ -1,11 +1,7 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2006 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
@@ -1,25 +1,21 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2006 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
- function osc_cfg_set_weight_classes_pulldown_menu($default, $key = null) {
- global $osC_Database, $osC_Language;
+ use osCommerce\OM\Core\Site\Shop\Weight;
+ function osc_cfg_set_weight_classes_pulldown_menu($default, $key = null) {
$name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
$weight_class_array = array();
- foreach (osC_Weight::getClasses() as $class) {
+ foreach ( Weight::getClasses() as $class ) {
$weight_class_array[] = array('id' => $class['id'],
'text' => $class['title']);
}
@@ -1,30 +1,28 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
function osc_cfg_set_zone_classes_pull_down_menu($default, $key = null) {
- global $osC_Database, $osC_Language;
+ $OSCOM_Database = Registry::get('Database');
$name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
$zone_class_array = array(array('id' => '0',
- 'text' => $osC_Language->get('parameter_none')));
+ 'text' => OSCOM::getDef('parameter_none')));
- $Qzones = $osC_Database->query('select geo_zone_id, geo_zone_name from :table_geo_zones order by geo_zone_name');
- $Qzones->bindTable(':table_geo_zones', TABLE_GEO_ZONES);
+ $Qzones = $OSCOM_Database->query('select geo_zone_id, geo_zone_name from :table_geo_zones order by geo_zone_name');
$Qzones->execute();
- while ($Qzones->next()) {
+ while ( $Qzones->next() ) {
$zone_class_array[] = array('id' => $Qzones->valueInt('geo_zone_id'),
'text' => $Qzones->value('geo_zone_name'));
}
@@ -1,23 +1,21 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2006 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Site\Shop\Address;
+
function osc_cfg_set_zones_pulldown_menu($default, $key = null) {
$name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
$zones_array = array();
- foreach (osC_Address::getZones() as $zone) {
+ foreach ( Address::getZones() as $zone ) {
$zones_array[] = array('id' => $zone['id'],
'text' => $zone['name'],
'group' => $zone['country_name']);
@@ -1,11 +1,7 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
@@ -1,28 +1,27 @@
<?php
/*
- $Id: $
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2007 osCommerce
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
function osc_cfg_use_get_order_status_title($id) {
- global $osC_Database, $osC_Language;
+ $OSCOM_Database = Registry::get('Database');
+ $OSCOM_Language = Registry::get('Language');
- if ($id < 1) {
- return $osC_Language->get('default_entry');
+ if ( $id < 1 ) {
+ return OSCOM::getDef('default_entry');
}
- $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
- $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qstatus = $OSCOM_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
$Qstatus->bindInt(':orders_status_id', $id);
- $Qstatus->bindInt(':language_id', $osC_Language->getID());
+ $Qstatus->bindInt(':language_id', $OSCOM_Language->getID());
$Qstatus->execute();
return $Qstatus->value('orders_status_name');
Oops, something went wrong.

0 comments on commit 0ad7fb1

Please sign in to comment.