--- loncom/interface/portfolio.pm 2007/06/11 21:29:44 1.184 +++ loncom/interface/portfolio.pm 2008/01/21 11:36:07 1.187 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.184 2007/06/11 21:29:44 albertel Exp $ +# $Id: portfolio.pm,v 1.187 2008/01/21 11:36:07 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -99,7 +99,7 @@ sub display_common { my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); # FIXME: This line should be deleted once Portfolio uses breadcrumbs - $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); + $r->print(&Apache::loncommon::help_open_topic('Portfolio About', &mt('Help on the portfolio'))); $r->print(<<"TABLE"); @@ -267,15 +267,16 @@ sub display_directory { } else { $r->print(''); $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', - 'Using the portfolio file list')); + &mt('Using the portfolio file list'))); $r->print('
'. - ''); + '' + .'' + .'' + .'' + .'' + .'' + .'' + .''); } $r->print("\n".&group_form_data()."\n"); @@ -289,8 +290,6 @@ sub display_directory { my ($bfile)=split('&',$b,2); return (lc($afile) cmp lc($bfile)); } (@$dir_list)) { - #$strip holds directory/file name - #$dom my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$dir_line,16); $filename =~ s/\s+$//; my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); @@ -451,7 +450,7 @@ sub display_directory { $r->print('
Actions'. - &Apache::loncommon::help_open_topic('Portfolio FileAction'). - '  Name'. - &Apache::loncommon::help_open_topic('Portfolio OpenFile'). - 'SizeLast ModifiedCurrent Access Status'. - &Apache::loncommon::help_open_topic('Portfolio ShareFile'). - '
'.&mt('Actions'). &Apache::loncommon::help_open_topic('Portfolio FileAction').'  '.&mt('Name').&Apache::loncommon::help_open_topic('Portfolio OpenFile').''.&mt('Size').''.&mt('Last Modified').''.&mt('Current Access Status').&Apache::loncommon::help_open_topic('Portfolio ShareFile').'
'); if ($can_delete) { $r->print(' - '. + '. &Apache::loncommon::help_open_topic('Portfolio DeleteFile').' @@ -566,10 +565,10 @@ sub delete_confirmed { $env{'form.currentpath'}. $delete_file); if ($result ne 'ok') { - $r->print(''. - &mt('An error occurred ([_1]) while trying to delete - [_2].',$result,&display_file(undef, $delete_file)). - '

'); + $r->print('' + .&mt('An error occurred ([_1]) while trying to delete [_2].' + ,$result,&display_file(undef, $delete_file)) + .'

'); } else { $r->print(&mt('File: [_1] deleted.', &display_file(undef,$delete_file))); @@ -630,11 +629,8 @@ sub delete_dir_confirmed { ') while trying to delete '.$directory_name.'
'); } else { # now remove from recent -# $r->print('
removing '.$directory_name.'
print($header.$info); - $r->print('
'.&Apache::loncommon::help_open_topic('Portfolio ShareFile SetAccess', 'Help on setting up share access')); - $r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile ChangeSetting', 'Help on changing settings')); - $r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile StopAccess', 'Help on removing share access')); + $r->print('
'.&Apache::loncommon::help_open_topic('Portfolio ShareFile SetAccess', &mt('Help on setting up share access'))); + $r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile ChangeSetting', &mt('Help on changing settings'))); + $r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile StopAccess', &mt('Help on removing share access'))); &access_setting_table($r,$url,$file_name,$access_controls{$file_name}, $action); my $button_text = { 'continue' => &mt('Proceed'), - 'cancel' => &mt('Back to directory listing'), + 'cancel' => &mt('Back to Directory'), }; &close_form($r,$url,$button_text); } else { @@ -1203,7 +1199,7 @@ sub access_setting_table { sub standard_settings { my ($r,$now,$then,$url,$filename,$acl_count,$start,$end,$public,$publicnum, $publictext,$guest,$guestnum,$guesttext,$access_controls,%conditionals)=@_; - $r->print('

'.&mt('Public access: [_1]',$publictext).'

'); + $r->print('

'.&mt('Public access: [_1]',&mt($publictext)).'

'); $r->print(&Apache::loncommon::start_data_table()); $r->print(&Apache::loncommon::start_data_table_header_row()); $r->print(''.&mt('Action').''.&mt('Dates available').''); @@ -1219,7 +1215,7 @@ sub standard_settings { $r->print(&Apache::loncommon::end_data_table_row()); $r->print(&Apache::loncommon::end_data_table()); $r->print(' '); - $r->print('

'.&mt('Passphrase-protected access: [_1]',$guesttext).'

'); + $r->print('

'.&mt('Passphrase-protected access: [_1]',&mt($guesttext)).'

'); $r->print(&Apache::loncommon::start_data_table()); $r->print(&Apache::loncommon::start_data_table_header_row()); $r->print(''.&mt('Action').''.&mt('Dates available'). @@ -1265,7 +1261,7 @@ sub standard_settings { 'action' => 'chgconditions', 'currentpath' => $env{'form.currentpath'}, ); - $r->print('

'.&mt('Conditional access: [_1]',$conditionstext).'

'); + $r->print('

'.&mt('Conditional access: [_1]',&mt($conditionstext)).'

'); if ($numconditionals > 0) { my $count = 1; my $chg = 'none'; @@ -1370,8 +1366,8 @@ sub display_access_row { } $r->print(&Apache::loncommon::end_data_table()); } else { - $r->print(&mt('No [_1]-based conditions defined.
',$type). - &additional_item($type)); + $r->print(&mt('No [_1]-based conditions defined.',$type).'
' + .&additional_item($type)); } return; } @@ -1733,17 +1729,18 @@ ENDSMP fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; } } - opener.document.forms.lonhomework.$env{'form.fieldname'}.value=fileList; + var hwfield = opener.document.getElementsByName('$env{'form.fieldname'}'); + hwfield[0].value = fileList; self.close(); } ENDSMP $r->print($javascript); - $r->print("

Select portfolio files

- Check as many as you wish in response to the problem.
"); + $r->print("

".&mt('Select portfolio files')."

". + &mt('Check as many as you wish in response to the problem.')."
"); my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'}); if (@otherfiles) { - $r->print("Files selected from other directories:
"); + $r->print("".&mt('Files selected from other directories:')."
"); foreach my $file (@otherfiles) { $r->print($file."
"); } @@ -1777,17 +1774,23 @@ sub check_for_upload { my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root); if (($current_disk_usage + $filesize) > $disk_quota){ - my $msg = '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.'; + my $msg = ''. + &mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.',''.$fname.'',$filesize).''. + '
'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage); return ('will_exceed_quota',$msg); } elsif ($found_file) { if ($locked_file) { - my $msg = ''.'Unable to upload '.$fname.', a locked file by that name was found in '.$port_path.$path.''. - '
You will be able to rename or delete existing '.$fname.' after a grade has been assigned.'; + my $msg = ''; + $msg .= &mt('Unable to upload [_1] a locked file by that name was found in [_2].',''.$fname.'',''.$port_path.$env{'form.currentpath'}.''); + $msg .= '
'; + $msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.',''.$fname.''); return ('file_locked',$msg); } else { - my $msg = ''.'Unable to upload '.$fname.', a file by that name was found in '.$port_path.$path.''. - '
To upload, rename or delete existing '.$fname.' in '.$port_path.$path; + my $msg = ''; + $msg .= &mt('Unable to upload [_1]. A file by that name was found in [_2].',''.$fname.'',$port_path.$env{'form.currentpath'}); + $msg .= ''; + $msg .= '
'; + $msg .= &mt('To upload, rename or delete existing [_1] in [_2].',''.$fname.'', $port_path.$env{'form.currentpath'}); return ('file_exists',$msg); } } @@ -1928,7 +1931,7 @@ sub lock_info { } } } - $r->print(&done('Back',$url)); + $r->print(&done(&mt('Back'),$url)); return 'ok'; } @@ -1952,8 +1955,8 @@ 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(''.&mt('Unable to create a directory named').' '.$newdir. + '. '.&mt('A file or directory by that name already exists.').'
'); } else { my ($uname,$udom) = &get_name_dom(); my $port_path = &get_port_path(); @@ -1965,7 +1968,7 @@ sub createdir { } } if ($newdir ne $env{'form.newdir'}) { - $r->print("The new directory name was changed from:
".$env{'form.newdir'}." to $newdir "); + $r->print(&mt("The new directory name was changed from:")."
".$env{'form.newdir'}." ".&mt('to')." $newdir "); } $r->print(&done(undef,$url)); } @@ -2160,16 +2163,16 @@ sub handler { $env{'request.course.id'}.'/'.$group))) { $portfolio_root = &get_portfolio_root(); } else { - $r->print('You do not have the privileges required to access the shared files space for this group.'); + $r->print(&mt('You do not have the privileges required to access the shared files space for this group.')); $earlyout = 1; } } else { - $r->print('Not a valid group for this course'); + $r->print(&mt('Not a valid group for this course')); $earlyout = 1; } $title = &mt('Group files').' for '.$group; } else { - $r->print('Invalid group'); + $r->print(&mt('Invalid group')); $earlyout = 1; } if ($earlyout) { return OK; } @@ -2225,16 +2228,14 @@ sub handler { return OK; } 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(''); + $r->print(&mt('No file was selected to upload. ')); + $r->print(&mt('To upload a file, click Browse... select a file, then click Upload.')); + $r->print(''); } if ($env{'form.meta'}) { &open_form($r,$url); -# $r->print(&edit_meta_data($r, $env{'form.currentpath'}.$env{'form.selectfile'})); - $r->print('Edit the meta data
'); + $r->print(&mt('Edit the meta data').'
'); &close_form($r,$url); } if ($env{'form.store'}) {