mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
DashboardsController: Use $this->getServerRequest()
where applicable
This commit is contained in:
parent
7b90d0935a
commit
e588596d9e
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
namespace Icinga\Controllers;
|
namespace Icinga\Controllers;
|
||||||
|
|
||||||
use GuzzleHttp\Psr7\ServerRequest;
|
|
||||||
use Icinga\Forms\Dashboard\DashletForm;
|
use Icinga\Forms\Dashboard\DashletForm;
|
||||||
use Icinga\Forms\Dashboard\HomePaneForm;
|
use Icinga\Forms\Dashboard\HomePaneForm;
|
||||||
use Icinga\Forms\Dashboard\NewHomePaneForm;
|
use Icinga\Forms\Dashboard\NewHomePaneForm;
|
||||||
@ -51,7 +50,7 @@ class DashboardsController extends CompatController
|
|||||||
$welcomeForm = new WelcomeForm($this->dashboard);
|
$welcomeForm = new WelcomeForm($this->dashboard);
|
||||||
$welcomeForm->on(WelcomeForm::ON_SUCCESS, function () use ($welcomeForm) {
|
$welcomeForm->on(WelcomeForm::ON_SUCCESS, function () use ($welcomeForm) {
|
||||||
$this->redirectNow($welcomeForm->getRedirectUrl());
|
$this->redirectNow($welcomeForm->getRedirectUrl());
|
||||||
})->handleRequest(ServerRequest::fromGlobals());
|
})->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->content->getAttributes()->add('class', 'welcome-view');
|
$this->content->getAttributes()->add('class', 'welcome-view');
|
||||||
$this->dashboard->setWelcomeForm($welcomeForm);
|
$this->dashboard->setWelcomeForm($welcomeForm);
|
||||||
@ -105,7 +104,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(NewHomePaneForm::ON_SUCCESS, function () {
|
->on(NewHomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($paneForm);
|
$this->addContent($paneForm);
|
||||||
}
|
}
|
||||||
@ -128,7 +127,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(HomePaneForm::ON_SUCCESS, function () {
|
->on(HomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$homeForm->load($this->dashboard->getActiveHome());
|
$homeForm->load($this->dashboard->getActiveHome());
|
||||||
$this->addContent($homeForm);
|
$this->addContent($homeForm);
|
||||||
@ -152,7 +151,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(RemoveHomePaneForm::ON_SUCCESS, function () {
|
->on(RemoveHomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($homeForm);
|
$this->addContent($homeForm);
|
||||||
}
|
}
|
||||||
@ -175,7 +174,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(NewHomePaneForm::ON_SUCCESS, function () {
|
->on(NewHomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($paneForm);
|
$this->addContent($paneForm);
|
||||||
}
|
}
|
||||||
@ -204,7 +203,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(HomePaneForm::ON_SUCCESS, function () {
|
->on(HomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$paneForm->load($this->dashboard->getActiveHome()->getEntry($pane));
|
$paneForm->load($this->dashboard->getActiveHome()->getEntry($pane));
|
||||||
|
|
||||||
@ -235,7 +234,7 @@ class DashboardsController extends CompatController
|
|||||||
$paneForm->populate(['org_name' => $paneParam]);
|
$paneForm->populate(['org_name' => $paneParam]);
|
||||||
$paneForm->on(RemoveHomePaneForm::ON_SUCCESS, function () {
|
$paneForm->on(RemoveHomePaneForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})->handleRequest(ServerRequest::fromGlobals());
|
})->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($paneForm);
|
$this->addContent($paneForm);
|
||||||
}
|
}
|
||||||
@ -254,7 +253,7 @@ class DashboardsController extends CompatController
|
|||||||
$dashletForm->populate($this->getRequest()->getPost());
|
$dashletForm->populate($this->getRequest()->getPost());
|
||||||
$dashletForm->on(DashletForm::ON_SUCCESS, function () {
|
$dashletForm->on(DashletForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})->handleRequest(ServerRequest::fromGlobals());
|
})->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($dashletForm);
|
$this->addContent($dashletForm);
|
||||||
}
|
}
|
||||||
@ -271,7 +270,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(DashletForm::ON_SUCCESS, function () {
|
->on(DashletForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$dashletForm->getElement('submit')->setLabel(t('Update Dashlet'));
|
$dashletForm->getElement('submit')->setLabel(t('Update Dashlet'));
|
||||||
|
|
||||||
@ -290,7 +289,7 @@ class DashboardsController extends CompatController
|
|||||||
->on(RemoveDashletForm::ON_SUCCESS, function () {
|
->on(RemoveDashletForm::ON_SUCCESS, function () {
|
||||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||||
})
|
})
|
||||||
->handleRequest(ServerRequest::fromGlobals());
|
->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($removeForm);
|
$this->addContent($removeForm);
|
||||||
}
|
}
|
||||||
@ -439,7 +438,7 @@ class DashboardsController extends CompatController
|
|||||||
$setupForm = new SetupNewDashboardForm($this->dashboard);
|
$setupForm = new SetupNewDashboardForm($this->dashboard);
|
||||||
$setupForm->on(SetupNewDashboardForm::ON_SUCCESS, function () use ($setupForm) {
|
$setupForm->on(SetupNewDashboardForm::ON_SUCCESS, function () use ($setupForm) {
|
||||||
$this->redirectNow($setupForm->getRedirectUrl());
|
$this->redirectNow($setupForm->getRedirectUrl());
|
||||||
})->handleRequest(ServerRequest::fromGlobals());
|
})->handleRequest($this->getServerRequest());
|
||||||
|
|
||||||
$this->addContent($setupForm);
|
$this->addContent($setupForm);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user