Minor change in buttons

This commit is contained in:
Jose Gonzalez 2023-02-16 12:35:02 +01:00
parent 041ce5d5e8
commit d8230dba94
1 changed files with 8 additions and 3 deletions

View File

@ -3449,7 +3449,8 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$output = '';
$classes = '';
$fixedId = '';
$iconStyle = '';
$spanStyle = 'margin-top: 4px;';
if (empty($name) === true) {
$name = 'unnamed';
}
@ -3477,6 +3478,10 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$classes .= ' '.$value;
} else if ($attribute === 'fixed_id') {
$fixedId = $value;
} else if ($attribute === 'icon_style') {
$iconStyle = $value;
} else if ($attribute === 'span_style') {
$spanStyle .= $value;
} else if ($attribute === 'rawAttributes') {
$buttonType = ($attr_array['type'] ?? 'button');
$buttonAttributes = $value;
@ -3492,7 +3497,7 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
if (empty($iconToUse) === false || (isset($buttonMode) === true && $buttonMode !== 'onlyIcon')) {
$iconDiv = html_print_div(
[
'style' => '',
'style' => $iconStyle,
'class' => sprintf(
'subIcon %s %s',
$iconToUse,
@ -3510,7 +3515,7 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$mainId = ((empty($fixedId) === false) ? $fixedId : 'button-'.$name);
if ($imageButton === false) {
$content = '<span id="span-'.$mainId.'" style="margin-top: 4px;" class="font_11">'.$label.'</span>';
$content = '<span id="span-'.$mainId.'" style="'.$spanStyle.'" class="font_11">'.$label.'</span>';
$content .= $iconDiv;
} else {
$content = $iconDiv;