You are here

public function DisableLanguageManager::getEnabledLanguages in Disable language 8

1 call to DisableLanguageManager::getEnabledLanguages()
DisableLanguageManager::getFirstEnabledLanguage in src/DisableLanguageManager.php

File

src/DisableLanguageManager.php, line 113

Class

DisableLanguageManager
Class DisableLanguageManager.

Namespace

Drupal\disable_language

Code

public function getEnabledLanguages() {
  if (empty($this->enabledLanguages)) {
    foreach ($this
      ->getConfigurableLanguages() as $langcode => $configurableLanguage) {
      $disabled = $configurableLanguage
        ->getThirdPartySetting('disable_language', 'disable');
      if (isset($disabled) && $disabled == 0 || empty($disabled)) {
        $this->enabledLanguages[$langcode] = $configurableLanguage;
      }
    }
  }
  return $this->enabledLanguages;
}