\n";
if ($in{'all'}) {
print " | $text{'backup_file2'} | \n";
}
else {
print " | $text{'backup_file'} | \n";
}
printf " %s | \n",
$c{'backup_'.$in{'db'}}, &file_chooser_button("file");
if (!$in{'all'}) {
# Show input to select tables
$t = $c{'backup_tables_'.$in{'db'}};
print " | $text{'backup_tables'} | \n";
printf " %s\n",
$t ? "" : "checked", $text{'backup_alltables'};
printf " %s \n",
$t ? "checked" : "", $text{'backup_seltables'};
@tables = &list_tables($in{'db'});
%got = map { $_, 1 } split(/\s+/, $t);
print " | \n";
}
# Show input for where clause
$w = $c{'backup_where_'.$in{'db'}};
print " | $text{'backup_where'} | \n";
print "",&ui_opt_textbox("where", $w, 30, $text{'backup_none'}),
" | \n";
# Show option to include drop statements in SQL
$d = $c{'backup_drop_'.$in{'db'}};
print " | $text{'backup_drop'} | \n";
print "",&ui_yesno_radio("drop", $d ? 1 : 0)," | \n";
# Show input for character set
$s = $c{'backup_charset_'.$in{'db'}};
print " | $text{'backup_charset'} | \n";
print "",&ui_radio("charset_def", $s ? 0 : 1,
[ [ 1, $text{'default'} ],
[ 0, &ui_select("charset", $s,
[ &list_character_sets($in{'db'}) ]) ] ]),
" | \n";
if ($mysql_version >= 5.0) {
# Show compatability format option
$cf = $c{'backup_compatible_'.$in{'db'}};
print " | $text{'backup_compatible'} | \n";
print "",&ui_radio("compatible_def", $cf ? 0 : 1,
[ [ 1, $text{'default'} ],
[ 0, &text('backup_compwith',
&ui_select("compatible", $cf,
[ &list_compatible_formats() ])) ] ]),
" | \n";
%co = map { $_, 1 } split(/\s+/, $c{'backup_options_'.$in{'db'}});
print " | $text{'backup_options'} | \n";
foreach $o (&list_compatible_options()) {
print &ui_checkbox("options", $o->[0], $o->[1] || $o->[0],
$co{$o->[0]})," \n";
}
print " | \n";
}
else {
print &ui_hidden("compatible_def", 1),"\n";
}
# Show compression option
$cp = int($c{'backup_compress_'.$in{'db'}});
print " | $text{'backup_compress'} | \n";
print "",&ui_radio("compress", $cp,
[ [ 0, $text{'backup_cnone'} ],
[ 1, $text{'backup_gzip'} ],
[ 2, $text{'backup_bzip2'} ] ])," | \n";
if ($cron) {
# Show before/after commands
$b = $c{'backup_before_'.$in{'db'}};
print " | $text{'backup_before'} | \n";
printf " | \n", $b;
$a = $c{'backup_after_'.$in{'db'}};
print " | $text{'backup_after'} | \n";
printf " | \n", $a;
if ($in{'all'}) {
# Command mode option
$cmode = $c{'backup_cmode_'.$in{'db'}};
print " | $text{'backup_cmode'} | \n";
print "",&ui_radio("cmode", int($cmode),
[ [ 0, $text{'backup_cmode0'} ],
[ 1, $text{'backup_cmode1'} ] ])," | \n";
}
# Show cron time
&foreign_require("cron", "cron-lib.pl");
@jobs = &cron::list_cron_jobs();
$cmd = $in{'all'} ? "$cron_cmd --all" : "$cron_cmd $in{'db'}";
($job) = grep { $_->{'command'} eq $cmd } @jobs;
print " | $text{'backup_sched'} | \n";
printf " %s\n",
$job ? "" : "checked", $text{'no'};
printf " %s | \n",
$job ? "checked" : "", $text{'backup_sched1'};
print " \n";
$job ||= { 'mins' => 0,
'hours' => 0,
'days' => '*',
'months' => '*',
'weekdays' => '*' };
&cron::show_times_input($job);
print " | \n";
}
print " |