File: ConfigController.php

package info (click to toggle)
icingaweb2-module-audit 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: php: 270; sh: 54; makefile: 15
file content (35 lines) | stat: -rw-r--r-- 892 bytes parent folder | download
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
<?php

/* Icinga Web 2 | (c) 2018 Icinga Development Team | GPLv2+ */

namespace Icinga\Module\Audit\Controllers;

use Icinga\Web\Controller;
use Icinga\Module\Audit\Forms\Config\AuditLogConfigForm;
use ipl\Html\HtmlString;
use ipl\Web\Compat\CompatController;

class ConfigController extends CompatController
{
    public function init()
    {
        $this->assertPermission('config/modules');

        foreach ($this->Module()->getConfigTabs()->getTabs() as $tab) {
            $this->tabs->add($tab->getName(), $tab);
        }
    }

    public function indexAction(): void
    {
        $this->getTabs()->activate('config');

        $form = new AuditLogConfigForm();
        $form->setIniConfig($this->Config());
        $form->setSubmitLabel($this->translate('Save Configuration'));

        $form->handleRequest();

        $this->addContent(new HtmlString((string) $form));
    }
}