From: pcanterino <> Date: Mon, 22 Dec 2003 13:34:15 +0000 (+0000) Subject: Now, when the user wants to remove a file, a confirmation dialog will be displayed X-Git-Tag: version_1_2~1 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/a1cc5ce8035db2ac85e3a4ae675c504ff595d3b6 Now, when the user wants to remove a file, a confirmation dialog will be displayed --- diff --git a/modules/Command.pm b/modules/Command.pm index 6b413d0..ceee24d 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2003-12-21 +# Last modified: 2003-12-22 # use strict; @@ -566,7 +566,7 @@ sub exec_workwithdir($$)
-

Move/Rename directory '$virtual' to:
$dir

+

Move/Rename directory '$virtual' to:
$dir


@@ -741,8 +741,46 @@ sub exec_remove($$) return exec_rmdir($data,$config) if(-d $physical); return error_in_use($virtual) if($data->{'uselist'}->in_use($virtual)); - unlink($physical) or return error("Could not delete file '".encode_entities($virtual)."'.",upper_path($virtual)); - return devedit_reload({command => 'show', file => upper_path($virtual)}); + if($data->{'cgi'}->param('confirmed')) + { + unlink($physical) or return error("Could not delete file '".encode_entities($virtual)."'.",upper_path($virtual)); + return devedit_reload({command => 'show', file => upper_path($virtual)}); + } + else + { + my $dir = encode_entities(upper_path($virtual)); + my $output; + + $output = htmlhead("Remove file ".encode_entities($virtual)); + $output .= equal_url($config->{'httproot'},$virtual); + + $virtual = encode_entities($virtual); + + $output .= dir_link($virtual); + + $output .= <<"END"; +

Do you really want to remove the file '$virtual'?

+ +
+ + + + +

+
+ +
+ + + +

+
+END + + $output .= htmlfoot; + + return \$output; + } } # exec_rmdir() @@ -772,7 +810,7 @@ sub exec_rmdir($$) my $dir = encode_entities(upper_path($virtual)); my $output; - $output = htmlhead("Remove directory $virtual"); + $output = htmlhead("Remove directory ".encode_entities($virtual)); $output .= equal_url($config->{'httproot'},$virtual); $virtual = encode_entities($virtual);