Checks whether a language negotiation method is enabled for a language type.
$method_id: The language negotiation method ID.
$type: (optional) The language type. If none is passed, all the configurable language types will be inspected.
TRUE if the method is enabled for at least one of the given language types, or FALSE otherwise.
function language_negotiation_method_enabled($method_id, $type = NULL) {
$language_types = !empty($type) ? array(
$type,
) : language_types_get_configurable();
foreach ($language_types as $type) {
$negotiation = variable_get("language_negotiation_{$type}", array());
if (isset($negotiation[$method_id])) {
return TRUE;
}
}
return FALSE;
}