| @@ 513-533 (lines=21) @@ | ||
| 510 | return $value; |
|
| 511 | } |
|
| 512 | ||
| 513 | function saveParameter($key, $value, $title = null, $description = null, $set_func = null) { |
|
| 514 | if ( !defined($key) ) { |
|
| 515 | if ( !isset($title) ) { |
|
| 516 | $title = 'Braintree App Parameter'; |
|
| 517 | } |
|
| 518 | ||
| 519 | if ( !isset($description) ) { |
|
| 520 | $description = 'A parameter for the Braintree Application.'; |
|
| 521 | } |
|
| 522 | ||
| 523 | 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())"); |
|
| 524 | ||
| 525 | if ( isset($set_func) ) { |
|
| 526 | tep_db_query("update " . TABLE_CONFIGURATION . " set set_function = '" . tep_db_input($set_func) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 527 | } |
|
| 528 | ||
| 529 | define($key, $value); |
|
| 530 | } else { |
|
| 531 | tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($value) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 532 | } |
|
| 533 | } |
|
| 534 | ||
| 535 | function deleteParameter($key) { |
|
| 536 | tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = '" . tep_db_input($key) . "'"); |
|
| @@ 588-608 (lines=21) @@ | ||
| 585 | return $value; |
|
| 586 | } |
|
| 587 | ||
| 588 | function saveParameter($key, $value, $title = null, $description = null, $set_func = null) { |
|
| 589 | if ( !defined($key) ) { |
|
| 590 | if ( !isset($title) ) { |
|
| 591 | $title = 'PayPal App Parameter'; |
|
| 592 | } |
|
| 593 | ||
| 594 | if ( !isset($description) ) { |
|
| 595 | $description = 'A parameter for the PayPal Application.'; |
|
| 596 | } |
|
| 597 | ||
| 598 | 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())"); |
|
| 599 | ||
| 600 | if ( isset($set_func) ) { |
|
| 601 | tep_db_query("update " . TABLE_CONFIGURATION . " set set_function = '" . tep_db_input($set_func) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 602 | } |
|
| 603 | ||
| 604 | define($key, $value); |
|
| 605 | } else { |
|
| 606 | tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($value) . "' where configuration_key = '" . tep_db_input($key) . "'"); |
|
| 607 | } |
|
| 608 | } |
|
| 609 | ||
| 610 | function deleteParameter($key) { |
|
| 611 | tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = '" . tep_db_input($key) . "'"); |
|