PreferenceForm: Reload the entire layout if the locale changes

This commit is contained in:
Johannes Meyer 2021-04-15 16:09:52 +02:00
parent a87f15c861
commit 9d6bef0a39
1 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,7 @@ class PreferenceForm extends Form
$this->preferences = new Preferences($this->store ? $this->store->load() : array());
$oldTheme = $this->preferences->getValue('icingaweb', 'theme');
$oldLocale = $this->preferences->getValue('icingaweb', 'language');
$webPreferences = $this->preferences->get('icingaweb', array());
foreach ($this->getValues() as $key => $value) {
@ -118,6 +119,12 @@ class PreferenceForm extends Form
$this->getResponse()->setReloadCss(true);
}
if (($locale = $this->getElement('language')) !== null
&& $locale->getValue() !== $oldLocale
) {
$this->getResponse()->setHeader('X-Icinga-Redirect-Http', 'yes');
}
try {
if ($this->store && $this->getElement('btn_submit')->isChecked()) {
$this->save();