Changeset 2309863
- Timestamp:
- 05/22/2020 12:26:27 AM (6 years ago)
- Location:
- makemydonation-imo/trunk
- Files:
-
- 2 edited
-
js/mmdimo.edit-form.js (modified) (1 diff)
-
mmdimo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
makemydonation-imo/trunk/js/mmdimo.edit-form.js
r2126495 r2309863 63 63 if ($charities.length) { 64 64 $orghunterCSC.orghunterCSC({ 65 apiURL: ajaxurl, 66 apiData: { 67 action: 'mmdimo_orghunter_csc_ajax', 68 }, 65 apiURL: ajaxurl + '?action=mmdimo_orghunter_csc_ajax&mmdimo_api_call=', 69 66 searchAlias: true, 70 67 stateChosen: false, -
makemydonation-imo/trunk/mmdimo.php
r2150443 r2309863 472 472 function mmdimo_orghunter_csc_ajax() { 473 473 require_once( MMDIMO_PLUGIN_DIR . '/api.php' ); 474 $ path = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']) + 1);475 $ spath = explode('/', $path);474 $spath = explode('mmdimo_api_call=/', $_SERVER['REQUEST_URI']); 475 $path = $spath[1]; 476 476 $response = array(); 477 477 478 switch ($spath[0]) { 479 case 'cities': 480 if (strlen($spath[1]) == 2) { 481 $response = mmdimo_api_request( 'get', 'orghunter/data/' . $path ); 478 if (substr($path, 0, 6) == 'cities' && strlen($path) == 9) { 479 $response = mmdimo_api_request( 'get', 'orghunter/data/' . $path ); 480 } 481 else if (substr($path, 0, 13) == 'charitysearch' || substr($path, 0, 18) == 'charitysearchalias') { 482 $accepted_parameters = array('eligible', 'state', 'city', 'searchTerm'); 483 foreach ($accepted_parameters as $accepted_parameter) { 484 if (isset($_GET[$accepted_parameter])) { 485 $parameters[$accepted_parameter] = $_GET[$accepted_parameter]; 482 486 } 483 break; 484 case 'charitysearch': 485 case 'charitysearchalias': 486 $accepted_parameters = array('eligible', 'state', 'city', 'searchTerm'); 487 foreach ($accepted_parameters as $accepted_parameter) { 488 if (isset($_GET[$accepted_parameter])) { 489 $parameters[$accepted_parameter] = $_GET[$accepted_parameter]; 490 } 491 } 492 $query = http_build_query($parameters); 493 $response = mmdimo_api_request( 'get', 'orghunter/data/' . $path . '?' . $query ); 494 break; 487 } 488 $query = http_build_query($parameters); 489 $response = mmdimo_api_request( 'get', 'orghunter/data/' . $path . '?' . $query ); 495 490 } 496 491
Note: See TracChangeset
for help on using the changeset viewer.