--- loncom/interface/portfolio.pm 2006/06/22 18:33:58 1.115 +++ loncom/interface/portfolio.pm 2006/06/22 20:09:51 1.119 @@ -99,7 +99,7 @@ sub display_common { TABLE my @tree = split (/\//,$current_path); - $r->print(''.&make_anchor($url,$port_path,'/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"},$group).'/'); + $r->print(''.&make_anchor($url,$port_path,'/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"},$group).'/'); if (@tree > 1){ my $newCurrentPath = ''; for (my $i = 1; $i< @tree; $i++){ @@ -107,7 +107,7 @@ TABLE $r->print(&make_anchor($url,$tree[$i],'/'.$newCurrentPath, $env{"form.mode"},$env{"form.fieldname"}, $env{"form.continue"},$group).'/'); } } - $r->print(''); + $r->print(''); &Apache::lonhtmlcommon::store_recent($namespace,$current_path,$current_path); $r->print('
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)); } @@ -502,8 +513,6 @@ sub display_access { sub update_access { my ($r,$url,$group) = @_; - my $function = &Apache::loncommon::get_users_function(); - my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); my $totalprocessed = 0; my %processing; my %title = ( @@ -557,7 +566,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; } } @@ -601,8 +612,7 @@ sub update_access { if ($scope eq 'guest') { $r->print(&mt('Password').': '.$content->{'password'}); } elsif ($scope eq 'course' || $scope eq 'group') { - $r->print('
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.' -
'); + $r->print('
'); $r->print(''); @@ -659,7 +669,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) { @@ -922,7 +934,6 @@ sub display_access_row { my ($r,$status,$type,$items,$access_controls,$now,$then) = @_; if (@{$items} > 0) { my @all_doms; - my $tablecolor; my $colspan = 3; my $uctype = $type; $uctype =~ s/^(\w)/uc($1)/e; @@ -934,25 +945,22 @@ sub display_access_row { $r->print(''); $colspan ++; - my $function = &Apache::loncommon::get_users_function(); - $tablecolor=&Apache::loncommon::designparm($function.'.tabbg'); } elsif ($type eq 'domains') { @all_doms = &Apache::loncommon::get_domains(); } $r->print(&Apache::loncommon::end_data_table_header_row()); - $r->print(&Apache::loncommon::start_data_table_row()); foreach my $key (@{$items}) { + $r->print(&Apache::loncommon::start_data_table_row()); if (($type eq 'course') || ($type eq 'group')) { - &course_row($r,$status,$type,$key,$access_controls, - $tablecolor,$now,$then); + &course_row($r,$status,$type,$key,$access_controls,$now,$then); } elsif ($type eq 'domains') { &domains_row($r,$status,$key,\@all_doms,$access_controls,$now, $then); } elsif ($type eq 'users') { &users_row($r,$status,$key,$access_controls,$now,$then); } + $r->print(&Apache::loncommon::end_data_table_row()); } - $r->print(&Apache::loncommon::end_data_table_row()); if ($status eq 'old') { $r->print(&Apache::loncommon::start_data_table_row()); $r->print(''); } $r->print(''); - $r->print('
'.&mt('Roles').''. &mt('Access').''. &mt('Sections').''.&mt('Allowed [_1] member affiliations',$type). ''.&additional_item($type). @@ -1011,7 +1019,7 @@ function getIndex(name,value) { } sub course_row { - my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; + my ($r,$status,$type,$item,$access_controls,$now,$then) = @_; my $content; my $defdom = $env{'user.domain'}; if ($status eq 'old') { @@ -1037,7 +1045,7 @@ sub course_row { $r->print(''.&Apache::loncommon::selectcourse_link('portform','crsnum_'.$num,'crsdom_'.$num,'description_'.$num,undef,undef,$uctype).'  '.&dateboxes($num,$start,$end).''); + $r->print('
'); $r->print(''); @@ -1339,17 +1347,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 +1365,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 +1409,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 +1425,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 +1538,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 +1572,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);
'.&mt('Action').''.&mt('Roles').''. &mt('Access').''.&mt('Sections').''. &mt($crsgrptext).'