language_negotiation_purge

7 language.inc language_negotiation_purge()
8 language.inc language_negotiation_purge()

Updates language configuration to remove any language provider that is no longer defined.

1 call to language_negotiation_purge()

File

includes/language.inc, line 217
Multiple language handling functionality.

Code

function language_negotiation_purge() {
  // 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_negotiation_info');
  drupal_static_reset('language_types_info');

  $defined_providers = language_negotiation_info();
  foreach (language_types_info() as $type => $type_info) {
    $weight = 0;
    $negotiation = array();
    foreach (variable_get("language_negotiation_$type", array()) as $id => $provider) {
      if (isset($defined_providers[$id])) {
        $negotiation[$id] = $weight++;
      }
    }
    language_negotiation_set($type, $negotiation);
  }
}
Login or register to post comments