From a5f292c2ae6db964b68c70b6895f7c65eac2e3ee Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 16 Jul 2019 15:57:16 +0200 Subject: [PATCH] Form: Define classes `icinga-forms` and `icinga-controls` by default --- library/Icinga/Web/Form.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 5deacb046..6dc71cc28 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -32,6 +32,11 @@ class Form extends Zend_Form */ const DEFAULT_SUFFIX = '_default'; + /** + * A form's default CSS classes + */ + const DEFAULT_CLASSES = 'icinga-forms icinga-controls'; + /** * Identifier for notifications of type error */ @@ -239,6 +244,10 @@ class Form extends Zend_Form ) )); + if (! isset($options['attribs']['class'])) { + $options['attribs']['class'] = static::DEFAULT_CLASSES; + } + parent::__construct($options); }