Improve label input block function
This commit is contained in:
parent
9a295cf974
commit
4519bd3d72
|
@ -6747,21 +6747,29 @@ function html_print_label_input_block(
|
||||||
$label_class = '';
|
$label_class = '';
|
||||||
$div_id = '';
|
$div_id = '';
|
||||||
|
|
||||||
|
$divAttributes = [];
|
||||||
|
|
||||||
if (empty($options) === false) {
|
if (empty($options) === false) {
|
||||||
if (isset($options['div_class']) === true) {
|
if (isset($options['div_class']) === true) {
|
||||||
$div_class = $options['div_class'];
|
$divAttributes[] = 'class="'.$options['div_class'].'"';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['div_id']) === true) {
|
||||||
|
$divAttributes[] = 'id="'.$options['div_id'].'"';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['div_style']) === true) {
|
||||||
|
$divAttributes[] = 'style="'.$options['div_style'].'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['label_class']) === true) {
|
if (isset($options['label_class']) === true) {
|
||||||
$label_class = $options['label_class'];
|
$label_class = $options['label_class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['div_id']) === true) {
|
|
||||||
$div_id = 'id="'.$options['div_id'].'"';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '<div class="'.$div_class.'" '.$div_id.'>';
|
$content = (empty($divAttributes) === false) ? implode(' ', $divAttributes) : '';
|
||||||
|
|
||||||
|
$output = '<div '.$content.'>';
|
||||||
if ($label !== null) {
|
if ($label !== null) {
|
||||||
$output .= '<label class="'.$label_class.'">'.$label.'</label>';
|
$output .= '<label class="'.$label_class.'">'.$label.'</label>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue