Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

standards updates

  • Loading branch information...
commit 0ad7fb1c67cae1e05943afd898f244fe57871172 1 parent 08ef256
Harald Ponce de Leon haraldpdl authored committed

Showing 13 changed files with 103 additions and 131 deletions. Show diff stats Hide diff stats

  1. +16 18 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_boolean_value.php
  2. +5 7 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_countries_pulldown_menu.php
  3. +7 10 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_credit_cards_checkbox_field.php
  4. +11 12 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_order_statuses_pull_down_menu.php
  5. +10 11 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_tax_classes_pull_down_menu.php
  6. +2 6 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_textarea_field.php
  7. +5 9 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_weight_classes_pulldown_menu.php
  8. +9 11 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_zone_classes_pull_down_menu.php
  9. +5 7 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_zones_pulldown_menu.php
  10. +2 6 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_boolean_value.php
  11. +11 12 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_order_status_title.php
  12. +10 11 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_tax_class_title.php
  13. +10 11 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_zone_class_title.php
34 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_boolean_value.php
... ... @@ -1,30 +1,26 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
15   - function osc_cfg_set_boolean_value($select_array, $default, $key = null) {
16   - global $osC_Language;
  11 + use osCommerce\OM\Core\OSCOM;
17 12
  13 + function osc_cfg_set_boolean_value($select_array, $default, $key = null) {
18 14 $string = '';
19 15
20 16 $select_array = explode(',', substr($select_array, 6, -1));
21 17
22 18 $name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
23 19
24   - for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
  20 + for ( $i = 0, $n = count($select_array); $i < $n; $i++ ) {
25 21 $value = trim($select_array[$i]);
26 22
27   - if (strpos($value, '\'') !== false) {
  23 + if ( strpos($value, '\'') !== false ) {
28 24 $value = substr($value, 1, -1);
29 25 } else {
30 26 $value = (int)$value;
@@ -32,22 +28,24 @@ function osc_cfg_set_boolean_value($select_array, $default, $key = null) {
32 28
33 29 $select_array[$i] = $value;
34 30
35   - if ($value === -1) {
36   - $value = $osC_Language->get('parameter_false');
37   - } elseif ($value === 0) {
38   - $value = $osC_Language->get('parameter_optional');
39   - } elseif ($value === 1) {
40   - $value = $osC_Language->get('parameter_true');
  31 + if ( $value === -1 ) {
  32 + $value = OSCOM::getDef('parameter_false');
  33 + } elseif ( $value === 0 ) {
  34 + $value = OSCOM::getDef('parameter_optional');
  35 + } elseif ( $value === 1 ) {
  36 + $value = OSCOM::getDef('parameter_true');
41 37 }
42 38
43 39 $string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
44 40
45   - if ($default == $select_array[$i]) $string .= ' checked="checked"';
  41 + if ( $default == $select_array[$i] ) {
  42 + $string .= ' checked="checked"';
  43 + }
46 44
47 45 $string .= '> ' . $value . '<br />';
48 46 }
49 47
50   - if (!empty($string)) {
  48 + if ( !empty($string) ) {
51 49 $string = substr($string, 0, -6);
52 50 }
53 51
12 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_countries_pulldown_menu.php
... ... @@ -1,23 +1,21 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2006 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Site\Shop\Address;
  12 +
15 13 function osc_cfg_set_countries_pulldown_menu($default, $key = null) {
16 14 $name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
17 15
18 16 $countries_array = array();
19 17
20   - foreach (osC_Address::getCountries() as $country) {
  18 + foreach ( Address::getCountries() as $country ) {
21 19 $countries_array[] = array('id' => $country['id'],
22 20 'text' => $country['name']);
23 21 }
17 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_credit_cards_checkbox_field.php
... ... @@ -1,30 +1,27 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2006 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 +
15 13 function osc_cfg_set_credit_cards_checkbox_field($default, $key = null) {
16   - global $osC_Database;
  14 + $OSCOM_Database = Registry::get('Database');
17 15
18 16 $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . '][]';
19 17
20 18 $cc_array = array();
21 19
22   - $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');
23   - $Qcc->bindTable(':table_credit_cards', TABLE_CREDIT_CARDS);
  20 + $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');
24 21 $Qcc->bindInt(':credit_card_status', 1);
25 22 $Qcc->execute();
26 23
27   - while ($Qcc->next()) {
  24 + while ( $Qcc->next() ) {
28 25 $cc_array[] = array('id' => $Qcc->valueInt('id'),
29 26 'text' => $Qcc->value('credit_card_name'));
30 27 }
23 ...merce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_order_statuses_pull_down_menu.php
... ... @@ -1,31 +1,30 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 + use osCommerce\OM\Core\OSCOM;
  13 +
15 14 function osc_cfg_set_order_statuses_pull_down_menu($default, $key = null) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Database = Registry::get('Database');
  16 + $OSCOM_Language = Registry::get('Language');
17 17
18 18 $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
19 19
20 20 $statuses_array = array(array('id' => '0',
21   - 'text' => $osC_Language->get('default_entry')));
  21 + 'text' => OSCOM::getDef('default_entry')));
22 22
23   - $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');
24   - $Qstatuses->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
25   - $Qstatuses->bindInt(':language_id', $osC_Language->getID());
  23 + $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');
  24 + $Qstatuses->bindInt(':language_id', $OSCOM_Language->getID());
26 25 $Qstatuses->execute();
27 26
28   - while ($Qstatuses->next()) {
  27 + while ( $Qstatuses->next() ) {
29 28 $statuses_array[] = array('id' => $Qstatuses->valueInt('orders_status_id'),
30 29 'text' => $Qstatuses->value('orders_status_name'));
31 30 }
21 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_tax_classes_pull_down_menu.php
... ... @@ -1,30 +1,29 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\OSCOM;
  12 + use osCommerce\OM\Core\Registry;
  13 +
15 14 function osc_cfg_set_tax_classes_pull_down_menu($default, $key = null) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Language = Registry::get('Language');
  16 + $OSCOM_Database = Registry::get('Database');
17 17
18 18 $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
19 19
20 20 $tax_class_array = array(array('id' => '0',
21   - 'text' => $osC_Language->get('parameter_none')));
  21 + 'text' => OSCOM::getDef('parameter_none')));
22 22
23   - $Qclasses = $osC_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
24   - $Qclasses->bindTable(':table_tax_class', TABLE_TAX_CLASS);
  23 + $Qclasses = $OSCOM_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
25 24 $Qclasses->execute();
26 25
27   - while ($Qclasses->next()) {
  26 + while ( $Qclasses->next() ) {
28 27 $tax_class_array[] = array('id' => $Qclasses->valueInt('tax_class_id'),
29 28 'text' => $Qclasses->value('tax_class_title'));
30 29 }
8 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_textarea_field.php
... ... @@ -1,11 +1,7 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2006 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
14 ...mmerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_weight_classes_pulldown_menu.php
... ... @@ -1,25 +1,21 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2006 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
15   - function osc_cfg_set_weight_classes_pulldown_menu($default, $key = null) {
16   - global $osC_Database, $osC_Language;
  11 + use osCommerce\OM\Core\Site\Shop\Weight;
17 12
  13 + function osc_cfg_set_weight_classes_pulldown_menu($default, $key = null) {
18 14 $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
19 15
20 16 $weight_class_array = array();
21 17
22   - foreach (osC_Weight::getClasses() as $class) {
  18 + foreach ( Weight::getClasses() as $class ) {
23 19 $weight_class_array[] = array('id' => $class['id'],
24 20 'text' => $class['title']);
25 21 }
20 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_zone_classes_pull_down_menu.php
... ... @@ -1,30 +1,28 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 + use osCommerce\OM\Core\OSCOM;
  13 +
15 14 function osc_cfg_set_zone_classes_pull_down_menu($default, $key = null) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Database = Registry::get('Database');
17 16
18 17 $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . ']';
19 18
20 19 $zone_class_array = array(array('id' => '0',
21   - 'text' => $osC_Language->get('parameter_none')));
  20 + 'text' => OSCOM::getDef('parameter_none')));
22 21
23   - $Qzones = $osC_Database->query('select geo_zone_id, geo_zone_name from :table_geo_zones order by geo_zone_name');
24   - $Qzones->bindTable(':table_geo_zones', TABLE_GEO_ZONES);
  22 + $Qzones = $OSCOM_Database->query('select geo_zone_id, geo_zone_name from :table_geo_zones order by geo_zone_name');
25 23 $Qzones->execute();
26 24
27   - while ($Qzones->next()) {
  25 + while ( $Qzones->next() ) {
28 26 $zone_class_array[] = array('id' => $Qzones->valueInt('geo_zone_id'),
29 27 'text' => $Qzones->value('geo_zone_name'));
30 28 }
12 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_set_zones_pulldown_menu.php
... ... @@ -1,23 +1,21 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2006 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Site\Shop\Address;
  12 +
15 13 function osc_cfg_set_zones_pulldown_menu($default, $key = null) {
16 14 $name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');
17 15
18 16 $zones_array = array();
19 17
20   - foreach (osC_Address::getZones() as $zone) {
  18 + foreach ( Address::getZones() as $zone ) {
21 19 $zones_array[] = array('id' => $zone['id'],
22 20 'text' => $zone['name'],
23 21 'group' => $zone['country_name']);
8 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_boolean_value.php
... ... @@ -1,11 +1,7 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
23 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_order_status_title.php
... ... @@ -1,28 +1,27 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 + use osCommerce\OM\Core\OSCOM;
  13 +
15 14 function osc_cfg_use_get_order_status_title($id) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Database = Registry::get('Database');
  16 + $OSCOM_Language = Registry::get('Language');
17 17
18   - if ($id < 1) {
19   - return $osC_Language->get('default_entry');
  18 + if ( $id < 1 ) {
  19 + return OSCOM::getDef('default_entry');
20 20 }
21 21
22   - $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
23   - $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
  22 + $Qstatus = $OSCOM_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
24 23 $Qstatus->bindInt(':orders_status_id', $id);
25   - $Qstatus->bindInt(':language_id', $osC_Language->getID());
  24 + $Qstatus->bindInt(':language_id', $OSCOM_Language->getID());
26 25 $Qstatus->execute();
27 26
28 27 return $Qstatus->value('orders_status_name');
21 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_tax_class_title.php
... ... @@ -1,26 +1,25 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 + use osCommerce\OM\Core\OSCOM;
  13 +
15 14 function osc_cfg_use_get_tax_class_title($id) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Database = Registry::get('Database');
  16 + $OSCOM_Language = Registry::get('Language');
17 17
18   - if ($id < 1) {
19   - return $osC_Language->get('parameter_none');
  18 + if ( $id < 1 ) {
  19 + return OSCOM::getDef('parameter_none');
20 20 }
21 21
22   - $Qclass = $osC_Database->query('select tax_class_title from :table_tax_class where tax_class_id = :tax_class_id');
23   - $Qclass->bindTable(':table_tax_class', TABLE_TAX_CLASS);
  22 + $Qclass = $OSCOM_Database->query('select tax_class_title from :table_tax_class where tax_class_id = :tax_class_id');
24 23 $Qclass->bindInt(':tax_class_id', $id);
25 24 $Qclass->execute();
26 25
21 osCommerce/OM/Core/Site/Admin/includes/functions/cfg_parameters/osc_cfg_use_get_zone_class_title.php
... ... @@ -1,26 +1,25 @@
1 1 <?php
2 2 /*
3   - $Id: $
4   -
5   - osCommerce, Open Source E-Commerce Solutions
6   - http://www.oscommerce.com
7   -
8   - Copyright (c) 2007 osCommerce
  3 + osCommerce Online Merchant $osCommerce-SIG$
  4 + Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
9 5
10 6 This program is free software; you can redistribute it and/or modify
11 7 it under the terms of the GNU General Public License v2 (1991)
12 8 as published by the Free Software Foundation.
13 9 */
14 10
  11 + use osCommerce\OM\Core\Registry;
  12 + use osCommerce\OM\Core\OSCOM;
  13 +
15 14 function osc_cfg_use_get_zone_class_title($id) {
16   - global $osC_Database, $osC_Language;
  15 + $OSCOM_Database = Registry::get('Database');
  16 + $OSCOM_Language = Registry::get('Language');
17 17
18   - if ($id == '0') {
19   - return $osC_Language->get('parameter_none');
  18 + if ( $id == '0' ) {
  19 + return OSCOM::getDef('parameter_none');
20 20 }
21 21
22   - $Qclass = $osC_Database->query('select geo_zone_name from :table_geo_zones where geo_zone_id = :geo_zone_id');
23   - $Qclass->bindTable(':table_geo_zones', TABLE_GEO_ZONES);
  22 + $Qclass = $OSCOM_Database->query('select geo_zone_name from :table_geo_zones where geo_zone_id = :geo_zone_id');
24 23 $Qclass->bindInt(':geo_zone_id', $id);
25 24 $Qclass->execute();
26 25

0 comments on commit 0ad7fb1

Please sign in to comment.
Something went wrong with that request. Please try again.