| @@ 489-509 (lines=21) @@ | ||
| 486 | return $value; |
|
| 487 | } |
|
| 488 | ||
| 489 | function saveParameter($key, $value, $title = null, $description = null, $set_func = null) { |
|
| 490 | if ( !defined($key) ) { |
|
| 491 | if ( !isset($title) ) { |
|
| 492 | $title = 'Braintree App Parameter'; |
|
| 493 | } |
|
| 494 | ||
| 495 | if ( !isset($description) ) { |
|
| 496 | $description = 'A parameter for the Braintree Application.'; |
|
| 497 | } |
|
| 498 | ||
| 499 | tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . tep_db_input($title) . "', '" . tep_db_input($key) . "', '" . tep_db_input($value) . "', '" . tep_db_input($description) . "', '6', '0', now())"); |
|
| 500 | ||
| 501 | if ( isset($set_func) ) { |
|
| 502 | tep_db_query("update " . TABLE_CONFIGURATION . " set set_function = '" . tep_db_input($set_func) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 503 | } |
|
| 504 | ||
| 505 | define($key, $value); |
|
| 506 | } else { |
|
| 507 | tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($value) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 508 | } |
|
| 509 | } |
|
| 510 | ||
| 511 | function deleteParameter($key) { |
|
| 512 | tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = '" . tep_db_input($key) . "'"); |
|
| @@ 562-582 (lines=21) @@ | ||
| 559 | return $value; |
|
| 560 | } |
|
| 561 | ||
| 562 | function saveParameter($key, $value, $title = null, $description = null, $set_func = null) { |
|
| 563 | if ( !defined($key) ) { |
|
| 564 | if ( !isset($title) ) { |
|
| 565 | $title = 'PayPal App Parameter'; |
|
| 566 | } |
|
| 567 | ||
| 568 | if ( !isset($description) ) { |
|
| 569 | $description = 'A parameter for the PayPal Application.'; |
|
| 570 | } |
|
| 571 | ||
| 572 | tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . tep_db_input($title) . "', '" . tep_db_input($key) . "', '" . tep_db_input($value) . "', '" . tep_db_input($description) . "', '6', '0', now())"); |
|
| 573 | ||
| 574 | if ( isset($set_func) ) { |
|
| 575 | tep_db_query("update " . TABLE_CONFIGURATION . " set set_function = '" . tep_db_input($set_func) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 576 | } |
|
| 577 | ||
| 578 | define($key, $value); |
|
| 579 | } else { |
|
| 580 | tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($value) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 581 | } |
|
| 582 | } |
|
| 583 | ||
| 584 | function deleteParameter($key) { |
|
| 585 | tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = '" . tep_db_input($key) . "'"); |
|