version 1.45, 2003/11/19 15:06:33
|
version 1.52, 2004/03/02 16:48:27
|
Line 72 use Apache::loncacc;
|
Line 72 use Apache::loncacc;
|
use Apache::Log (); |
use Apache::Log (); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
use Apache::lonlocal; |
|
|
my $DEBUG=0; |
my $DEBUG=0; |
my $r; # Needs to be global for some stuff RF. |
my $r; # Needs to be global for some stuff RF. |
Line 110 sub Debug {
|
Line 111 sub Debug {
|
# Put out the indicated message butonly if DEBUG is true. |
# Put out the indicated message butonly if DEBUG is true. |
|
|
if ($DEBUG) { |
if ($DEBUG) { |
$log->debug($message); |
$r->log_reason($message); |
} |
} |
} |
} |
|
|
Line 172 sub display {
|
Line 173 sub display {
|
return '<tt>'.$fn.'</tt>'; |
return '<tt>'.$fn.'</tt>'; |
} |
} |
|
|
|
|
|
# see if the file is |
|
# a) published (return 0 if not) |
|
# b) if, so obsolete (return 0 if not) |
|
|
|
sub obsolete_unpub { |
|
my ($user,$domain,$construct)=@_; |
|
my $published=$construct; |
|
$published=~ |
|
s/^\/home\/$user\/public\_html\//\/home\/httpd\/html\/res\/$domain\/$user\//; |
|
if (-e $published) { |
|
if (&Apache::lonnet::metadata($published,'obsolete')) { |
|
return 1; |
|
} |
|
return 0; |
|
} else { |
|
return 1; |
|
} |
|
} |
|
|
|
|
|
|
=pod |
=pod |
|
|
=item exists($user, $domain, $file) |
=item exists($user, $domain, $file) |
Line 211 sub exists {
|
Line 234 sub exists {
|
s/^\/home\/$user\/public\_html\//\/home\/httpd\/html\/res\/$domain\/$user\//; |
s/^\/home\/$user\/public\_html\//\/home\/httpd\/html\/res\/$domain\/$user\//; |
my $result=''; |
my $result=''; |
if ( -d $construct ) { |
if ( -d $construct ) { |
return 'Error: destination for operation is an existing directory.'; |
return &mt('Error: destination for operation is an existing directory.'); |
} |
} |
if ( -e $published) { |
if ( -e $published) { |
$result.='<p><font color="red">Warning: target file exists, and has been published!</font></p>'; |
$result.='<p><font color="red">'.&mt('Warning: target file exists, and has been published!').'</font></p>'; |
} elsif ( -e $construct) { |
} elsif ( -e $construct) { |
$result.='<p><font color="red">Warning: target file exists!</font></p>'; |
$result.='<p><font color="red">'.&mt('Warning: target file exists!').'</font></p>'; |
} |
} |
return $result; |
return $result; |
|
|
Line 260 sub checksuffix {
|
Line 283 sub checksuffix {
|
if ($old=~m:(.*)/+([^/]+)\.(\w+)$:) { $oldsuffix=$3; } |
if ($old=~m:(.*)/+([^/]+)\.(\w+)$:) { $oldsuffix=$3; } |
if ($oldsuffix ne $newsuffix) { |
if ($oldsuffix ne $newsuffix) { |
$result.= |
$result.= |
'<p><font color="red">Warning: change of MIME type!</font></p>'; |
'<p><font color="red">'.&mt('Warning: change of MIME type!').'</font></p>'; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 269 sub cleanDest {
|
Line 292 sub cleanDest {
|
my ($request,$dest)=@_; |
my ($request,$dest)=@_; |
#remove bad characters |
#remove bad characters |
if ($dest=~/[\#\?&]/) { |
if ($dest=~/[\#\?&]/) { |
$request->print("<p><font color=\"red\">Invalid characters in requested name have been removed.</font></p>"); |
$request->print("<p><font color=\"red\">".&mt('Invalid characters in requested name have been removed.')."</font></p>"); |
$dest=~s/[\#\?&]//g; |
$dest=~s/[\#\?&]//g; |
} |
} |
return $dest; |
return $dest; |
Line 312 Parameters:
|
Line 335 Parameters:
|
|
|
sub CloseForm1 { |
sub CloseForm1 { |
my ($request, $fn) = @_; |
my ($request, $fn) = @_; |
$request->print('<p><input type="submit" value="Continue" /></p></form>'); |
$request->print('<p><input type="submit" value="'.&mt('Continue').'" /></p></form>'); |
$request->print('<form action="'.&url($fn). |
$request->print('<form action="'.&url($fn). |
'" method="POST"><p><input type="submit" value="Cancel" /></p></form>'); |
'" method="POST"><p><input type="submit" value="'.&mt('Cancel').'" /></p></form>'); |
} |
} |
|
|
|
|
Line 344 Parameters:
|
Line 367 Parameters:
|
|
|
sub CloseForm2 { |
sub CloseForm2 { |
my ($request, $user, $fn) = @_; |
my ($request, $user, $fn) = @_; |
$request->print('<h3><a href="'.&url($fn).'/">Done</a></h3>'); |
$request->print('<h3><a href="'.&url($fn).'/">'.&mt('Done').'</a></h3>'); |
} |
} |
|
|
=pod |
=pod |
Line 383 new filename relative to the current dir
|
Line 406 new filename relative to the current dir
|
=cut |
=cut |
|
|
sub Rename1 { |
sub Rename1 { |
my ($request, $user, $domain, $fn, $newfilename) = @_; |
my ($request, $user, $domain, $fn, $newfilename, $style) = @_; |
|
|
if(-e $fn) { |
if(-e $fn) { |
if($newfilename) { |
if($newfilename) { |
# is dest a dir |
# is dest a dir |
if (-d $newfilename) { |
if ($style eq 'move') { |
if ($fn =~ m|/([^/]*)$|) { $newfilename .= '/'.$1; } |
if (-d $newfilename) { |
|
if ($fn =~ m|/([^/]*)$|) { $newfilename .= '/'.$1; } |
|
} |
} |
} |
if ($newfilename =~ m|/[^\.]+$|) { |
if ($newfilename =~ m|/[^\.]+$|) { |
#no extension add on original extension |
#no extension add on original extension |
Line 410 sub Rename1 {
|
Line 435 sub Rename1 {
|
my $return=&exists($user, $domain, $newfilename); |
my $return=&exists($user, $domain, $newfilename); |
$request->print($return); |
$request->print($return); |
if ($return =~/^Error:/) { |
if ($return =~/^Error:/) { |
$request->print('<br /><a href="'.&url($fn).'">Cancel</a>'); |
$request->print('<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>'); |
|
return; |
|
} |
|
unless (&obsolete_unpub($user,$domain,$fn)) { |
|
$request->print('<h3>'.&mt('Cannot rename or move non-obsolete published file').'</h3>'. |
|
'<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>'); |
return; |
return; |
} |
} |
|
my $action; |
|
if ($style eq 'rename') { |
|
$action=&mt('Rename'); |
|
} else { |
|
$action=&mt('Move'); |
|
} |
$request->print('<input type="hidden" name="newfilename" value="'. |
$request->print('<input type="hidden" name="newfilename" value="'. |
$newfilename. |
$newfilename. |
'" /><p>Rename '.&display($fn). |
'" /><p>'.$action.' '.&display($fn). |
'</tt><br />to '.&display($newfilename).'?</p>'); |
'</tt><br />to '.&display($newfilename).'?</p>'); |
&CloseForm1($request, $fn); |
&CloseForm1($request, $fn); |
} else { |
} else { |
$request->print('<p>No new filename specified.</p></form>'); |
$request->print('<p>'.&mt('No new filename specified.').'</p></form>'); |
return; |
return; |
} |
} |
} else { |
} else { |
$request->print('<p> No such file: '.&display($fn).'</p></form>'); |
$request->print('<p> '.&mt('No such file').': '.&display($fn).'</p></form>'); |
return; |
return; |
} |
} |
|
|
Line 458 sub Delete1 {
|
Line 494 sub Delete1 {
|
if( -e $fn) { |
if( -e $fn) { |
$request->print('<input type="hidden" name="newfilename" value="'. |
$request->print('<input type="hidden" name="newfilename" value="'. |
$fn.'"/>'); |
$fn.'"/>'); |
$request->print('<p>Delete '.&display($fn).'?</p>'); |
unless (&obsolete_unpub($user,$domain,$fn)) { |
|
$request->print('<h3>'.&mt('Cannot delete non-obsolete published file').'</h3>'. |
|
'<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>'); |
|
return; |
|
} |
|
$request->print('<p>'.&mt('Delete').' '.&display($fn).'?</p>'); |
&CloseForm1($request, $fn); |
&CloseForm1($request, $fn); |
} else { |
} else { |
$request->print('<p>No such file: '.&display($fn).'</p></form>'); |
$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>'); |
} |
} |
} |
} |
|
|
Line 512 sub Copy1 {
|
Line 553 sub Copy1 {
|
my $return=&exists($user, $domain, $newfilename); |
my $return=&exists($user, $domain, $newfilename); |
$request->print($return); |
$request->print($return); |
if ($return =~/^Error:/) { |
if ($return =~/^Error:/) { |
$request->print('<br /><a href="'.&url($fn).'">Cancel</a>'); |
$request->print('<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>'); |
return; |
return; |
} |
} |
$request->print('<input type="hidden" name="newfilename" value="'. |
$request->print('<input type="hidden" name="newfilename" value="'. |
$newfilename. |
$newfilename. |
'" /><p>Copy '.&display($fn).'<br />to '. |
'" /><p>'.&mt('Copy').' '.&display($fn).'<br />to '. |
&display($newfilename).'?</p>'); |
&display($newfilename).'?</p>'); |
&CloseForm1($request, $fn); |
&CloseForm1($request, $fn); |
} else { |
} else { |
$request->print('<p>No such file: '.&display($fn).'</p></form>'); |
$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>'); |
} |
} |
} |
} |
|
|
Line 566 causes the newdir operation to transitio
|
Line 607 causes the newdir operation to transitio
|
|
|
sub NewDir1 |
sub NewDir1 |
{ |
{ |
my ($request, $username, $domain, $fn, $newfilename) = @_; |
my ($request, $username, $domain, $fn, $newfilename, $mode) = @_; |
|
|
my $result=&exists($username,$domain,$newfilename); |
my $result=&exists($username,$domain,$newfilename); |
if ($result) { |
if ($result) { |
$request->print('<font color="red">'.$result.'</font></form>'); |
$request->print('<font color="red">'.$result.'</font></form>'); |
} else { |
} else { |
|
if ($mode eq 'testbank') { |
|
$request->print('<input type="hidden" name="callingmode" value="testbank">'); |
|
} elsif ($mode eq 'imsimport') { |
|
$request->print('<input type="hidden" name="callingmode" value="imsimport">'); |
|
} |
$request->print('<input type="hidden" name="newfilename" value="'. |
$request->print('<input type="hidden" name="newfilename" value="'. |
$newfilename.'" /><p>Make new directory '. |
$newfilename.'" /><p>'.&mt('Make new directory').' '. |
&display($newfilename).'?</p>'); |
&display($newfilename).'?</p>'); |
&CloseForm1($request, $fn); |
&CloseForm1($request, $fn); |
} |
} |
Line 584 sub Decompress1 {
|
Line 630 sub Decompress1 {
|
my ($request, $user, $domain, $fn) = @_; |
my ($request, $user, $domain, $fn) = @_; |
if( -e $fn) { |
if( -e $fn) { |
$request->print('<input type="hidden" name="newfilename" value="'.$fn.'"/>'); |
$request->print('<input type="hidden" name="newfilename" value="'.$fn.'"/>'); |
$request->print('<p>Decompress '.&display($fn).'?</p>'); |
$request->print('<p>'.&mt('Decompress').' '.&display($fn).'?</p>'); |
&CloseForm1($request, $fn); |
&CloseForm1($request, $fn); |
} else { |
} else { |
$request->print('<p>No such file: '.&display($fn).'</p></form>'); |
$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>'); |
} |
} |
} |
} |
=pod |
=pod |
Line 640 sub NewFile1 {
|
Line 686 sub NewFile1 {
|
##Informs User (name).(number).(extension) not allowed |
##Informs User (name).(number).(extension) not allowed |
if($newfilename =~ /\.(\d+)\.(\w+)$/){ |
if($newfilename =~ /\.(\d+)\.(\w+)$/){ |
$r->print('<font color="red">'.$newfilename. |
$r->print('<font color="red">'.$newfilename. |
' - Bad Filename<br />(name).(number).(extension)'. |
' - '.&mt('Bad Filename').'<br />('.&mt('name').').('.&mt('number').').('.&mt('extension').')'. |
' Not Allowed</font>'); |
' '.&mt('Not Allowed').'</font>'); |
return; |
return; |
} |
} |
if ($newfilename !~ /\Q.$extension\E$/) { |
if ($newfilename !~ /\Q.$extension\E$/) { |
Line 656 sub NewFile1 {
|
Line 702 sub NewFile1 {
|
if($result) { |
if($result) { |
$request->print('<font color="red">'.$result.'</font></form>'); |
$request->print('<font color="red">'.$result.'</font></form>'); |
} else { |
} else { |
$request->print('<p>Make new file '.&display($newfilename).'?</p>'); |
$request->print('<p>'.&mt('Make new file').' '.&display($newfilename).'?</p>'); |
$request->print('</form>'); |
$request->print('</form>'); |
$request->print('<form action="'.&url($newfilename). |
$request->print('<form action="'.&url($newfilename). |
'" method="POST"><p><input type="submit" value="Continue" /></p></form>'); |
'" method="POST"><p><input type="submit" value="'.&mt('Continue').'" /></p></form>'); |
$request->print('<form action="'.&url($fn). |
$request->print('<form action="'.&url($fn). |
'" method="POST"><p><input type="submit" value="Cancel" /></p></form>'); |
'" method="POST"><p><input type="submit" value="'.&mt('Cancel').'" /></p></form>'); |
} |
} |
} |
} |
|
|
Line 704 sub phaseone {
|
Line 750 sub phaseone {
|
'<input type="hidden" name="action" value="'.$ENV{'form.action'}.'" />'); |
'<input type="hidden" name="action" value="'.$ENV{'form.action'}.'" />'); |
|
|
if ($ENV{'form.action'} eq 'rename') { |
if ($ENV{'form.action'} eq 'rename') { |
&Rename1($r, $uname, $udom, $fn, $newfilename); |
&Rename1($r, $uname, $udom, $fn, $newfilename, 'rename'); |
|
} elsif ($ENV{'form.action'} eq 'move') { |
|
&Rename1($r, $uname, $udom, $fn, $newfilename, 'move'); |
} elsif ($ENV{'form.action'} eq 'delete') { |
} elsif ($ENV{'form.action'} eq 'delete') { |
&Delete1($r, $uname, $udom, $fn); |
&Delete1($r, $uname, $udom, $fn); |
} elsif ($ENV{'form.action'} eq 'decompress') { |
} elsif ($ENV{'form.action'} eq 'decompress') { |
Line 713 sub phaseone {
|
Line 761 sub phaseone {
|
if($newfilename) { |
if($newfilename) { |
&Copy1($r, $uname, $udom, $fn, $newfilename); |
&Copy1($r, $uname, $udom, $fn, $newfilename); |
} else { |
} else { |
$r->print('<p>No new filename specified.</p></form>'); |
$r->print('<p>'.&mt('No new filename specified.').'</p></form>'); |
} |
} |
} elsif ($ENV{'form.action'} eq 'newdir') { |
} elsif ($ENV{'form.action'} eq 'newdir') { |
&NewDir1($r, $uname, $udom, $fn, $newfilename); |
my $mode = ''; |
|
if (exists($ENV{'form.callingmode'}) ) { |
|
$mode = $ENV{'form.callingmode'}; |
|
} |
|
&NewDir1($r, $uname, $udom, $fn, $newfilename, $mode); |
} elsif ($ENV{'form.action'} eq 'newfile' || |
} elsif ($ENV{'form.action'} eq 'newfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
Line 728 sub phaseone {
|
Line 780 sub phaseone {
|
if ($newfilename) { |
if ($newfilename) { |
&NewFile1($r, $uname, $udom, $fn, $newfilename); |
&NewFile1($r, $uname, $udom, $fn, $newfilename); |
} else { |
} else { |
$r->print('<p>No new filename specified.</p></form>'); |
$r->print('<p>'.&mt('No new filename specified.').'</p></form>'); |
} |
} |
} |
} |
} |
} |
Line 780 sub Rename2 {
|
Line 832 sub Rename2 {
|
my $oRN=$oldfile; |
my $oRN=$oldfile; |
my $nRN=$newfile; |
my $nRN=$newfile; |
unless (rename($oldfile,$newfile)) { |
unless (rename($oldfile,$newfile)) { |
$request->print('<font color="red">Error: '.$!.'</font>'); |
$request->print('<font color="red">'.&mt('Error').': '.$!.'</font>'); |
return 0; |
return 0; |
} |
} |
## If old name.(extension) exits, move under new name. |
## If old name.(extension) exits, move under new name. |
Line 815 sub Rename2 {
|
Line 867 sub Rename2 {
|
unlink $tmp2; |
unlink $tmp2; |
} |
} |
} else { |
} else { |
$request->print("<p> No such file: ".&display($oldfile).'</p></form>'); |
$request->print("<p> ".&mt('No such file').": ".&display($oldfile).'</p></form>'); |
return 0; |
return 0; |
} |
} |
return 1; |
return 1; |
Line 851 Returns:
|
Line 903 Returns:
|
|
|
sub Delete2 { |
sub Delete2 { |
my ($request, $user, $filename) = @_; |
my ($request, $user, $filename) = @_; |
|
if(opendir DIR, $filename) { |
if(-e $filename) { |
my @files=readdir(DIR); |
unless(unlink($filename)) { |
shift @files; shift @files; # takes off . and .. |
$request->print('<font color="red">Error: '.$!.'</font>'); |
if(@files) { |
|
$request->print('<font color="red"> '.&mt('Error: Directory Non Empty').'</font>'); |
|
return 0; |
|
} else { |
|
if(-e $filename) { |
|
unless(rmdir($filename)) { |
|
$request->print('<font color="red">'.&mt('Error').': '.$!.'</font>'); |
|
return 0; |
|
} |
|
} else { |
|
$request->print('<p> '.&mt('No such file').'. </p></form>'); |
|
return 0; |
|
} |
|
} |
|
} else { |
|
if(-e $filename) { |
|
unless(unlink($filename)) { |
|
$request->print('<font color="red">'.&mt('Error').': '.$!.'</font>'); |
|
return 0; |
|
} |
|
} else { |
|
$request->print('<p> '.&mt('No such file').'. </p></form>'); |
return 0; |
return 0; |
} |
|
} else { |
|
$request->print('<p> No such file. </p></form'); |
|
return 0; |
|
} |
} |
|
} |
return 1; |
return 1; |
} |
} |
|
|
Line 897 sub Copy2 {
|
Line 967 sub Copy2 {
|
&Debug($request ,"Will try to copy $oldfile to $newfile"); |
&Debug($request ,"Will try to copy $oldfile to $newfile"); |
if(-e $oldfile) { |
if(-e $oldfile) { |
unless (copy($oldfile, $newfile)) { |
unless (copy($oldfile, $newfile)) { |
$request->print('<font color="red"> copy Error: '.$!.'</font>'); |
$request->print('<font color="red"> '.&mt('copy Error').': '.$!.'</font>'); |
return 0; |
return 0; |
} else { |
} else { |
unless (chmod(0660, $newfile)) { |
unless (chmod(0660, $newfile)) { |
$request->print('<font color="red"> chmod error: '.$!.'</font>'); |
$request->print('<font color="red"> '.&mt('chmod error').': '.$!.'</font>'); |
return 0; |
return 0; |
} |
} |
return 1; |
return 1; |
} |
} |
} else { |
} else { |
$request->print('<p> No such file </p>'); |
$request->print('<p> '.&mt('No such file').' </p>'); |
return 0; |
return 0; |
} |
} |
return 1; |
return 1; |
Line 938 sub NewDir2 {
|
Line 1008 sub NewDir2 {
|
my ($request, $user, $newdirectory) = @_; |
my ($request, $user, $newdirectory) = @_; |
|
|
unless(mkdir($newdirectory, 02770)) { |
unless(mkdir($newdirectory, 02770)) { |
$request->print('<font color="red">Error: '.$!.'</font>'); |
$request->print('<font color="red">'.&mt('Error').': '.$!.'</font>'); |
return 0; |
return 0; |
} |
} |
unless(chmod(02770, ($newdirectory))) { |
unless(chmod(02770, ($newdirectory))) { |
$request->print('<font color="red"> Error: '.$!.'</font>'); |
$request->print('<font color="red"> '.&mt('Error').': '.$!.'</font>'); |
return 0; |
return 0; |
} |
} |
return 1; |
return 1; |
Line 999 sub phasetwo {
|
Line 1069 sub phasetwo {
|
my $dir; # Directory path |
my $dir; # Directory path |
my $main; # Filename. |
my $main; # Filename. |
my $suffix; # Extension. |
my $suffix; # Extension. |
|
if ($fn=~m:(.*)/([^/]+):) { |
if ($fn=~m:(.*)/([^/]+)\.(\w+)$:) { |
|
$dir=$1; # Directory path |
$dir=$1; # Directory path |
$main=$2; # Filename. |
$main=$2; # Filename. |
$suffix=$3; # Extension. |
} |
} |
if($main=~m:\.(\w+)$:){ # Fixes problems with filenames with no extensions |
|
$main=$`; #This is what is before the match (.) so it's just the main filename, yea it's nasty |
|
$suffix=$1; #This is the actually filename extension if it exists |
|
} |
my $dest; # On success this is where we'll go. |
my $dest; # On success this is where we'll go. |
|
|
&Debug($r, |
&Debug($r, |
Line 1058 sub phasetwo {
|
Line 1129 sub phasetwo {
|
$dest = $ENV{'form.newfilename'}; |
$dest = $ENV{'form.newfilename'}; |
|
|
} else { |
} else { |
$r->print('<p>No New filename specified</p></form>'); |
$r->print('<p>'.&mt('No New filename specified').'</p></form>'); |
return; |
return; |
} |
} |
|
|
Line 1069 sub phasetwo {
|
Line 1140 sub phasetwo {
|
} |
} |
$dest = $newdir."/" |
$dest = $newdir."/" |
} |
} |
$r->print('<h3><a href="'.&url($dest).'">Done</a></h3>'); |
if ( ($ENV{'form.action'} eq 'newdir') && ($ENV{'form.phase'} eq 'two') && ( ($ENV{'form.callingmode'} eq 'testbank') || ($ENV{'form.callingmode'} eq 'imsimport') ) ) { |
|
$r->print('<h3><a href="javascript:self.close()">'.&mt('Done').'</a></h3>'); |
|
} else { |
|
$r->print('<h3><a href="'.&url($dest).'">'.&mt('Done').'</a></h3>'); |
|
} |
} |
} |
|
|
sub handler { |
sub handler { |
Line 1134 sub handler {
|
Line 1209 sub handler {
|
} |
} |
|
|
|
|
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
$r->print('<html><head><title>LON-CAPA Construction Space</title></head>'); |
if ( ($ENV{'form.action'} eq 'newdir') && ($ENV{'form.phase'} eq 'two') && ( ($ENV{'form.callingmode'} eq 'testbank') || ($ENV{'form.callingmode'} eq 'imsimport') ) ) { |
|
my $newdirname = $ENV{'form.newfilename'}; |
$r->print(&Apache::loncommon::bodytag('Construction Space File Operation')); |
$r->print('<html><head><title>LON-CAPA Construction Space</title><script language="Javascript">'); |
|
$r->print(qq| |
|
function writeDone() { |
|
var winName = window.opener |
|
window.focus(); |
|
winName.document.dataForm.newdir.value = "$newdirname" |
|
setTimeout("self.close()",10000) |
|
} |
|
</script> |
|
</head>|); |
|
my $loaditem = 'onLoad="writeDone()"'; |
|
$r->print(&Apache::loncommon::bodytag('Construction Space File Operation','',$loaditem)); |
|
} else { |
|
$r->print('<html><head><title>LON-CAPA Construction Space</title></head>'); |
|
$r->print(&Apache::loncommon::bodytag('Construction Space File Operation')); |
|
} |
|
|
|
|
$r->print('<h3>Location: '.&display($fn).'</h3>'); |
$r->print('<h3>'.&mt('Location').': '.&display($fn).'</h3>'); |
|
|
if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) { |
if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) { |
$r->print('<h3><font color="red">Co-Author: '.$uname.' at '.$udom. |
$r->print('<h3><font color="red">'.&mt('Co-Author').': '.$uname.' at '.$udom. |
'</font></h3>'); |
'</font></h3>'); |
} |
} |
|
|
Line 1153 sub handler {
|
Line 1243 sub handler {
|
&Debug($r, "loncfile::handler Form action is $ENV{'form.action'} "); |
&Debug($r, "loncfile::handler Form action is $ENV{'form.action'} "); |
if ($ENV{'form.action'} eq 'delete') { |
if ($ENV{'form.action'} eq 'delete') { |
|
|
$r->print('<h3>Delete</h3>'); |
$r->print('<h3>'.&mt('Delete').'</h3>'); |
} elsif ($ENV{'form.action'} eq 'rename') { |
} elsif ($ENV{'form.action'} eq 'rename') { |
$r->print('<h3>Rename</h3>'); |
$r->print('<h3>'.&mt('Rename').'</h3>'); |
|
} elsif ($ENV{'form.action'} eq 'move') { |
|
$r->print('<h3>'.&mt('Move').'</h3>'); |
} elsif ($ENV{'form.action'} eq 'newdir') { |
} elsif ($ENV{'form.action'} eq 'newdir') { |
$r->print('<h3>New Directory</h3>'); |
$r->print('<h3>'.&mt('New Directory').'</h3>'); |
} elsif ($ENV{'form.action'} eq 'decompress') { |
} elsif ($ENV{'form.action'} eq 'decompress') { |
$r->print('<h3>Decompress</h3>'); |
$r->print('<h3>'.&mt('Decompress').'</h3>'); |
} elsif ($ENV{'form.action'} eq 'copy') { |
} elsif ($ENV{'form.action'} eq 'copy') { |
$r->print('<h3>Copy</h3>'); |
$r->print('<h3>'.&mt('Copy').'</h3>'); |
} elsif ($ENV{'form.action'} eq 'newfile' || |
} elsif ($ENV{'form.action'} eq 'newfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
Line 1170 sub handler {
|
Line 1262 sub handler {
|
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
$ENV{'form.action'} eq 'Select Action' ) { |
$ENV{'form.action'} eq 'Select Action' ) { |
$r->print('<h3>New Resource</h3>'); |
$r->print('<h3>'.&mt('New Resource').'</h3>'); |
} else { |
} else { |
$r->print('<p>Unknown Action '.$ENV{'form.action'}.' </p></body></html>'); |
$r->print('<p>'.&mt('Unknown Action').' '.$ENV{'form.action'}.' </p></body></html>'); |
return OK; |
return OK; |
} |
} |
if ($ENV{'form.phase'} eq 'two') { |
if ($ENV{'form.phase'} eq 'two') { |