language_types_set
function language_types_set
language_types_set()
Updates the language type configuration.
Related topics
File
- includes/language.inc, line 179
- Language Negotiation API.
Code
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. $defined_providers = language_negotiation_info(); foreach (language_types_info() as $type => $info) { if (isset($info['fixed'])) { $language_types[$type] = FALSE; $negotiation = array(); foreach ($info['fixed'] as $weight => $id) { if (isset($defined_providers[$id])) { $negotiation[$id] = $weight; } } language_negotiation_set($type, $negotiation); } else { $language_types[$type] = TRUE; } } // Save language types. variable_set('language_types', $language_types); // Ensure that subsequent calls of language_types_configurable() return the // updated language type information. drupal_static_reset('language_types_configurable'); }
© 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_types_set/7.x