X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/89269f652fc46e65006b9aead5eb1ae61ebc311e..a1cc5ce8035db2ac85e3a4ae675c504ff595d3b6:/devedit.pl diff --git a/devedit.pl b/devedit.pl index 6f38e38..2c46f85 100644 --- a/devedit.pl +++ b/devedit.pl @@ -1,19 +1,18 @@ #!C:/Programme/Perl/bin/perl.exe -w # -# Dev-Editor +# Dev-Editor 1.1 # # Dev-Editor's main program # # Author: Patrick Canterino -# Last modified: 10-04-2003 +# Last modified: 2003-12-02 # use strict; use CGI::Carp qw(fatalsToBrowser); -use vars qw($VERSION - %config); +use vars qw(%config); use lib 'modules'; @@ -23,13 +22,11 @@ use File::UseList; use Output; use Tool; -$VERSION = '1.0'; - ### Settings ### %config = ( - fileroot => 'D:/Server/WWW/dokumente', - httproot => '/', + fileroot => 'D:/Server/WWW/dokumente/devedit-test', + httproot => '/devedit-test/', timeformat => '%d.%m.%Y %H:%M', uselist_file => 'uselist', lock_file => 'uselist.lock', @@ -89,21 +86,6 @@ if(-e clean_path($config{'fileroot'}."/".$file)) { if(my ($physical,$virtual) = check_path($config{'fileroot'},$file)) { - # Copied from old Dev-Editor (great idea) - - my %dispatch = ('show' => \&exec_show, - 'beginedit' => \&exec_beginedit, - 'canceledit' => \&exec_unlock, - 'endedit' => \&exec_endedit, - 'mkdir' => \&exec_mkdir, - 'mkfile' => \&exec_mkfile, - 'workwithfile' => \&exec_workwithfile, - 'copy' => \&exec_copy, - 'rename' => \&exec_rename, - 'remove' => \&exec_remove, - 'unlock' => \&exec_unlock - ); - # Create a File::UseList object and load the list my $uselist = new File::UseList(listfile => $config{'uselist_file'}, @@ -123,15 +105,9 @@ if(-e clean_path($config{'fileroot'}."/".$file)) uselist => $uselist, cgi => $cgi); - unless($dispatch{$command}) - { - $uselist->unlock; - abort("Unknown command: $command"); - } - - my $output = &{$dispatch{$command}}(\%data,\%config); # Execute the command... + my $output = exec_command($command,\%data,\%config); # Execute the command... - $uselist->unlock; # ... unlock the list with used files... + $uselist->unlock; # ... unlock the list with files in use... print $$output; # ... and print the output of the command } else