function views_language_list

cis7 views.module views_language_list($field = 'name', $all = FALSE)
cle7 views.module views_language_list($field = 'name', $all = FALSE)
elmsmedia7 views.module views_language_list($field = 'name', $all = FALSE)
icor7 views.module views_language_list($field = 'name', $all = FALSE)
meedjum_blog7 views.module views_language_list($field = 'name', $all = FALSE)
mooc7 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 sites/all/modules/ulmus/views/modules/locale/views_handler_argument_locale_language.inc
views_handler_argument_node_language::node_language in sites/all/modules/ulmus/views/modules/node/views_handler_argument_node_language.inc
views_handler_field_node_language::render in sites/all/modules/ulmus/views/modules/locale/views_handler_field_node_language.inc
Render the field.
views_handler_filter_locale_language::get_value_options in sites/all/modules/ulmus/views/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 sites/all/modules/ulmus/views/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

sites/all/modules/ulmus/views/views.module, line 874
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;
}