From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- application/forms/SetAsBackendForm.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 application/forms/SetAsBackendForm.php (limited to 'application/forms/SetAsBackendForm.php') diff --git a/application/forms/SetAsBackendForm.php b/application/forms/SetAsBackendForm.php new file mode 100644 index 0000000..2840633 --- /dev/null +++ b/application/forms/SetAsBackendForm.php @@ -0,0 +1,34 @@ + 'setAsBackendForm', + 'class' => 'icinga-controls' + ]; + + protected function assemble() + { + $this->addElement('checkbox', 'backend', [ + 'class' => 'autosubmit', + 'label' => t('Use Icinga DB As Backend'), + 'value' => IcingadbSupportHook::isIcingaDbSetAsPreferredBackend() + ]); + } + + public function onSuccess() + { + Session::getSession()->getNamespace('icingadb')->set( + IcingadbSupportHook::PREFERENCE_NAME, + $this->getElement('backend')->isChecked() + ); + } +} -- cgit v1.2.3