mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-11 20:06:14 -04:00
Add SPDX license headers and mark source files as GPL-3.0-or-later to preserve the option to relicense under later GPL versions.
34 lines
961 B
PHP
34 lines
961 B
PHP
<?php
|
|
|
|
// SPDX-FileCopyrightText: 2019 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
namespace Icinga\Module\Icingadb\Forms;
|
|
|
|
use Icinga\Data\ResourceFactory;
|
|
use Icinga\Forms\ConfigForm;
|
|
|
|
class DatabaseConfigForm extends ConfigForm
|
|
{
|
|
public function init()
|
|
{
|
|
$this->setSubmitLabel(t('Save Changes'));
|
|
}
|
|
|
|
public function createElements(array $formData)
|
|
{
|
|
$dbResources = ResourceFactory::getResourceConfigs('db')->keys();
|
|
|
|
$this->addElement('select', 'icingadb_resource', [
|
|
'description' => t('Database resource'),
|
|
'label' => t('Database'),
|
|
'multiOptions' => array_merge(
|
|
['' => sprintf(' - %s - ', t('Please choose'))],
|
|
array_combine($dbResources, $dbResources)
|
|
),
|
|
'disable' => [''],
|
|
'required' => true,
|
|
'value' => ''
|
|
]);
|
|
}
|
|
}
|