--- loncom/publisher/loncfile.pm 2013/04/11 14:59:58 1.118 +++ loncom/publisher/loncfile.pm 2013/07/23 13:40:20 1.121 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.118 2013/04/11 14:59:58 bisitz Exp $ +# $Id: loncfile.pm,v 1.121 2013/07/23 13:40:20 bisitz 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 @@ -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_warning($user,$domain,$authorspace, + $fname,$filesize,'copy'); + if ($output) { + $request->print($output.'
'.&mt('Cancel').''); + return; + } $request->print( '' @@ -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()