Added a history of previous commands to the Execute SQL page.
---- Changes since 1.510 ----
Added greater than / less than selectors to the table data search form.
+---- Changes since 1.530 ----
+Added an option to the restore form to limit the restore to only certain tables.
# Show input to select tables
$t = $c{'backup_tables_'.$in{'db'}};
@tables = &list_tables($in{'db'});
- print &ui_table_row($text{'backup_tables'},
- &ui_radio("tables_def", $t ? 0 : 1,
- [ [ 1, $text{'backup_alltables'} ],
- [ 0, $text{'backup_seltables'} ] ])."<br>".
- &ui_select("tables", [ split(/\s+/, $t) ],
- [ sort @tables ], 5, 1));
+ if (@tables) {
+ print &ui_table_row($text{'backup_tables'},
+ &ui_radio("tables_def", $t ? 0 : 1,
+ [ [ 1, $text{'backup_alltables'} ],
+ [ 0, $text{'backup_seltables'} ] ])."<br>".
+ &ui_select("tables", [ split(/\s+/, $t) ],
+ [ sort @tables ], 5, 1));
+ }
+ else {
+ print &ui_hidden("tables_def", 1);
+ }
}
print &ui_hidden_table_end("main");
restore_ecannot=You are not allowed to restore backups
restore_only=Only restore data, not tables?
restore_clean=Delete tables before restoring?
+restore_tables=Tables to restore
+restore_tables1=All in backup file
+restore_tables0=Listed tables
restore_failed=Restore failed : $1
backup_title=Backup Database
&close_tempfile(DATA);
}
-$db_find_f = 0 ;
-
-if ( $in{'db'} ) {
-
- foreach ( &list_databases() ) {
-
- if ( $_ eq $in{'db'} ) { $db_find_f = 1 ; }
- }
-}
+# Validate tables list
+if ($in{'tables_def'}) {
+ $tables = undef;
+ }
+else {
+ $in{'tables'} =~ /\S/ || &error($text{'restore_etables'});
+ $tables = [ split(/\s+/, $in{'tables'}) ];
+ }
-if ( $db_find_f == 0 ) { &error ( &text ( 'restore_edb' ) ) ; }
+# Validate database
+&indexof($in{'db'}, &list_databases()) >= 0 ||
+ &error(&text('restore_edb'));
-$err = &restore_database($in{'db'}, $path, $in{'only'}, $in{'clean'});
+$err = &restore_database($in{'db'}, $path, $in{'only'}, $in{'clean'}, $tables);
if ($err) {
&error(&text('restore_failed', "<pre>$err</pre>"));
}
print &ui_table_row($text{'restore_clean'},
&ui_yesno_radio("clean", 0));
+print &ui_table_row($text{'restore_tables'},
+ &ui_opt_textbox("tables", undef, 60,
+ $text{'restore_tables1'}."<br>",
+ $text{'restore_tables0'}));
+
print &ui_table_end();
print &ui_form_end([ [ "go", $text{'restore_go'} ] ]);