function views_language_list

Same name in other branches
  1. 7.x-3.x views.module \views_language_list()

+ * 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 + * @param $all + * Boolean to return all languages or only enabled ones + * + * @see locale_language_list +

5 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/translation/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/translation/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.

File

./views.module, line 575

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;
}