--- loncom/publisher/loncfile.pm 2012/11/30 11:36:14 1.117 +++ loncom/publisher/loncfile.pm 2013/07/03 05:03:19 1.120 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.117 2012/11/30 11:36:14 bisitz Exp $ +# $Id: loncfile.pm,v 1.120 2013/07/03 05:03:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,7 @@ =head1 NAME -Apache::loncfile - Construction space file management. +Apache::loncfile - Authoring space file management. =head1 SYNOPSIS @@ -235,7 +235,7 @@ sub empty_directory { =item exists($user, $domain, $file) - Determine if a resource file name has been published or exists + Determine if a resource filename has been published or exists in the construction space. Parameters: @@ -368,7 +368,7 @@ sub cleanDest { ($newpath,$error)=&relativeDest($fn,$newpath,$uname,$udom); if (! -d "$newpath") { $request->print('

' - .&mt("You have requested to create file in directory [_1] which doesn't exist. The requested directory path has been removed from the requested file name." + .&mt("You have requested to create file in directory [_1] which doesn't exist. The requested directory path has been removed from the requested filename." ,&display($newpath)) .'

'); $dest=~s|.*/||; @@ -700,9 +700,21 @@ sub Copy1 { my ($type,$return)=&exists($user, $domain, $newfilename); $request->print($return); if ($type eq 'error') { - $request->print('
'.&mt('Cancel').''); + $request->print('
'.&mt('Cancel').''); return; } +# Check if there is enough space. + my @fileinfo = stat($fn); + my ($dir,$fname) = ($fn =~ m{^(.+/)([^/]+)$}); + my $filesize = $fileinfo[7]; + $filesize = int($filesize/1000); #expressed in kb + my $authorspace = $Apache::lonnet::perlvar{'lonDocRoot'}."/priv/$domain/$user"; + my $output = &Apache::loncommon::excess_filesize_authorspace($user,$domain,$authorspace, + $fname,$filesize,'copy'); + if ($output) { + $request->print($output.'
'.&mt('Cancel').''); + return; + } $request->print( '' @@ -825,7 +837,7 @@ Parameters: =item $domain - Name of the domain of the user -=item $fn - Source file name +=item $fn - Source filename =item $newfilename - Name of the file to be created; no path information @@ -880,7 +892,7 @@ sub NewFile1 { '
'. ''. ''. - ''.&mt('Enter a file name: ').' '. + ''.&mt('Enter a filename: ').' '. '

'. '

'); @@ -1488,16 +1500,16 @@ function writeDone() { # Breadcrumbs &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', + 'text' => 'Authoring Space', 'href' => &Apache::loncommon::authorspace($fn), }); &Apache::lonhtmlcommon::add_breadcrumb({ 'text' => 'File Operation', - 'title' => 'Construction Space File Operation', + 'title' => 'Authoring Space File Operation', 'href' => '', }); - $r->print(&Apache::loncommon::start_page('Construction Space File Operation', + $r->print(&Apache::loncommon::start_page('Authoring Space File Operation', $js, {'add_entries' => \%loaditem,}) .&Apache::lonhtmlcommon::breadcrumbs()