You are here

function taxonomy_server_get_preferred_uri in Taxonomy import/export via XML 7

Get the best uri requested, based on content negotiation and guesswork.

stolen from neologism.module

File

taxonomy_server/taxonomy_server.module, line 399
Extends taxonomy_xml to publish downloadable or queriable taxonomy vocabularies and terms. Extends the Drupal URLs to make vocabulary information available under /taxonomy/vocabulary and /taxonomy/vocabulary/{vid}.

Code

function taxonomy_server_get_preferred_uri($uri, $accept) {
  $uri = "http://" . $_SERVER["HTTP_HOST"] . $uri;
  $preferred = taxonomy_server_get_preferred_content($accept);
  if (substr($uri, -1) == "/") {
    return $uri . $preferred;
  }
  else {
    return $uri . "/" . $preferred;
  }
}