Skip to content

Commit 7e41616

Browse files
committed
Controller::setupPaginationControl: Avoid using dynamic properties Icinga\Web\View as argument
1 parent d6881e0 commit 7e41616

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

application/controllers/ConfigController.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use Exception;
77
use Icinga\Application\Version;
8+
use Icinga\Data\SimpleQuery;
89
use InvalidArgumentException;
910
use Icinga\Application\Config;
1011
use Icinga\Application\Icinga;
@@ -129,13 +130,14 @@ public function modulesAction()
129130
'url' => 'config/modules'
130131
))
131132
->activate('modules');
132-
$this->view->modules = Icinga::app()->getModuleManager()->select()
133+
$modules = Icinga::app()->getModuleManager()->select()
133134
->from('modules')
134135
->order('enabled', 'desc')
135136
->order('installed', 'asc')
136137
->order('name');
137138
$this->setupLimitControl();
138-
$this->setupPaginationControl($this->view->modules);
139+
$this->setupPaginationControl($modules);
140+
$this->view->modules = $modules;
139141
$this->view->title = $this->translate('Modules');
140142
}
141143

application/controllers/ListController.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ public function applicationlogAction()
5050
. 'T[0-9]{2}(?::[0-9]{2}){2}(?:[\+\-][0-9]{2}:[0-9]{2})?)' // time
5151
. ' - (?<loglevel>[A-Za-z]+) - (?<message>.*)(?!.)/msS' // loglevel, message
5252
)));
53-
$this->view->logData = $resource->select()->order('DESC');
53+
$logData = $resource->select()->order('DESC');
5454

5555
$this->setupLimitControl();
56-
$this->setupPaginationControl($this->view->logData);
56+
$this->setupPaginationControl($logData);
57+
$this->view->logData = $logData;
5758
$this->view->title = $this->translate('Application Log');
5859
}
5960
}

application/controllers/RoleController.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function indexAction()
5959
public function listAction()
6060
{
6161
$this->createListTabs()->activate('role/list');
62-
$this->view->roles = (new RolesConfig())
62+
$roles = (new RolesConfig())
6363
->select();
6464

6565
$sortAndFilterColumns = [
@@ -69,10 +69,11 @@ public function listAction()
6969
'permissions' => $this->translate('Permissions')
7070
];
7171

72-
$this->setupFilterControl($this->view->roles, $sortAndFilterColumns, ['name']);
72+
$this->setupFilterControl($roles, $sortAndFilterColumns, ['name']);
7373
$this->setupLimitControl();
74-
$this->setupPaginationControl($this->view->roles);
75-
$this->setupSortControl($sortAndFilterColumns, $this->view->roles, ['name']);
74+
$this->setupPaginationControl($roles);
75+
$this->setupSortControl($sortAndFilterColumns, $roles, ['name']);
76+
$this->view->roles = $roles;
7677
}
7778

7879
/**

modules/monitoring/application/controllers/ShowController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Icinga\Data\Filter\FilterEqual;
77
use Icinga\Module\Monitoring\Backend\MonitoringBackend;
88
use Icinga\Module\Monitoring\Controller;
9+
use Icinga\Module\Monitoring\DataView\DataView;
910
use Icinga\Security\SecurityException;
1011
use Icinga\Web\Url;
1112

@@ -91,7 +92,7 @@ public function contactAction()
9192
$this->applyRestriction('monitoring/filter/objects', $notifications);
9293
$this->view->notifications = $notifications;
9394
$this->setupLimitControl();
94-
$this->setupPaginationControl($this->view->notifications);
95+
$this->setupPaginationControl($notifications);
9596
$this->view->title = $contact->contact_name;
9697
}
9798

modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ public function showAction()
117117
public function historyAction()
118118
{
119119
$this->getTabs()->activate('history');
120-
$this->view->history = $this->object->fetchEventhistory()->eventhistory;
121-
$this->applyRestriction('monitoring/filter/objects', $this->view->history);
120+
$history = $this->object->fetchEventhistory()->eventhistory;
121+
$this->applyRestriction('monitoring/filter/objects', $history);
122122

123123
$this->setupLimitControl(50);
124-
$this->setupPaginationControl($this->view->history, 50);
124+
$this->setupPaginationControl($history, 50);
125+
$this->view->history = $history;
125126
$this->view->object = $this->object;
126127
$this->render('object/detail-history', null, true);
127128
}

0 commit comments

Comments
 (0)