function HTTP_GET() { $json = new paloSantoJSON(); $pCore_calendar = new core_Calendar(); $fields = isset($_GET["fields"]) ? $_GET["fields"] : NULL; if (is_null($fields)) { header("HTTP/1.1 400 Bad Request"); $error = "You need to specify by GET the parameter \"fields\""; $json->set_status("ERROR"); $json->set_error($error); return $json->createJSON(); } $result = $pCore_calendar->getHash($fields); if ($result === FALSE) { $error = $pCore_calendar->getError(); if ($error["fc"] == "DBERROR") { header("HTTP/1.1 500 Internal Server Error"); } else { header("HTTP/1.1 400 Bad Request"); } $json->set_status("ERROR"); $json->set_error($error); return $json->createJSON(); } else { $json = new Services_JSON(); return $json->encode($result); } }