protected function LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher in Lingotek Translation 8.2
Same name and namespace in other branches
- 8 src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 4.0.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.0.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.1.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.2.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.3.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.4.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.5.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.6.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.7.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- 3.8.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
1 call to LingotekSettingsTabPreferencesForm::retrieveLanguageSwitcher()
- LingotekSettingsTabPreferencesForm::buildForm in src/
Form/ LingotekSettingsTabPreferencesForm.php - Form constructor.
File
- src/
Form/ LingotekSettingsTabPreferencesForm.php, line 203
Class
- LingotekSettingsTabPreferencesForm
- Configure Lingotek
Namespace
Drupal\lingotek\FormCode
protected function retrieveLanguageSwitcher() {
if (\Drupal::moduleHandler()
->moduleExists('block')) {
$theme_default = $this
->config('system.theme')
->get('default');
$this->lang_regions = system_region_list($theme_default, BlockRepositoryInterface::REGIONS_VISIBLE);
$ids = \Drupal::entityQuery('block')
->condition('plugin', 'language_block:language_interface')
->condition('theme', $theme_default)
->execute();
if ($ids) {
// We just take the first language switcher.
$this->lang_switcher = \Drupal::entityTypeManager()
->getStorage('block')
->load(reset($ids));
$this->lang_switcher_value = $this->lang_switcher
->status();
$this->lang_region_selected = $this->lang_switcher
->getRegion();
}
else {
$this->lang_switcher_value = 0;
$this->lang_region_selected = $this->default_region;
}
}
}