[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 19 Oct 2006 20:36:14 -0000
albertel Thu Oct 19 16:36:14 2006 EDT
Modified files:
/loncom/interface portfolio.pm
Log:
- style
- correcting mt usage
- only cycle through the keys in the has
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.164 loncom/interface/portfolio.pm:1.165
--- loncom/interface/portfolio.pm:1.164 Wed Oct 18 20:23:21 2006
+++ loncom/interface/portfolio.pm Thu Oct 19 16:36:12 2006
@@ -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.165 2006/10/19 20:36:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -571,16 +571,16 @@
&Apache::lonnet::modify_access_controls($file_name,\%changes,
$udom,$uname);
if ($outcome ne 'ok') {
- $r->print(&mt('<br />'."An error occured ($outcome) while ".
- "trying to delete access controls for the file.").
+ $r->print('<br />'.&mt("An error occured ([_1]) while ".
+ "trying to delete access controls for the file.",$outcome).
'</span><br />');
} else {
if ($deloutcome eq 'ok') {
- $r->print(&mt('<br />Access controls also deleted for the file.'));
+ $r->print('<br />'.&mt('Access controls also deleted for the file.'));
} else {
- $r->print('<span class="LC_error">'.
- &mt('<br />'."An error occured ($deloutcome) while ".
- "trying to delete access controls for the file.").
+ $r->print('<span class="LC_error">'.'<br />'.
+ &mt("An error occured ([_1]) while ".
+ "trying to delete access controls for the file.",$deloutcome).
'</span><br />');
}
}
@@ -685,39 +685,40 @@
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('<br /><br />'."An error occured ($outcome) while ".
- "trying to delete access control records for the old name.").
+ $chg_text ='<br /><br />'.&mt("An error occured ([_1]) while ".
+ "trying to delete access control records for the old name.",$outcome).
'</span><br />';
} else {
if ($deloutcome ne 'ok') {
- $chg_text = '<br /><br /><span class="LC_error">'.
- &mt('<br />'."An error occured ($deloutcome) while ".
- "trying to delete access control records for the old name.").
- '</span><br />';
+ $chg_text = '<br /><br /><span class="LC_error"><br />'.
+ &mt("An error occured ([_1]) while ".
+ "trying to delete access control records for the old name.",$deloutcome).
+ '</span><br />';
}
}
($outcome,$deloutcome,$new_values,$translation) =
&Apache::lonnet::modify_access_controls($newfile,\%change_new,
$udom,$uname);
if ($outcome ne 'ok') {
- $chg_text .= &mt('<br /><br />'."An error occured ($outcome) while ".
- "trying to update access control records for the new name.").
+ $chg_text .= '<br /><br />'.
+ &mt("An error occured ([_1]) while ".
+ "trying to update access control records for the new name.",$outcome).
'</span><br />';
}
if ($chg_text eq '') {