mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
lib: Only call Icinga::app()->getRequest() for getting the request outside of a controller
Saves a call to getFrontController(). refs #9660
This commit is contained in:
parent
55ad2dd65f
commit
9060e8a034
@ -111,7 +111,7 @@ class PivotTable
|
|||||||
*/
|
*/
|
||||||
protected function getPaginationParameter($axis, $param, $default = null)
|
protected function getPaginationParameter($axis, $param, $default = null)
|
||||||
{
|
{
|
||||||
$request = Icinga::app()->getFrontController()->getRequest();
|
$request = Icinga::app()->getRequest();
|
||||||
|
|
||||||
$value = $request->getParam($param, '');
|
$value = $request->getParam($param, '');
|
||||||
if (strpos($value, ',') > 0) {
|
if (strpos($value, ',') > 0) {
|
||||||
|
@ -435,7 +435,7 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||||||
|
|
||||||
if ($itemsPerPage === null || $pageNumber === null) {
|
if ($itemsPerPage === null || $pageNumber === null) {
|
||||||
// Detect parameters from request
|
// Detect parameters from request
|
||||||
$request = Icinga::app()->getFrontController()->getRequest();
|
$request = Icinga::app()->getRequest();
|
||||||
if ($itemsPerPage === null) {
|
if ($itemsPerPage === null) {
|
||||||
$itemsPerPage = $request->getParam('limit', 25);
|
$itemsPerPage = $request->getParam('limit', 25);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ namespace Icinga\Test {
|
|||||||
*/
|
*/
|
||||||
public function getRequestMock()
|
public function getRequestMock()
|
||||||
{
|
{
|
||||||
return Icinga::app()->getFrontController()->getRequest();
|
return Icinga::app()->getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1252,7 +1252,7 @@ class Form extends Zend_Form
|
|||||||
public function getRequest()
|
public function getRequest()
|
||||||
{
|
{
|
||||||
if ($this->request === null) {
|
if ($this->request === null) {
|
||||||
$this->request = Icinga::app()->getFrontController()->getRequest();
|
$this->request = Icinga::app()->getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->request;
|
return $this->request;
|
||||||
|
@ -75,6 +75,6 @@ class Button extends FormElement
|
|||||||
*/
|
*/
|
||||||
protected function getRequest()
|
protected function getRequest()
|
||||||
{
|
{
|
||||||
return Icinga::app()->getFrontController()->getRequest();
|
return Icinga::app()->getRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
public function getRequest()
|
public function getRequest()
|
||||||
{
|
{
|
||||||
if ($this->request === null) {
|
if ($this->request === null) {
|
||||||
$this->request = Icinga::app()->getFrontController()->getRequest();
|
$this->request = Icinga::app()->getRequest();
|
||||||
}
|
}
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ class Url
|
|||||||
if ($app->isCli()) {
|
if ($app->isCli()) {
|
||||||
return new FakeRequest();
|
return new FakeRequest();
|
||||||
} else {
|
} else {
|
||||||
return $app->getFrontController()->getRequest();
|
return $app->getRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class SortBox extends AbstractWidget
|
|||||||
{
|
{
|
||||||
if ($this->query !== null) {
|
if ($this->query !== null) {
|
||||||
if ($request === null) {
|
if ($request === null) {
|
||||||
$request = Icinga::app()->getFrontController()->getRequest();
|
$request = Icinga::app()->getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($sort = $request->getParam('sort'))) {
|
if (($sort = $request->getParam('sort'))) {
|
||||||
|
@ -309,7 +309,7 @@ EOT;
|
|||||||
|
|
||||||
private function renderRefreshTab()
|
private function renderRefreshTab()
|
||||||
{
|
{
|
||||||
$url = Icinga::app()->getFrontController()->getRequest()->getUrl();
|
$url = Icinga::app()->getRequest()->getUrl();
|
||||||
$tab = $this->get($this->getActiveName());
|
$tab = $this->get($this->getActiveName());
|
||||||
|
|
||||||
if ($tab !== null) {
|
if ($tab !== null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user