Updates the language type configuration.
function language_types_set() {
// Ensure that we are getting the defined language negotiation information. An
// invocation of module_enable() or module_disable() could outdate the cached
// information.
drupal_static_reset('language_types_info');
drupal_static_reset('language_negotiation_info');
// Determine which language types are configurable and which not by checking
// whether the 'fixed' key is defined. Non-configurable (fixed) language types
// have their language negotiation settings stored there.
$language_types = array();
$negotiation_info = language_negotiation_info();
foreach (language_types_info() as $type => $info) {
if (isset($info['fixed'])) {
$language_types[$type] = FALSE;
$method_weights = array();
foreach ($info['fixed'] as $weight => $method_id) {
if (isset($negotiation_info[$method_id])) {
$method_weights[$method_id] = $weight;
}
}
language_negotiation_set($type, $method_weights);
}
else {
$language_types[$type] = TRUE;
}
}
// Save enabled language types.
variable_set('language_types', $language_types);
// Ensure that subsequent calls of language_types_get_configurable() return
// the updated language type information.
drupal_static_reset('language_types_get_configurable');
}