-# exec_workwithfile()
-#
-# Display a form for renaming/copying/removing/unlocking a file
-#
-# Params: 1. Reference to user input hash
-# 2. Reference to config hash
-#
-# Return: Output of the command (Scalar Reference)
-
-sub exec_workwithfile($$)
-{
- my ($data,$config) = @_;
- my $physical = $data->{'physical'};
- my $virtual = $data->{'virtual'};
- my $unused = $data->{'uselist'}->unused($virtual);
-
- my $dir = encode_entities(upper_path($virtual));
-
- my $output = htmlhead("Work with file ".encode_entities($virtual));
- $output .= equal_url($config->{'httproot'},$virtual);
-
- $virtual = encode_entities($virtual);
-
- $output .= dir_link($virtual);
- $output .= "<p><b>Note:</b> On UNIX systems, filenames are <b>case-sensitive</b>!</p>\n\n";
-
- $output .= "<p>Someone else is currently editing this file. So not all features are available.</p>\n\n" unless($unused);
-
- $output .= "<hr>\n\n";
-
- # Copying of the file is always allowed - but we need read access
-
- if(-r $physical)
- {
- $output .= <<END;
-<h2>Copy</h2>
-
-<form action="$script">
-<input type="hidden" name="command" value="copy">
-<input type="hidden" name="file" value="$virtual">
-<p>Copy file '$virtual' to:<br>$dir <input type="text" name="newfile" size="30"> <input type="submit" value="Copy!"></p>
-</form>
-
-<hr>
-
-END
- }
-
- if($unused)
- {
- # File is not locked
- # Allow renaming and deleting the file
-
- $output .= <<END;
-<h2>Move/rename</h2>
-
-<form action="$script">
-<input type="hidden" name="command" value="rename">
-<input type="hidden" name="file" value="$virtual">
-<p>Move/Rename file '$virtual' to:<br>$dir <input type="text" name="newfile" size="30"> <input type="submit" value="Move/Rename!"></p>
-</form>
-
-<hr>
-
-<h2>Remove</h2>
-
-<p>Click on the button below to remove the file '$virtual'.</p>
-
-<form action="$script" method="get">
-<input type="hidden" name="file" value="$virtual">
-<input type="hidden" name="command" value="remove">
-<p><input type="submit" value="Remove!"></p>
-</form>
-END
- }
- else
- {
- # File is locked
- # Just display a button for unlocking it
-
- $output .= <<END;
-<h2>Unlock file</h2>
-
-<p>Someone else is currently editing this file. At least, the file is marked so. Maybe, someone who was editing the file has forgotten to unlock it. In this case (and <b>only</b> in this case) you can unlock the file using this button:</p>
-
-<form action="$script" method="get">
-<input type="hidden" name="file" value="$virtual">
-<input type="hidden" name="command" value="unlock">
-<p><input type="submit" value="Unlock file '$virtual'"></p>
-</form>
-END
- }
-
- $output .= "\n<hr>";
- $output .= htmlfoot;
-
- return \$output;
-}
-
-# exec_workwithdir()
-#
-# Display a form for renaming/removing a directory
-#
-# Params: 1. Reference to user input hash
-# 2. Reference to config hash
-#
-# Return: Output of the command (Scalar Reference)
-
-sub exec_workwithdir($$)
-{
- my ($data,$config) = @_;
- my $physical = $data->{'physical'};
- my $virtual = $data->{'virtual'};
-
- my $dir = encode_entities(upper_path($virtual));
-
- my $output = htmlhead("Work with directory ".encode_entities($virtual));
- $output .= equal_url($config->{'httproot'},$virtual);
-
- $virtual = encode_entities($virtual);
-
- $output .= dir_link($virtual);
- $output .= "<p><b>Note:</b> On UNIX systems, filenames are <b>case-sensitive</b>!</p>\n\n";
- $output .= "<hr>\n\n";
-
- $output .= <<END;
-<h2>Move/rename</h2>
-
-<form action="$script">
-<input type="hidden" name="command" value="rename">
-<input type="hidden" name="file" value="$virtual">
-<p>Move/Rename directory '$virtual' to:<br>$dir <input type="text" name="newfile" size="50"> <input type="submit" value="Move/Rename!"></p>
-</form>
-
-<hr>
-
-<h2>Remove</h2>
-
-<p>Click on the button below to completely remove the directory '$virtual' and oll of it's files and sub directories.</p>
-
-<form action="$script" method="get">
-<input type="hidden" name="file" value="$virtual">
-<input type="hidden" name="command" value="rmdir">
-<p><input type="submit" value="Remove!"></p>
-</form>
-END
-
- $output .= "\n<hr>";
- $output .= htmlfoot;
-
- return \$output;
-}
-