From a1cc5ce8035db2ac85e3a4ae675c504ff595d3b6 Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Mon, 22 Dec 2003 13:34:15 +0000 Subject: [PATCH] Now, when the user wants to remove a file, a confirmation dialog will be displayed --- modules/Command.pm | 48 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) 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); -- 2.34.1