Revision af0cde1a
Added by Andreas Kohlbecker over 7 years ago
modules/cdm_dataportal/cdm_api/cdm_api.module | ||
---|---|---|
2031 | 2031 |
function cdm_http_request($uri, $method = "GET", $data = NULL) { |
2032 | 2032 |
static $acceptLanguage = NULL; |
2033 | 2033 |
$header = array(); |
2034 |
|
|
2035 |
if(!$acceptLanguage && module_exists('i18n')){ |
|
2036 |
$acceptLanguage = i18n_language_content()->language; |
|
2037 |
} |
|
2034 | 2038 |
|
2035 | 2039 |
if (!$acceptLanguage) { |
2036 | 2040 |
if (function_exists('apache_request_headers')) { |
... | ... | |
2039 | 2043 |
$acceptLanguage = $headers['Accept-Language']; |
2040 | 2044 |
} |
2041 | 2045 |
} |
2042 |
if (!$acceptLanguage) { |
|
2043 |
// DEFAULT TODO make configurable. |
|
2044 |
$acceptLanguage = "en"; |
|
2045 |
} |
|
2046 | 2046 |
} |
2047 | 2047 |
|
2048 | 2048 |
if ($method != "GET" && $method != "POST") { |
Also available in: Unified diff
using the i18n module to determine the content language