From 380ffe45b9ce861fbe744eafc217dbe285c10135 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 29 Sep 2014 11:20:39 +0200 Subject: [PATCH] Add some redundancy to get more implicitness Although this commit does not seem reasonable at first the "big" picture proves its necessity! refs #7163 --- application/forms/Config/Resource/DbResourceForm.php | 9 +++++++++ application/forms/Config/Resource/FileResourceForm.php | 9 +++++++++ application/forms/Config/Resource/LdapResourceForm.php | 9 +++++++++ .../forms/Config/Resource/LivestatusResourceForm.php | 9 +++++++++ .../forms/Config/Resource/StatusdatResourceForm.php | 9 +++++++++ application/forms/Config/ResourceConfigForm.php | 9 --------- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/application/forms/Config/Resource/DbResourceForm.php b/application/forms/Config/Resource/DbResourceForm.php index 686013386..540a69813 100644 --- a/application/forms/Config/Resource/DbResourceForm.php +++ b/application/forms/Config/Resource/DbResourceForm.php @@ -29,6 +29,15 @@ class DbResourceForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'text', + 'name', + array( + 'required' => true, + 'label' => t('Resource Name'), + 'description' => t('The unique name of this resource') + ) + ); $this->addElement( 'select', 'db', diff --git a/application/forms/Config/Resource/FileResourceForm.php b/application/forms/Config/Resource/FileResourceForm.php index d1d33a749..2814e9a72 100644 --- a/application/forms/Config/Resource/FileResourceForm.php +++ b/application/forms/Config/Resource/FileResourceForm.php @@ -25,6 +25,15 @@ class FileResourceForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'text', + 'name', + array( + 'required' => true, + 'label' => t('Resource Name'), + 'description' => t('The unique name of this resource') + ) + ); $this->addElement( 'text', 'filename', diff --git a/application/forms/Config/Resource/LdapResourceForm.php b/application/forms/Config/Resource/LdapResourceForm.php index 6dacc6bea..5f46f64b2 100644 --- a/application/forms/Config/Resource/LdapResourceForm.php +++ b/application/forms/Config/Resource/LdapResourceForm.php @@ -29,6 +29,15 @@ class LdapResourceForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'text', + 'name', + array( + 'required' => true, + 'label' => t('Resource Name'), + 'description' => t('The unique name of this resource') + ) + ); $this->addElement( 'text', 'hostname', diff --git a/application/forms/Config/Resource/LivestatusResourceForm.php b/application/forms/Config/Resource/LivestatusResourceForm.php index 3314ca284..cfbd38c98 100644 --- a/application/forms/Config/Resource/LivestatusResourceForm.php +++ b/application/forms/Config/Resource/LivestatusResourceForm.php @@ -29,6 +29,15 @@ class LivestatusResourceForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'text', + 'name', + array( + 'required' => true, + 'label' => t('Resource Name'), + 'description' => t('The unique name of this resource') + ) + ); $this->addElement( 'text', 'socket', diff --git a/application/forms/Config/Resource/StatusdatResourceForm.php b/application/forms/Config/Resource/StatusdatResourceForm.php index f150056d1..d440f139d 100644 --- a/application/forms/Config/Resource/StatusdatResourceForm.php +++ b/application/forms/Config/Resource/StatusdatResourceForm.php @@ -26,6 +26,15 @@ class StatusdatResourceForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'text', + 'name', + array( + 'required' => true, + 'label' => t('Resource Name'), + 'description' => t('The unique name of this resource') + ) + ); $this->addElement( 'text', 'status_file', diff --git a/application/forms/Config/ResourceConfigForm.php b/application/forms/Config/ResourceConfigForm.php index 51677b12f..cef9310be 100644 --- a/application/forms/Config/ResourceConfigForm.php +++ b/application/forms/Config/ResourceConfigForm.php @@ -224,15 +224,6 @@ class ResourceConfigForm extends ConfigForm $resourceTypes['db'] = t('SQL Database'); } - $this->addElement( - 'text', - 'name', - array( - 'required' => true, - 'label' => t('Resource Name'), - 'description' => t('The unique name of this resource') - ) - ); $this->addElement( 'select', 'type',