summaryrefslogtreecommitdiffstats
path: root/application/controllers/DatafieldController.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
commitf66ab8dae2f3d0418759f81a3a64dc9517a62449 (patch)
treefbff2135e7013f196b891bbde54618eb050e4aaf /application/controllers/DatafieldController.php
parentInitial commit. (diff)
downloadicingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.tar.xz
icingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.zip
Adding upstream version 1.10.2.upstream/1.10.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/controllers/DatafieldController.php')
-rw-r--r--application/controllers/DatafieldController.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/application/controllers/DatafieldController.php b/application/controllers/DatafieldController.php
new file mode 100644
index 0000000..afad317
--- /dev/null
+++ b/application/controllers/DatafieldController.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Icinga\Module\Director\Controllers;
+
+use Icinga\Module\Director\Forms\DirectorDatafieldForm;
+use Icinga\Module\Director\Web\Controller\ActionController;
+
+class DatafieldController extends ActionController
+{
+ public function addAction()
+ {
+ $this->indexAction();
+ }
+
+ public function editAction()
+ {
+ $this->indexAction();
+ }
+
+ public function indexAction()
+ {
+ $form = DirectorDatafieldForm::load()
+ ->setDb($this->db());
+
+ if ($id = $this->params->get('id')) {
+ $form->loadObject((int) $id);
+ $this->addTitle(
+ $this->translate('Modify %s'),
+ $form->getObject()->varname
+ );
+ $this->addSingleTab($this->translate('Edit a Field'));
+ } else {
+ $this->addTitle($this->translate('Add a new Data Field'));
+ $this->addSingleTab($this->translate('New Field'));
+ }
+
+ $form->handleRequest();
+ $this->content()->add($form);
+ }
+}