Use setTitle() instead of setting resp headrs directly

This commit is contained in:
Yonas Habteab 2022-04-12 15:29:23 +02:00
parent a79e83cc24
commit f3dc6301ff

View File

@ -211,8 +211,6 @@ class DashboardsController extends CompatController
$paneForm = new RemoveHomePaneForm($this->dashboard); $paneForm = new RemoveHomePaneForm($this->dashboard);
$paneForm->populate(['org_name' => $paneParam]); $paneForm->populate(['org_name' => $paneParam]);
$paneForm->on(RemoveHomePaneForm::ON_SUCCESS, function () { $paneForm->on(RemoveHomePaneForm::ON_SUCCESS, function () {
$this->getResponse()->setAutoRefreshInterval(1);
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings')); $this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
})->handleRequest(ServerRequest::fromGlobals()); })->handleRequest(ServerRequest::fromGlobals());
@ -385,7 +383,7 @@ class DashboardsController extends CompatController
// rendered in the modal view when redirecting // rendered in the modal view when redirecting
$this->view->compact = true; $this->view->compact = true;
$this->getResponse()->setHeader('X-Icinga-Title', t('Configure Dashlets'), true); $this->setTitle(t('Configure Dashlets'));
} else { } else {
$this->setTitle(t('Add Dashlet')); $this->setTitle(t('Add Dashlet'));
} }