= REST Interface = Resources are accessible via [wiki:RESTController REST] URIs to allow the creation of Mash-ups. JSON uploads should be PUT to http://server.domain/eden/module/resource.json NB JSON must not include trailing commas in lists (just like Internet Explorer). [This is a SimpleJSON limitation] == !WordPress integration == Courtesy of timClicks. This example is for !HumanityRoad's !WordPress to pull in Hospitals data from Sahana Eden: {{{
%s
%s
'.implode($a).'
'; }; // untested function check_and_set($item, $assoc_array) { if (array_key_exists($item, $assoc_array)) { $val = $assoc_array[$item]; } else { $val = ' '; }; return $val; }; function process_hospital_info($hospital) { global $hospital_table_format; $city = check_and_set('city', $hospital); $website = check_and_set('website', $hospital); $name = check_and_set('name', $hospital); $address = check_and_set('address', $hospital); $phone = check_and_set('phone', $hospital); $email = check_and_set('email', $hospital); $lat = check_and_set('@lat', $hospital['$k_location_id']); $lon = check_and_set('@lon', $hospital['$k_location_id']); $comments = check_and_set('comments', $hospital); $modified_by = check_and_set('@modified_by', $hospital); $last_modified = check_and_set('@modified_on', $hospital); $uuid = check_and_set('@uuid', $hospital); return sprintf($hospital_table_format, $website, $name, $address, $city, $phone, $website, $email, $lat, $lon, $comments, $modified_by, $last_modified, $uuid); }; echo $head; echo '