diff --git a/modules/monitoring/application/forms/Config/BackendConfigForm.php b/modules/monitoring/application/forms/Config/BackendConfigForm.php
index e0f8e3e0d..3014974a3 100644
--- a/modules/monitoring/application/forms/Config/BackendConfigForm.php
+++ b/modules/monitoring/application/forms/Config/BackendConfigForm.php
@@ -221,7 +221,9 @@ class BackendConfigForm extends ConfigForm
)
);
- $resourceElement = $this->createElement(
+ $decorators = static::$defaultElementDecorators;
+ array_pop($decorators); // Removes the HtmlTag decorator
+ $this->addElement(
'select',
'resource',
array(
@@ -229,32 +231,35 @@ class BackendConfigForm extends ConfigForm
'label' => $this->translate('Resource'),
'description' => $this->translate('The resource to use'),
'multiOptions' => $this->resources[$resourceType],
+ 'value' => current($this->resources[$resourceType]),
+ 'decorators' => $decorators,
'autosubmit' => true
)
);
-
- if (empty($formData)) {
- $options = $resourceElement->options;
- $resourceName = array_shift($options);
- } else {
- $resourceName = (isset($formData['resource'])) ? $formData['resource'] : $this->getValue('resource');
- }
-
- $this->addElement($resourceElement);
-
- if ($resourceElement) {
- $this->addElement(
- 'note',
- 'resource_note',
- array(
- 'value' => sprintf(
- '%s',
- $this->getView()->url('config/editresource', array('resource' => $resourceName)),
- $this->translate('Show resource configuration')
- ),
- 'escape' => false
+ $resourceName = isset($formData['resource']) ? $formData['resource'] : $this->getValue('resource');
+ $this->addElement(
+ 'note',
+ 'resource_note',
+ array(
+ 'escape' => false,
+ 'decorators' => $decorators,
+ 'value' => sprintf(
+ '%3$s',
+ $this->getView()->url('config/editresource', array('resource' => $resourceName)),
+ sprintf($this->translate('Show the configuration of the %s resource'), $resourceName),
+ $this->translate('Show resource configuration')
)
- );
- }
+ )
+ );
+ $this->addDisplayGroup(
+ array('resource', 'resource_note'),
+ 'resource-group',
+ array(
+ 'decorators' => array(
+ 'FormElements',
+ array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
+ )
+ )
+ );
}
}