language_negotiation_get
function language_negotiation_get
language_negotiation_get($type, $provider_id = NULL)
Checks whether a language negotiation provider is enabled for a language type.
This has two possible behaviors:
- If $provider_id is given return its ID if enabled, FALSE otherwise.
- If no ID is passed the first enabled language negotiation provider is returned.
Parameters
$type: The language negotiation provider type.
$provider_id: The language negotiation provider ID.
Return value
The provider ID if it is enabled, FALSE otherwise.
Related topics
File
- includes/language.inc, line 230
- Language Negotiation API.
Code
function language_negotiation_get($type, $provider_id = NULL) { $negotiation = variable_get("language_negotiation_$type", array()); if (empty($negotiation)) { return empty($provider_id) ? LANGUAGE_NEGOTIATION_DEFAULT : FALSE; } if (empty($provider_id)) { return key($negotiation); } if (isset($negotiation[$provider_id])) { return $provider_id; } return FALSE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!language.inc/function/language_negotiation_get/7.x