');
$r->print(''.&mt('Roles').' | '.
&mt('Access').' | '.
&mt('Sections').' | ');
@@ -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(''.&mt('Allowed [_1] member affiliations',$type).
' | ');
$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(''.&additional_item($type).
@@ -1011,11 +1019,12 @@ function getIndex(name,value) {
}
sub course_row {
- my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;
- my %content;
+ my ($r,$status,$type,$item,$access_controls,$now,$then) = @_;
+ my $content;
my $defdom = $env{'user.domain'};
if ($status eq 'old') {
- $defdom = $$access_controls{$item}{'domain'};
+ $content = $$access_controls{$item};
+ $defdom = $content->{'domain'};
}
my $js = &Apache::loncommon::coursebrowser_javascript($defdom)
.&course_js();
@@ -1027,30 +1036,30 @@ sub course_row {
$type);
$r->print(' | '.$js.&actionbox($status,$num,$scope).' | ');
if ($status eq 'old') {
- my $cid = $content{'domain'}.'_'.$content{'number'};
+ my $cid = $content->{'domain'}.'_'.$content->{'number'};
my %course_description = &Apache::lonnet::coursedescription($cid);
- $r->print(''.$course_description{'description'}.' | ');
+ $r->print(''.$course_description{'description'}.' | ');
} elsif ($status eq 'new') {
my $uctype = $type;
$uctype =~ s/^(\w)/uc($1)/e;
$r->print(''.&Apache::loncommon::selectcourse_link('portform','crsnum_'.$num,'crsdom_'.$num,'description_'.$num,undef,undef,$uctype).' | ');
}
$r->print(''.&dateboxes($num,$start,$end).' | ');
- $r->print('');
+ $r->print('');
$r->print(''.&mt('Action').' | '.&mt('Roles').' | '.
&mt('Access').' | '.&mt('Sections').' | '.
&mt($crsgrptext).' | ');
if ($status eq 'old') {
my $max_id = 0;
- foreach my $role_id (sort(keys(%{$content{'roles'}}))) {
+ foreach my $role_id (sort(keys(%{$content->{'roles'}}))) {
if ($role_id > $max_id) {
$max_id = $role_id;
}
$max_id ++;
- my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display');
+ my $role_selects = &role_selectors($num,$role_id,$status,$type,$content,'display');
$r->print('
| '.$role_selects.' ');
}
- $r->print('
'.&mt('Add a roles-based condition').' | ');
+ $r->print('
'.&mt('Add a roles-based condition').' {'domain'}','$content->{'number'}','Course'".')" value="'.$max_id.'" /> | ');
} elsif ($status eq 'new') {
my $role_id = 1;
my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');
@@ -1338,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));
}
@@ -1356,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));
@@ -1400,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;
}
@@ -1416,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'}) {
@@ -1529,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 {
@@ -1563,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);