You are here

function language_provider_weight in Drupal 7

Returns the passed language negotiation provider weight or a default value.

Parameters

$provider: A language negotiation provider data structure.

Return value

A numeric weight.

Related topics

2 calls to language_provider_weight()
language_negotiation_set in includes/language.inc
Saves a list of language negotiation providers.
_locale_languages_configure_form_language_table in modules/locale/locale.admin.inc
Helper function to build a language provider table.

File

includes/language.inc, line 470
Language Negotiation API.

Code

function language_provider_weight($provider) {
  $default = is_numeric($provider) ? $provider : 0;
  return isset($provider['weight']) && is_numeric($provider['weight']) ? $provider['weight'] : $default;
}