function views_language_list

3.x views.module views_language_list($field = 'name', $all = FALSE)

Returns an array of language names.

This is a one to one copy of locale_language_list because we can't rely on enabled locale module.

Parameters

$field: 'name' => names in current language, localized 'native' => native names

$all: Boolean to return all languages or only enabled ones

See also

locale_language_list()

6 calls to views_language_list()
views_handler_argument_locale_language::locale_language in modules/locale/views_handler_argument_locale_language.inc
views_handler_argument_node_language::node_language in modules/node/views_handler_argument_node_language.inc
views_handler_field_node_language::render in modules/locale/views_handler_field_node_language.inc
Render the field.
views_handler_filter_locale_language::get_value_options in modules/locale/views_handler_filter_locale_language.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
views_handler_filter_node_language::get_value_options in modules/locale/views_handler_filter_node_language.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

... See full list

File

./views.module, line 871
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_language_list($field = 'name', $all = FALSE) {
  if ($all) {
    $languages = language_list();
  }
  else {
    $languages = language_list('enabled');
    $languages = $languages[1];
  }
  $list = array();
  foreach ($languages as $language) {
    $list[$language->language] = ($field == 'name') ? t($language->name) : $language->$field;
  }
  return $list;
}