function language_list

7.x bootstrap.inc language_list($field = 'language')
6.x bootstrap.inc language_list($field = 'language', $reset = FALSE)

Get a list of languages set up indexed by the specified key

Parameters

$field The field to index the list with.:

$reset Boolean to request a reset of the list.:

25 calls to language_list()
language_from_browser in drupal-6.x/includes/language.inc
Identify language from the Accept-language HTTP header we got.
language_initialize in drupal-6.x/includes/language.inc
Choose a language for the page, based on language negotiation settings.
locale_batch_by_component in drupal-6.x/includes/locale.inc
Prepare a batch to run when installing modules or enabling themes. This batch will import translations for the newly added components in all the languages already set up on the site.
locale_block in drupal-6.x/modules/locale/locale.module
Implementation of hook_block(). Displays a language switcher. Translation links may be provided by other modules.
locale_get_plural in drupal-6.x/modules/locale/locale.module
Returns plural form index for a specific number.

... See full list

1 string reference to 'language_list'
node_filters in drupal-6.x/modules/node/node.admin.inc
List node administration filters that can be applied.

File

drupal-6.x/includes/bootstrap.inc, line 1259
Functions that need to be loaded on every Drupal request.

Code

function language_list($field = 'language', $reset = FALSE) {
  static $languages = NULL;

  // Reset language list
  if ($reset) {
    $languages = NULL;
  }

  // Init language list
  if (!isset($languages)) {
    if (variable_get('language_count', 1) > 1 || module_exists('locale')) {
      $result = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC');
      while ($row = db_fetch_object($result)) {
        $languages['language'][$row->language] = $row;
      }
    }
    else {
      // No locale module, so use the default language only.
      $default = language_default();
      $languages['language'][$default->language] = $default;
    }
  }

  // Return the array indexed by the right field
  if (!isset($languages[$field])) {
    $languages[$field] = array();
    foreach ($languages['language'] as $lang) {
      // Some values should be collected into an array
      if (in_array($field, array('enabled', 'weight'))) {
        $languages[$field][$lang->$field][$lang->language] = $lang;
      }
      else {
        $languages[$field][$lang->$field] = $lang;
      }
    }
  }
  return $languages[$field];
}