From: Rob H. <for...@us...> - 2001-12-18 02:12:09
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv26590/bin Modified Files: sandweb.cgi Log Message: implemented file operations. the functional piece of the UI is there, I don't think the filenames are being caught correctly however. I'll work on that next. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.93 retrieving revision 1.94 diff -U2 -r1.93 -r1.94 --- sandweb.cgi 2001/12/16 09:12:49 1.93 +++ sandweb.cgi 2001/12/18 02:12:06 1.94 @@ -135,5 +135,5 @@ file( cookie => $cookie, - command => param('command'), + file_command => param('file_command'), location => param('location'), ); @@ -144,5 +144,5 @@ cookie => $cookie, filename => param('filename'), - command => param('command'), + vcs_command => param('vcs_command'), location => param('location'), ); @@ -298,6 +298,9 @@ ); + my $file = SandWeb::File->new(); + my $username = $auth->get_userinfo('username'); my @vcs_commands = $repository->get_vcs_commands(); + my @file_commands = $file->get_file_commands(); my $repo_type = $repository->get_repo_type(); @@ -306,5 +309,5 @@ # use the browse object to show user's sandbox - my $content = $browse->browse("$path", "$progname", "@vcs_commands", $repo_type); + my $content = $browse->browse("$path", "$progname", "@vcs_commands", "@file_commands", $repo_type); print header( -cookie => $cookie ); @@ -337,5 +340,5 @@ - my $command = $args{'command'}; + my $file_command = $args{'file_command'}; my $location = $args{'location'}; my $filename = param('filename'); @@ -378,5 +381,5 @@ } - if ( $command eq 'info' ) { + if ( $file_command eq 'info' ) { # can't give the leading / to the VCS $filename =~ s/\///; @@ -403,5 +406,5 @@ exit 0; } - elsif ( $command eq 'view' ) { + elsif ( $file_command eq 'view' ) { if ( $file->get_file_type() ne "Text" ) { set_error("This does not appear to be a text file."); @@ -433,5 +436,5 @@ exit 0; } - elsif ( $command eq 'edit' ) { + elsif ( $file_command eq 'edit' ) { if ($save) { my $data = param('data'), @@ -479,5 +482,5 @@ exit 0; } - elsif ( $command eq 'create_file' ) { + elsif ( $file_command eq 'create_file' ) { if ($file) { $file->create_file(); @@ -506,5 +509,5 @@ exit 0; } - elsif ( $command eq 'create_folder' ) { + elsif ( $file_command eq 'create_folder' ) { if ($file) { $file->create_folder(); @@ -533,5 +536,5 @@ exit 0; } - elsif ( $command eq 'upload' ) { + elsif ( $file_command eq 'upload' ) { my $content = $ui->get_menu( MENU => 'upload_file', @@ -551,5 +554,5 @@ exit 0; } - elsif ( $command eq 'checkout' ) { + elsif ( $file_command eq 'checkout' ) { my $content = $ui->get_menu( MENU => 'checkout', @@ -570,5 +573,5 @@ } else { - set_error("Invalid selection: $command"); + set_error("Invalid selection: $file_command"); browse_menu( cookie => $cookie, @@ -595,5 +598,5 @@ } - my $command = $args{'command'}; + my $vcs_command = $args{'vcs_command'}; my $filename = $args{'filename'}; my $location = $args{'location'}; @@ -624,5 +627,5 @@ sandbox => "$users_dir/$username", ); - if ( $command eq 'commit' ) { + if ( $vcs_command eq 'commit' ) { if ($message) { # can't give the leading / to the VCS @@ -642,7 +645,7 @@ print header( -cookie => $cookie ); $ui->print_screen( - TITLE=> "SandWeb : VCS $command", + TITLE=> "SandWeb : VCS $vcs_command", MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $command", + SUBMENU_TITLE => "VCS $vcs_command", FOOTER => '', CONTENT => $content, @@ -673,5 +676,5 @@ $location =~ s/\///; - %return = $repository->$command( file => "$location/$filename" ); + %return = $repository->$vcs_command( file => "$location/$filename" ); } my $content = $ui->get_menu( @@ -685,7 +688,7 @@ print header( -cookie => $cookie ); $ui->print_screen( - TITLE=> "SandWeb : VCS $command", + TITLE=> "SandWeb : VCS $vcs_command", MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $command", + SUBMENU_TITLE => "VCS $vcs_command", FOOTER => '', CONTENT => $content, |