support respoinsiveRow in multi-field

This commit is contained in:
Roland Gruber 2019-08-17 10:52:26 +02:00
parent 368a3988dc
commit 46cfdb821c
1 changed files with 22 additions and 4 deletions

View File

@ -1363,7 +1363,7 @@ abstract class baseModule {
* There must be a help entry with the attribute name as ID. * There must be a help entry with the attribute name as ID.
* A new line will also be added after this entry so multiple calls will show the fields one below the other. * A new line will also be added after this entry so multiple calls will show the fields one below the other.
* *
* @param htmlTable $container parent container * @param htmlTable|htmlResponsiveRow $container parent container
* @param String $attrName attribute name * @param String $attrName attribute name
* @param String $label label name * @param String $label label name
* @param boolean $required this is a required field (default false) * @param boolean $required this is a required field (default false)
@ -1388,8 +1388,13 @@ abstract class baseModule {
if ($label !== null) { if ($label !== null) {
$labelTextOut = new htmlOutputText($label, true, $required); $labelTextOut = new htmlOutputText($label, true, $required);
$labelTextOut->alignment = htmlElement::ALIGN_TOP; $labelTextOut->alignment = htmlElement::ALIGN_TOP;
if ($container instanceof htmlTable) {
$container->addElement($labelTextOut); $container->addElement($labelTextOut);
} }
else {
$container->addLabel($labelTextOut);
}
}
$subContainer = new htmlTable(); $subContainer = new htmlTable();
$subContainer->alignment = htmlElement::ALIGN_TOP; $subContainer->alignment = htmlElement::ALIGN_TOP;
for ($i = 0; $i < sizeof($values); $i++) { for ($i = 0; $i < sizeof($values); $i++) {
@ -1431,11 +1436,24 @@ abstract class baseModule {
} }
$subContainer->addNewLine(); $subContainer->addNewLine();
} }
$container->addElement($subContainer);
$help = new htmlHelpLink($attrName); $help = new htmlHelpLink($attrName);
$help->alignment = htmlElement::ALIGN_TOP; $help->alignment = htmlElement::ALIGN_TOP;
if ($container instanceof htmlTable) {
$container->addElement($subContainer);
$container->addElement($help, true); $container->addElement($help, true);
} }
else {
$subContainerWithHelp = new htmlTable();
$subContainerWithHelp->addElement($subContainer);
$subContainerWithHelp->addElement($help, true);
if ($label !== null) {
$container->addField($subContainerWithHelp);
}
else {
$container->add($subContainerWithHelp, 12);
}
}
}
/** /**
* Validates a multi-value text field. * Validates a multi-value text field.