Ejemplo n.º 1
0
 /**
  * Call OKAPI to return the URL of the cache based on given params
  * @param array $params - search params for the okapi call
  */
 private function getUrlOnly(array $params)
 {
     //we want only cache details page URL from OKAPI
     $params['retr_params'] = '{"fields":"url"}';
     //call OKAPI - OKAPI displays the results
     \okapi\Facade::service_display('services/caches/shortcuts/search_and_retrieve', $this->user_id, $params);
 }
Ejemplo n.º 2
0
        $params['exclude_my_own'] = "true";
    }
    # h_found, h_noattempt - convert to OKAPI's "found_status" parameter.
    $h_found = $_GET['h_found'] == "true";
    $h_noattempt = $_GET['h_noattempt'] == "true";
    if ($h_found && !$h_noattempt) {
        $params['found_status'] = "notfound_only";
    } elseif (!$h_found && $h_noattempt) {
        $params['found_status'] = "found_only";
    } elseif (!$h_found && !$h_noattempt) {
        $params['found_status'] = "either";
    } else {
        $force_result_empty = true;
    }
}
#
# We have all the parameters. Note, that some mapper-compatible parameter sets
# always render empty results. We will just exit, without producing any image
# whatsoever.
#
if ($force_result_empty) {
    die;
}
if (!$user_id) {
    die;
}
# End of "buggy" code. Re-enable OKAPI's error handler.
\okapi\OkapiErrorHandler::reenable();
# Get OKAPI's response and display it. Add proper Cache-Control headers.
\okapi\Facade::service_display('services/caches/map/tile', $user_id, $params);