--- loncom/interface/portfolio.pm 2006/10/19 00:23:21 1.164 +++ loncom/interface/portfolio.pm 2006/11/01 02:03:16 1.167 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.164 2006/10/19 00:23:21 raeburn Exp $ +# $Id: portfolio.pm,v 1.167 2006/11/01 02:03:16 rezaferry Exp $ # # Copyright Michigan State University Board of Trustees # @@ -95,6 +95,13 @@ sub display_common { 'createdir_label' => 'Create subdirectory in current directory:'); my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); + my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles'); + my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); + + # TO BE DEPRECATED: This line should be deleted once Portfolio uses breadcrumbs + $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); + # END LINE TO BE DEPRECATED + $r->print(<<"TABLE"); @@ -109,7 +116,7 @@ sub display_common { - + $help_fileupload @@ -124,7 +131,7 @@ sub display_common { - + $help_createdir @@ -155,6 +162,7 @@ TABLE } } $r->print(''); + $r->print(&Apache::loncommon::help_open_topic('Portfolio ChangeDirectory')); &Apache::lonhtmlcommon::store_recent($namespace,$current_path,$current_path); $r->print('
'. @@ -259,8 +267,13 @@ sub display_directory { ''); } else { $r->print(''); + $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', 'Using the portfolio file list')); $r->print('
Select  NameSizeLast Modified
'. - ''); + ''); } $r->print("\n".&group_form_data()."\n"); @@ -436,7 +449,8 @@ sub display_directory { $r->print('
Actions  NameSizeLast ModifiedCurrent Access Status
Actions  Name'. + &Apache::loncommon::help_open_topic('Portfolio OpenFile'). + 'SizeLast ModifiedCurrent Access Status'. + &Apache::loncommon::help_open_topic('Portfolio ShareFile'). + '
'); if ($can_delete) { $r->print(' - + '. + &Apache::loncommon::help_open_topic('Portfolio DeleteFile').' ' @@ -550,9 +564,10 @@ 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(''. + &mt('An error occured ([_1]) while trying to delete + [_2].',$result,&display_file(undef, $delete_file)). + '

'); } else { $r->print(&mt('File: [_1] deleted.', &display_file(undef,$delete_file))); @@ -563,7 +578,7 @@ sub delete_confirmed { $group,$file_name); if (keys(%access_controls) > 0) { my %changes; - foreach my $key (%{$access_controls{$file_name}}) { + foreach my $key (keys(%{$access_controls{$file_name}})) { $changes{'delete'}{$key} = 1; } if (keys(%changes) > 0) { @@ -571,17 +586,17 @@ sub delete_confirmed { &Apache::lonnet::modify_access_controls($file_name,\%changes, $udom,$uname); if ($outcome ne 'ok') { - $r->print(&mt('
'."An error occured ($outcome) while ". - "trying to delete access controls for the file."). - '
'); + $r->print('
'.&mt("An error occured ([_1]) while ". + "trying to delete access controls for the file.",$outcome). + '

'); } else { if ($deloutcome eq 'ok') { - $r->print(&mt('
Access controls also deleted for the file.')); + $r->print('
'.&mt('Access controls also deleted for the file.').'

'); } else { - $r->print(''. - &mt('
'."An error occured ($deloutcome) while ". - "trying to delete access controls for the file."). - '

'); + $r->print(''.'
'. + &mt("An error occured ([_1]) while ". + "trying to delete access controls for the file.",$deloutcome). + '


'); } } } @@ -685,39 +700,40 @@ sub access_for_renamed { my $newfile = $env{'form.currentpath'}.$filenewname; $newfile = &prepend_group($newfile); my $current_permissions = - &Apache::lonnet::get_portfile_permissions($udom,$uname); + &Apache::lonnet::get_portfile_permissions($udom,$uname); my %access_controls = - &Apache::lonnet::get_access_controls($current_permissions, - $group,$oldfile); + &Apache::lonnet::get_access_controls($current_permissions, + $group,$oldfile); my $chg_text; if (keys(%access_controls) > 0) { my %change_old; my %change_new; - foreach my $key (%{$access_controls{$oldfile}}) { + foreach my $key (keys(%{$access_controls{$oldfile}})) { $change_old{'delete'}{$key} = 1; $change_new{'activate'}{$key} = $access_controls{$oldfile}{$key}; } my ($outcome,$deloutcome,$new_values,$translation) = &Apache::lonnet::modify_access_controls($oldfile,\%change_old, - $udom,$uname); + $udom,$uname); if ($outcome ne 'ok') { - $chg_text = &mt('

'."An error occured ($outcome) while ". - "trying to delete access control records for the old name."). + $chg_text ='

'.&mt("An error occured ([_1]) while ". + "trying to delete access control records for the old name.",$outcome). '
'; } else { if ($deloutcome ne 'ok') { - $chg_text = '

'. - &mt('
'."An error occured ($deloutcome) while ". - "trying to delete access control records for the old name."). - '

'; + $chg_text = '


'. + &mt("An error occured ([_1]) while ". + "trying to delete access control records for the old name.",$deloutcome). + '

'; } } ($outcome,$deloutcome,$new_values,$translation) = &Apache::lonnet::modify_access_controls($newfile,\%change_new, $udom,$uname); if ($outcome ne 'ok') { - $chg_text .= &mt('

'."An error occured ($outcome) while ". - "trying to update access control records for the new name."). + $chg_text .= '

'. + &mt("An error occured ([_1]) while ". + "trying to update access control records for the new name.",$outcome). '
'; } if ($chg_text eq '') { @@ -746,10 +762,12 @@ sub display_access { if ($group eq '') { $info .= (&mt("A listing of files viewable without log-in is available at: http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio.
For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:
http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme
")); } - if ($can_setacl) { &open_form($r,$url); $r->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')); &access_setting_table($r,$access_controls{$file_name}); my $button_text = { 'continue' => &mt('Proceed'),