From c3b05f29a520fe7187090081fd8cd3e7d44f7fb5 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 20 Dec 2020 10:43:34 +0100 Subject: [PATCH] Add `ICssClassFormField` --- .../field/ICssClassFormField.class.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/form/builder/field/ICssClassFormField.class.php diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ICssClassFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ICssClassFormField.class.php new file mode 100644 index 0000000000..dd2bf40d33 --- /dev/null +++ b/wcfsetup/install/files/lib/system/form/builder/field/ICssClassFormField.class.php @@ -0,0 +1,48 @@ + + * @package WoltLabSuite\Core\System\Form\Builder\Field + * @since 5.4 + */ +interface ICssClassFormField extends IFormField { + /** + * Adds the given CSS class to the actual field element and returns this field. + * + * @throws \InvalidArgumentException if the given class is invalid + */ + public function addFieldClass(string $class): self; + + /** + * Adds the given CSS classes to the actual field element and returns this field. + * + * @throws \InvalidArgumentException if any of the given classes is invalid + */ + public function addFieldClasses(array $classes): self; + + /** + * Returns all CSS classes of the actual field element. + */ + public function getFieldClasses(): array; + + /** + * Returns `true` if a CSS class of the actual field element with the given name exists and returns `false` otherwise. + * + * @throws \InvalidArgumentException if the given class is invalid + */ + public function hasFieldClass(string $class): bool; + + /** + * Removes the given CSS class of the actual field element and returns this field. + * + * If the actual field element does not have the given CSS class, this method silently ignores that fact. + * + * @throws \InvalidArgumentException if the given class is invalid + */ + public function removeFieldClass(string $class): self; +} -- 2.20.1