--- loncom/publisher/loncfile.pm 2009/05/26 18:01:39 1.100 +++ loncom/publisher/loncfile.pm 2010/04/13 22:28:42 1.100.2.4 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.100 2009/05/26 18:01:39 bisitz Exp $ +# $Id: loncfile.pm,v 1.100.2.4 2010/04/13 22:28:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -363,14 +363,14 @@ sub cleanDest { 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." - ,''.&display($newpath).'') + ,&display($newpath)) .'

'); $dest=~s|.*/||; } } if ($dest =~ /\.(\d+)\.(\w+)$/){ $request->print('

' - .&mt('Bad filename [_1]',''.&display($dest).'') + .&mt('Bad filename [_1]',&display($dest)) .'
' .&mt('[_1](name).(number).(extension)[_2] not allowed.','','') .'
' @@ -552,8 +552,9 @@ sub Rename1 { $request->print('' .'

' - .&mt($action.' [_1] to [_2]?' - ,&display($fn),&display($newfilename)) + .&mt($action.' [_1] to [_2]?', + &display($fn), + &display($newfilename)) .'

' ); &CloseForm1($request, $fn); @@ -563,8 +564,8 @@ sub Rename1 { } } else { $request->print('

' - .&mt('No such file: [_1]' - ,''.&display($fn).'') + .&mt('No such file: [_1]', + &display($fn)) .'

' ); return; @@ -625,15 +626,15 @@ sub Delete1 { } } $request->print('

' - .&mt('Delete [_1]?' - ,''.&display($fn).'') + .&mt('Delete [_1]?', + &display($fn)) .'

' ); &CloseForm1($request, $fn); } else { $request->print('

' - .&mt('No such file: [_1]' - ,''.&display($fn).'') + .&mt('No such file: [_1]', + &display($fn)) .'

' ); } @@ -689,19 +690,21 @@ sub Copy1 { $request->print('
'.&mt('Cancel').''); return; } - $request->print('' - .'

' - .&mt('Copy [_1] to [_2]?' - ,''.&display($fn).'' - ,''.&display($newfilename).'') - .'

' + + $request->print( + '' + .'

' + .&mt('Copy [_1] to [_2]?', + &display($fn), + &display($newfilename)) + .'

' ); &CloseForm1($request, $fn); } else { $request->print('

' - .&mt('No such file: [_1]' - ,''.&display($fn).'') + .&mt('No such file: [_1]', + &display($fn)) .'

' ); } @@ -762,8 +765,8 @@ sub NewDir1 { $request->print('' .'

' - .&mt('Make new directory [_1]?' - ,''.&display($newfilename).'') + .&mt('Make new directory [_1]?', + &display($newfilename)) .'

' ); &CloseForm1($request, $fn); @@ -776,15 +779,15 @@ sub Decompress1 { if( -e $fn) { $request->print(''); $request->print('

' - .&mt('Decompress [_1]?' - ,''.&display($fn).'') + .&mt('Decompress [_1]?', + &display($fn)) .'

' ); &CloseForm1($request, $fn); } else { $request->print('

' - .&mt('No such file: [_1]' - ,''.&display($fn).'') + .&mt('No such file: [_1]', + &display($fn)) .'

' ); } @@ -855,7 +858,8 @@ sub NewFile1 { $extension = $1; } - my @okexts = qw(xml html xhtml htm xhtm problem page sequence rights sty library js css txt); + my @okexts = qw(xml html xhtml htm xhtm problem page sequence rights sty task library js css txt); + if (($extension eq '') || (!grep(/^\Q$extension\E/,@okexts))) { my $validexts = '.'.join(', .',@okexts); $request->print('

'. @@ -1070,8 +1074,8 @@ sub Rename2 { } } else { $request->print('

' - .&mt('No such file: [_1]' - ,''.&display($oldfile).'') + .&mt('No such file: [_1]', + &display($oldfile)) .'

' ); return 0; @@ -1446,26 +1450,10 @@ function writeDone() { $loaditem{'onload'} = "writeDone()"; } - # Breadcrumbs - &Apache::lonhtmlcommon::clear_breadcrumbs(); - &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', - 'href' => '', # FIXME Add link to /priv/[user] - }); - &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'File Operation', - 'title' => 'Construction Space File Operation', - 'href' => '', - }); - $r->print(&Apache::loncommon::start_page('Construction Space File Operation', $js, - {'add_entries' => \%loaditem,}) - .&Apache::lonhtmlcommon::breadcrumbs() - .&Apache::loncommon::head_subbox( - &Apache::loncommon::CSTR_pageheader()) - ); - + {'add_entries' => \%loaditem,})); + $r->print('

'.&mt('Location').': '.&display($fn).'

'); if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {