';
foreach ($contentList as $item) {
$html .= '
'.$item.'
';
}
diff --git a/public/main/inc/lib/formvalidator/Element/DatePicker.php b/public/main/inc/lib/formvalidator/Element/DatePicker.php
index 61cd0f9ac4..77b1188aba 100644
--- a/public/main/inc/lib/formvalidator/Element/DatePicker.php
+++ b/public/main/inc/lib/formvalidator/Element/DatePicker.php
@@ -72,58 +72,6 @@ class DatePicker extends HTML_QuickForm_text
);
}
- /**
- * @param string $layout
- *
- * @return string
- */
- public function getTemplate($layout)
- {
- $size = $this->calculateSize();
-
- switch ($layout) {
- case FormValidator::LAYOUT_INLINE:
- return '
-
-
-
- {element}
-
';
- break;
- case FormValidator::LAYOUT_HORIZONTAL:
- return '
-
';
- break;
- case FormValidator::LAYOUT_BOX_NO_LABEL:
- return '{element}';
- break;
- }
- }
-
/**
* Get the necessary javascript for this datepicker.
*
diff --git a/public/main/inc/lib/formvalidator/Element/DateTimePicker.php b/public/main/inc/lib/formvalidator/Element/DateTimePicker.php
index 6e31e0a0c2..2d34c99d90 100644
--- a/public/main/inc/lib/formvalidator/Element/DateTimePicker.php
+++ b/public/main/inc/lib/formvalidator/Element/DateTimePicker.php
@@ -1,4 +1,5 @@
updateAttributes(['value' => $value]);
}
- /**
- * @param string $layout
- *
- * @return string
- */
- public function getTemplate($layout)
- {
- $size = $this->calculateSize();
-
- switch ($layout) {
- case FormValidator::LAYOUT_INLINE:
- return '
-
-
-
- {element}
-
';
- break;
- case FormValidator::LAYOUT_HORIZONTAL:
- return '
-
';
- break;
- case FormValidator::LAYOUT_BOX_NO_LABEL:
- return '{element}';
- break;
- }
- }
-
/**
* Get the necessary javascript for this datepicker.
*
diff --git a/public/main/inc/lib/formvalidator/FormValidator.class.php b/public/main/inc/lib/formvalidator/FormValidator.class.php
index d37ca53723..92995aa76c 100644
--- a/public/main/inc/lib/formvalidator/FormValidator.class.php
+++ b/public/main/inc/lib/formvalidator/FormValidator.class.php
@@ -38,7 +38,7 @@ class FormValidator extends HTML_QuickForm
) {
// Default form class.
if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) {
- $attributes['class'] = 'form-horizontal';
+ $attributes['class'] = 'form-horizontal q-pt-md';
}
if (isset($attributes['class']) && false !== strpos($attributes['class'], 'form-search')) {
@@ -52,13 +52,18 @@ class FormValidator extends HTML_QuickForm
switch ($layout) {
case self::LAYOUT_HORIZONTAL:
- $attributes['class'] = 'form-horizontal';
+ $attributes['class'] = 'w-full ';
+ break;
+ case self::LAYOUT_BOX_SEARCH:
+ $attributes['class'] = 'w-full flex gap-2';
+ $formTemplate = $this->getInLineTemplate();
break;
case self::LAYOUT_INLINE:
- $attributes['class'] = 'form-inline';
+ $attributes['class'] = ' flex gap-1 ';
+ $formTemplate = $this->getInLineTemplate();
break;
case self::LAYOUT_BOX:
- $attributes['class'] = 'form-inline-box';
+ $attributes['class'] = 'flex gap-1 ';
break;
case self::LAYOUT_GRID:
$attributes['class'] = 'form-grid';
@@ -70,11 +75,12 @@ class FormValidator extends HTML_QuickForm
// Modify the default templates
$renderer = &$this->defaultRenderer();
-
$renderer->setFormTemplate($formTemplate);
// Element template
- if (isset($attributes['class']) && 'form-inline' === $attributes['class']) {
+ if ((isset($attributes['class']) && 'form-inline' === $attributes['class']) ||
+ (self::LAYOUT_INLINE === $layout || self::LAYOUT_BOX_SEARCH === $layout)
+ ) {
$elementTemplate = ' {label} {element} ';
$renderer->setElementTemplate($elementTemplate);
} elseif (isset($attributes['class']) && 'form-search' === $attributes['class']) {
@@ -97,12 +103,14 @@ class FormValidator extends HTML_QuickForm
}
//Set Header template
- $renderer->setHeaderTemplate('
');
+ $renderer->setHeaderTemplate('
{header}
');
- //Set required field template
- $this->setRequiredNote(
- '
* '.get_lang('Required field').''
- );
+ $required = '
* '.get_lang('Required field').'';
+ if ((self::LAYOUT_INLINE === $layout || self::LAYOUT_BOX_SEARCH === $layout)) {
+ $required = '';
+ }
+ // Set required field template
+ $this->setRequiredNote($required);
$noteTemplate = <<
@@ -112,23 +120,29 @@ EOT;
$renderer->setRequiredNoteTemplate($noteTemplate);
}
- /**
- * @return string
- */
- public function getFormTemplate()
+ public function getFormTemplate(): string
+ {
+ return '
+
+ ';
+ }
+
+ public function getInLineTemplate(): string
{
return '';
}
- /**
- * @return string
- */
- public function getGridFormTemplate()
+ public function getGridFormTemplate(): string
{
return '