public static function AdminHelper::getOtherEnabledLanguages in moderated content bulk publish 8
Same name and namespace in other branches
- 2.0.x src/AdminHelper.php \Drupal\moderated_content_bulk_publish\AdminHelper::getOtherEnabledLanguages()
- 1.0.x src/AdminHelper.php \Drupal\moderated_content_bulk_publish\AdminHelper::getOtherEnabledLanguages()
Helper function to get all enabled languages, excluding current language.
File
- src/
AdminHelper.php, line 21
Class
Namespace
Drupal\moderated_content_bulk_publishCode
public static function getOtherEnabledLanguages() {
// Get the list of all languages
$language = \Drupal::languageManager()
->getCurrentLanguage();
$languages = \Drupal::languageManager()
->getLanguages();
$other_languages = array();
// Add each enabled language, aside from the current language to an array.
foreach ($languages as $field_language_code => $field_language) {
if ($field_language_code != $language
->getId()) {
$other_languages[$field_language_code] = $field_language
->getName();
}
}
return $other_languages;
}