Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/controllers/CControllerTemplateDashboardEdit.php')
-rw-r--r--ui/app/controllers/CControllerTemplateDashboardEdit.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/app/controllers/CControllerTemplateDashboardEdit.php b/ui/app/controllers/CControllerTemplateDashboardEdit.php
index b500e89857e..bc32eb03d6e 100644
--- a/ui/app/controllers/CControllerTemplateDashboardEdit.php
+++ b/ui/app/controllers/CControllerTemplateDashboardEdit.php
@@ -21,13 +21,13 @@
class CControllerTemplateDashboardEdit extends CController {
- private $dashboard;
+ private array $dashboard;
- protected function init() {
+ protected function init(): void {
$this->disableSIDValidation();
}
- protected function checkInput() {
+ protected function checkInput(): bool {
$fields = [
'templateid' => 'db dashboard.templateid',
'dashboardid' => 'db dashboard.dashboardid'
@@ -44,7 +44,7 @@ class CControllerTemplateDashboardEdit extends CController {
return $ret;
}
- protected function checkPermissions() {
+ protected function checkPermissions(): bool {
if ($this->getUserType() < USER_TYPE_ZABBIX_ADMIN) {
return false;
}
@@ -61,12 +61,11 @@ class CControllerTemplateDashboardEdit extends CController {
return (bool) $this->dashboard;
}
- else {
- return isWritableHostTemplates((array) $this->getInput('templateid'));
- }
+
+ return isWritableHostTemplates((array) $this->getInput('templateid'));
}
- protected function doAction() {
+ protected function doAction(): void {
if ($this->hasInput('dashboardid')) {
$dashboard = $this->dashboard;
$dashboard['pages'] = CDashboardHelper::preparePagesForGrid($dashboard['pages'], $dashboard['templateid'],
@@ -93,7 +92,8 @@ class CControllerTemplateDashboardEdit extends CController {
$data = [
'dashboard' => $dashboard,
- 'widget_defaults' => CWidgetConfig::getDefaults(CWidgetConfig::CONTEXT_TEMPLATE_DASHBOARD),
+ 'widget_defaults' => APP::ModuleManager()->getWidgetsDefaults(true),
+ 'widget_last_type' => CDashboardHelper::getWidgetLastType(true),
'time_period' => getTimeSelectorPeriod([]),
'page' => CPagerHelper::loadPage('template.dashboard.list', null)
];