From 4c3be620295e81fdaa31183e44cdb13fab80dbe6 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 31 Jul 2026 03:34:28 +0200 Subject: [PATCH] Fix buttons row support disabled state --- ui-lib.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui-lib.pl b/ui-lib.pl index 7b044216f..d8242105f 100755 --- a/ui-lib.pl +++ b/ui-lib.pl @@ -1835,7 +1835,7 @@ return &theme_ui_buttons_end(@_) if (defined(&theme_ui_buttons_end)); return "\n"; } -=head2 ui_buttons_row(script, button-label, description, [hiddens], [after-submit], [before-submit], [postmethod], [single-cell]) +=head2 ui_buttons_row(script, button-label, description, [hiddens], [after-submit], [before-submit], [postmethod], [single-cell], [disabled]) Returns HTML for a button with a description next to it, and perhaps other inputs. The parameters are : @@ -1856,23 +1856,26 @@ inputs. The parameters are : =item single-cell - If set to 1, omits the description cell and spans the button cell across both columns. +=item disabled - If set to 1, disables the submit button. + =cut sub ui_buttons_row { return &theme_ui_buttons_row(@_) if (defined(&theme_ui_buttons_row)); my ($script, $label, $desc, $hiddens, $after, $before, $postmethod, - $singlecell) = @_; + $singlecell, $disabled) = @_; $postmethod ||= 'post'; if (ref($hiddens)) { $hiddens = join("\n", map { &ui_hidden(@$_) } @$hiddens); } return "
\n". $hiddens. - " ". + " ". "". ($before ? $before." " : ""). - &ui_submit($label).($after ? " ".$after : "")."\n". + &ui_submit($label, '', $disabled). + ($after ? " ".$after : "")."\n". ($singlecell ? "" : "". $desc."\n").