mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Don't use capture function when we can return the table directly https://sourceforge.net/p/webadmin/bugs/4360/
This commit is contained in:
@@ -873,13 +873,13 @@ return 1;
|
||||
# show_table_form(count)
|
||||
sub show_table_form
|
||||
{
|
||||
print &ui_columns_start([ $text{'field_name'}, $text{'field_type'},
|
||||
my $rv;
|
||||
$rv = &ui_columns_start([ $text{'field_name'}, $text{'field_type'},
|
||||
$text{'field_size'}, $text{'table_nkey'},
|
||||
$text{'field_auto'}, $text{'field_null'},
|
||||
$text{'field_unsigned'}, $text{'field_default'} ]);
|
||||
local $i;
|
||||
for($i=0; $i<$_[0]; $i++) {
|
||||
local @cols;
|
||||
for(my $i=0; $i<$_[0]; $i++) {
|
||||
my @cols;
|
||||
push(@cols, &ui_textbox("field_$i", undef, 20));
|
||||
push(@cols, &ui_select("type_$i", "", [ "", @type_list ]));
|
||||
push(@cols, &ui_textbox("size_$i", undef, 10));
|
||||
@@ -888,9 +888,10 @@ for($i=0; $i<$_[0]; $i++) {
|
||||
push(@cols, &ui_checkbox("null_$i", 1, $text{'yes'}, 1));
|
||||
push(@cols, &ui_checkbox("unsigned_$i", 1, $text{'yes'}, 0));
|
||||
push(@cols, &ui_textbox("default_$i", undef, 20));
|
||||
print &ui_columns_row(\@cols);
|
||||
$rv .= &ui_columns_row(\@cols);
|
||||
}
|
||||
print &ui_columns_end();
|
||||
$rv .= &ui_columns_end();
|
||||
return $rv;
|
||||
}
|
||||
|
||||
# parse_table_form(&extrafields, tablename)
|
||||
|
||||
@@ -39,8 +39,7 @@ print &ui_table_row($text{'newdb_table'},
|
||||
&ui_radio("table_def", 1, [ [ 1, $text{'newdb_none'} ],
|
||||
[ 0, $text{'newdb_tname'} ] ])." ".
|
||||
&ui_textbox("table", undef, 20)." ".$text{'newdb_str'}."...");
|
||||
$out = &capture_function_output(\&show_table_form, 4);
|
||||
print &ui_table_row(undef, $out, 2);
|
||||
print &ui_table_row(undef, &show_table_form(4), 2);
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'create'} ] ]);
|
||||
|
||||
@@ -62,8 +62,7 @@ print &ui_table_row($text{'table_type'},
|
||||
[ "heap" ], [ "merge" ], [ "innodb" ], [ "ndbcluster" ]
|
||||
]));
|
||||
|
||||
$out = &capture_function_output(\&show_table_form, $in{"fields"} || 4);
|
||||
print &ui_table_row(undef, $out, 2);
|
||||
print &ui_table_row(undef, &show_table_form($in{"fields"} || 4), 2);
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "create", $text{'create'} ] ]);
|
||||
|
||||
Reference in New Issue
Block a user