--- loncom/interface/portfolio.pm 2006/06/22 18:33:58 1.115 +++ loncom/interface/portfolio.pm 2006/06/22 19:01:30 1.116 @@ -155,11 +155,11 @@ sub display_directory { } if ($select_mode eq 'true') { $r->print('
'); - $r->print(''. + $r->print('
'. ''); } else { $r->print(''); - $r->print('
Select NameSizeLast Modified
'. + $r->print('
'. ''); } if (defined($group)) { @@ -190,16 +190,17 @@ sub display_directory { my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { if ($dirptr&$testdir) { + my $colspan='colspan="2"'; if ($select_mode eq 'true'){ - $r->print(''); - } else { - $r->print(''); + undef($colspan); } + $r->print(''); $r->print(''); $r->print(''); $r->print(''); } else { - $r->print(''); + my $css_class = 'LC_browser_file'; + my $line; my $version_flag; if (exists($versioned{$fname})) { $version_flag = "*"; @@ -209,22 +210,25 @@ sub display_directory { my $fullpath = $current_path.$filename; $fullpath = &prepend_group($fullpath,$group); if ($select_mode eq 'true'){ - $r->print(''); + $line.=' />'; } else { if (exists $locked_files{$fullpath}) { - $r->print(''); + $line.=''; + $css_class= 'LC_browser_file_locked'; } else { my $cat=''.&mt('Catalog Information').
 			    ''; - $r->print(''); + '; } + $r->print(''); + $r->print($line); } my $curr_access; my $pub_access = 0; @@ -332,16 +336,20 @@ sub close_form { sub display_file { my ($path,$filename)=@_; my $display_file_text; + my $file_start=''; + my $file_end=''; if (!defined($path)) { $path=$env{'form.currentpath'}; } if (!defined($filename)) { $filename=$env{'form.selectfile'}; - $display_file_text = ''.$path.$filename.''; + $display_file_text = $file_start.$path.$filename.$file_end; } elsif (ref($filename) eq "ARRAY") { - foreach (@$filename) { - $display_file_text .= ''.$path.$_.'
'; + foreach my $file (@$filename) { + $display_file_text .= $file_start.$path.$file.$file_end.'
'; } } elsif (ref($filename) eq "SCALAR") { - $display_file_text = ''.$path.$filename.''; + $display_file_text = $file_start.$path.$$filename.$file_end; + } else { + $display_file_text = $file_start.$path.$filename.$file_end; } return $display_file_text; } @@ -395,8 +403,8 @@ sub delete_confirmed { $env{'form.currentpath'}. $delete_file); if ($result ne 'ok') { - $r->print(' An error occured ('.$result. - ') while trying to delete '.&display_file(undef, $delete_file).'
'); + $r->print(' An error occured ('.$result. + ') while trying to delete '.&display_file(undef, $delete_file).'
'); } } $r->print(&done(undef,$url,$group)); @@ -420,8 +428,8 @@ sub delete_dir_confirmed { $directory_name); if ($result ne 'ok') { - $r->print(' An error occured (dir) ('.$result. - ') while trying to delete '.$directory_name.'
'); + $r->print(' An error occured (dir) ('.$result. + ') while trying to delete '.$directory_name.'
'); } else { # now remove from recent # $r->print('
removing '.$directory_name.'
print(''. + $r->print(''. &mt("Error: no valid filename was provided to rename to."). - '
'); + '
'); $r->print(&done(undef,$url,$group)); return; } @@ -471,12 +479,15 @@ sub rename_confirmed { $port_path.$env{'form.currentpath'}.$env{'form.selectfile'}, $port_path.$env{'form.currentpath'}.$filenewname); if ($result ne 'ok') { - $r->print(' An errror occured ('.$result. - ') while trying to rename '.&display_file().' to '. - &display_file(undef,$filenewname).'
'); + $r->print(''. + &mt('An errror occured ([_1]) while trying to rename [_2]' + .' to [_3]',$result,&display_file(), + &display_file('',$filenewname)).'
'); } if ($filenewname ne $env{'form.filenewname'}) { - $r->print("The new file name was changed from:
".$env{'form.filenewname'}." to $filenewname "); + $r->print(&mt("The new file name was changed from:
[_1] to [_2]", + ''.&display_file('',$env{'form.filenewname'}).'', + ''.&display_file('',$filenewname).'')); } $r->print(&done(undef,$url,$group)); } @@ -557,7 +568,9 @@ sub update_access { if (@{$processing{$chg}} > 0) { if ($chg eq 'delete') { if (!($deloutcome eq 'ok')) { - $errors .= &mt('A problem occurred deleting access controls: [_1]',$deloutcome); + $errors .=''. + &mt('A problem occurred deleting access controls: [_1]',$deloutcome). + ''; next; } } @@ -659,7 +672,9 @@ sub update_access { $r->print(&Apache::loncommon::end_data_table()); } else { if ((@{$processing{'activate'}} > 0) || (@{$processing{'update'}} > 0)) { - $errors .= &mt('A problem occurred storing access control settings: [_1]',$outcome); + $errors .= ''. + &mt('A problem occurred storing access control settings: [_1]',$outcome). + ''; } } if ($errors) { @@ -1339,17 +1354,17 @@ sub upload { } my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root); if (($current_disk_usage + $filesize) > $disk_quota){ - $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes). Disk quota will be exceeded.'. + $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes). Disk quota will be exceeded.'. '
Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.'); $r->print(&done('Back',$url,$group)); } elsif ($found_file){ if ($locked_file){ - $r->print('Unable to upload '.$fname.', a locked file by that name was found in '.$port_path.$env{'form.currentpath'}.''. + $r->print(''.'Unable to upload '.$fname.', a locked file by that name was found in '.$port_path.$env{'form.currentpath'}.''. '
You will be able to rename or delete existing '.$fname.' after a grade has been assigned.'); $r->print(&done('Back',$url,$group)); } else { - $r->print('Unable to upload '.$fname.', a file by that name was found in '.$port_path.$env{'form.currentpath'}.''. + $r->print(''.'Unable to upload '.$fname.', a file by that name was found in '.$port_path.$env{'form.currentpath'}.''. '
To upload, rename or delete existing '.$fname.' in '.$port_path.$env{'form.currentpath'}); $r->print(&done('Back',$url,$group)); } @@ -1357,8 +1372,8 @@ sub upload { my $result=&Apache::lonnet::userfileupload('uploaddoc','', $port_path.$env{'form.currentpath'}); if ($result !~ m|^/uploaded/|) { - $r->print(' An errror occured ('.$result. - ') while trying to upload '.&display_file().'
'); + $r->print(''.'An errror occured ('.$result. + ') while trying to upload '.&display_file().'
'); $r->print(&done('Back',$url,$group)); } else { $r->print(&done(undef,$url,$group)); @@ -1401,9 +1416,9 @@ sub createdir { my ($r,$url,$group)=@_; my $newdir=&Apache::lonnet::clean_filename($env{'form.newdir'}); if ($newdir eq '') { - $r->print(''. + $r->print(''. &mt("Error: no directory name was provided."). - '
'); + '
'); $r->print(&done(undef,$url,$group)); return; } @@ -1417,16 +1432,16 @@ sub createdir { } } if ($found_file){ - $r->print(' Unable to create a directory named '.$newdir. - ' a file or directory by that name already exists.
'); + $r->print(''.'Unable to create a directory named '.$newdir. + ' a file or directory by that name already exists.
'); } else { my ($uname,$udom) = &get_name_dom($group); my $port_path = &get_port_path($group); my $result=&Apache::lonnet::mkdiruserfile($uname,$udom, $port_path.$env{'form.currentpath'}.$newdir); if ($result ne 'ok') { - $r->print(' An errror occured ('.$result. - ') while trying to create a new directory '.&display_file().'
'); + $r->print(''.'An errror occured ('.$result. + ') while trying to create a new directory '.&display_file().'
'); } } if ($newdir ne $env{'form.newdir'}) { @@ -1530,7 +1545,7 @@ sub handler { $env{'request.course.id'}.'/'.$group))) { $portfolio_root = &get_portfolio_root($group); } else { - $r->print('You do not have the privileges required to access the shared files space for this group'); + $r->print('You do not have the privileges required to access the shared files space for this group.'); $earlyout = 1; } } else { @@ -1564,9 +1579,11 @@ sub handler { } $r->rflush(); if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ - $r->print(' No file was selected to upload.'. - 'To upload a file, click Browse...'. - ', select a file, then click Upload,'); + $r->print(''. + 'No file was selected to upload.'. + 'To upload a file, click Browse...'. + ', select a file, then click Upload.'. + ''); } if ($env{'form.meta'}) { &open_form($r,$url);
Actions NameSizeLast ModifiedCurrent Access Status
'.&mt('open folder').'
'.&mt('closed folder').'
'.&mt('closed folder').'Go to ...'.&make_anchor($url,$filename.'/',$current_path.$filename.'/',$env{'form.mode'},$env{"form.fieldname"},$env{'form.continue'},$group).'
print("CHECKED"); + $line='print('>LockedLocked + $line.=' Rename '.$cat.' -