File: ConfigController.php

package info (click to toggle)
icingaweb2-module-eventdb 1.3.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,040 kB
  • sloc: php: 2,044; sh: 105; javascript: 85; xml: 18; makefile: 16
file content (45 lines) | stat: -rw-r--r-- 1,350 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */

namespace Icinga\Module\Eventdb\Controllers;

use Icinga\Module\Eventdb\Forms\Config\BackendConfigForm;
use Icinga\Module\Eventdb\Forms\Config\GlobalConfigForm;
use Icinga\Module\Eventdb\Forms\Config\MonitoringConfigForm;
use Icinga\Web\Controller;

class ConfigController extends Controller
{
    public function init()
    {
        $this->assertPermission('config/modules');
        parent::init();
    }

    public function indexAction()
    {
        $backendConfig = new BackendConfigForm();
        $backendConfig
            ->setIniConfig($this->Config())
            ->handleRequest();
        $this->view->backendConfig = $backendConfig;

        $globalConfig = new GlobalConfigForm();
        $globalConfig
            ->setIniConfig($this->Config())
            ->handleRequest();
        $this->view->globalConfig = $globalConfig;

        $this->view->tabs = $this->Module()->getConfigTabs()->activate('config');
    }

    public function monitoringAction()
    {
        $monitoringConfig = new MonitoringConfigForm();
        $monitoringConfig
            ->setIniConfig($this->Config())
            ->handleRequest();
        $this->view->form = $monitoringConfig;
        $this->view->tabs = $this->Module()->getConfigTabs()->activate('monitoring');
    }
}