chop($cmd{'host'} = <FILE>);
chop($cmd{'sql'} = <FILE>);
$cmd{'sql'} =~ s/\t/\n/g;
+ chop($cmd{'order'} = <FILE>);
}
if (%cmd) {
# Read common stuff
local $sql = $c->{'sql'};
$sql =~ s/\n/\t/g;
&print_tempfile(FILE, $sql,"\n");
+ &print_tempfile(FILE, $c->{'order'},"\n");
}
else {
# Save a custom command
&ui_textbox("desc", $cmd->{'desc'}, 50)."<br>\n".
&ui_textarea("html", $cmd->{'html'}, 2, 50));
+# Command ordering on main page
+print &ui_table_row(&hlink($text{'edit_order'},"order"),
+ &ui_opt_textbox("order", $cmd->{'order'} || "", 6, $text{'default'}));
+
# Show databse type and name
print &ui_table_row($text{'sql_type'},
&ui_select("type", $cmd->{'type'},
# parse and validate inputs
$cmd->{'desc'} = $in{'desc'};
+ $in{'order_def'} || $in{'order'} =~ /^\-?(\d+)$/ ||
+ &error($text{'save_eorder'});
+ $cmd->{'order'} = $in{'order_def'} ? 0 : int($in{'order'});
$in{'html'} =~ s/\r//g;
$in{'html'} =~ s/\n*/\n/;
$cmd->{'html'} = $in{'html'};