--- loncom/publisher/lonupload.pm 2013/07/03 05:03:19 1.64 +++ loncom/publisher/lonupload.pm 2015/09/11 20:12:30 1.67 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.64 2013/07/03 05:03:19 raeburn Exp $ +# $Id: lonupload.pm,v 1.67 2015/09/11 20:12:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -201,9 +201,8 @@ sub phaseone { return; } $filesize = int($filesize/1000); #expressed in kb - my $authorspace = $Apache::lonnet::perlvar{'lonDocRoot'}."/priv/$udom/$uname"; - my $output = &Apache::loncommon::excess_filesize_authorspace($uname,$udom,$authorspace, - $env{'form.upfile.filename'},$filesize,'upload'); + my $output = &Apache::loncommon::excess_filesize_warning($uname,$udom,'author', + $env{'form.upfile.filename'},$filesize,'upload'); if ($output) { $r->print($output.&earlyout($fn,$uname,$udom)); return; @@ -394,7 +393,7 @@ sub check_extension { if ($pathchg) { if ($mode eq 'testbank') { $returnflag = 'embedded'; - $result .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the references(s).','','').'

'; + $result .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the reference(s).','','').'

'; } } } @@ -428,6 +427,8 @@ sub phasethree { my $dir_root = $r->dir_config('lonDocRoot').$url_root; my $path = &File::Basename::dirname($fn); $path =~ s{^\Q$url_root\E}{}; + my $dirpath = $url_root.$path.'/'; + $dirpath=~s{/+}{/}g; my $filename = &HTML::Entities::encode($env{'form.filename'},'<>&"'); my $state = &embedded_form_elems('modify_orightml',$filename,$mode). ''; @@ -438,7 +439,7 @@ sub phasethree { if ($mode ne 'imsimport' && $mode ne 'testbank') { $result .= '

'. &mt('View main file').'

'. - '

'. + '

'. &mt('Back to Directory').'


'; } return ($result,$returnflag); @@ -467,13 +468,15 @@ sub phasefour { my $dir_root = $r->dir_config('lonDocRoot').$url_root; my $path = &File::Basename::dirname($fn); $path =~ s{^\Q$url_root\E}{}; + my $dirpath = $url_root.$path.'/'; + $dirpath=~s{/+}{/}g; my $outcome = &Apache::loncommon::modify_html_refs($mode,$path,$uname,$udom,$dir_root); $result .= $outcome; if ($mode ne 'imsimport' && $mode ne 'testbank') { $result .= '

'. &mt('View main file').'

'. - '

'. + '

'. &mt('Back to Directory').'


'; } return $result;