$msg
$end_page ENDREDIR return; @@ -85,9 +185,12 @@ sub error_page { $r->send_http_header; return OK if $r->header_only; $r->print(&Apache::loncommon::start_page('Problems during Course Initialization'). - ''. - ''.&mt('The following problems occurred:'). + ''. + '
'.&mt('The following problems occurred:'). $error. '
'
+ .&mt('This is LON-CAPA [_1]',$r->dir_config('lonVersion'))
+ .'
'
+ .''.&mt('Logout').' '
+ .''
+ .&mt('Course Catalog')
+ .'
'); } - $r->print(' | '.&mt('User Role').' | '.&mt('Extent'). - ' | '.&mt('Start').' | '.&mt('End').' | |
---|---|---|---|---|---|
". - &mt('Recent Roles')." | "); - $r->print($output); - $r->print("'); } + $r->print(' | '.&mt('User Role').' | ' + .''.&mt('Extent').' | ' + .''.&mt('Start').' | ' + .''.&mt('End').' | ' + .&Apache::loncommon::end_data_table_header_row() + ); + $doheaders=-1; + my @roletypes = &roletypes(); + foreach my $type (@roletypes) { + my $haverole=0; + foreach my $which (sort {uc($a) cmp uc($b)} (keys(%{$sortrole}))) { + if ($roleclass->{$sortrole->{$which}} =~ /^\Q$type\E/) { + $haverole=1; + } + } + if ($haverole) { $doheaders++; } + } } - foreach my $type ('Construction Space','Domain','Course','Unavailable','System') { - my $output; - foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { - if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { - $output.=$roletext{$sortrole{$which}}; - if ($sortrole{$which} =~ m-dc\./($match_domain)/-) { - if ($dcroles{$1}) { - $output .= &allcourses_row($1,''). - &allcoauthors_row($1,''); + return $doheaders; +} + +sub roletypes { + my @types = ('Domain','Construction Space','Course','Unavailable','System'); + return @types; +} + +sub print_rolerows { + my ($r,$doheaders,$roleclass,$sortrole,$dcroles,$roletext) = @_; + if ((ref($roleclass) eq 'HASH') && (ref($sortrole) eq 'HASH')) { + my @types = &roletypes(); + foreach my $type (@types) { + my $output; + foreach my $which (sort {uc($a) cmp uc($b)} (keys(%{$sortrole}))) { + if ($roleclass->{$sortrole->{$which}} =~ /^\Q$type\E/) { + if (ref($roletext) eq 'HASH') { + if (ref($roletext->{$sortrole->{$which}}) eq 'ARRAY') { + $output.= &Apache::loncommon::start_data_table_row(). + $roletext->{$sortrole->{$which}}->[0]. + &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::continue_data_table_row(). + $roletext->{$sortrole->{$which}}->[1]. + &Apache::loncommon::end_data_table_row(); + } + if ($sortrole->{$which} =~ m-dc\./($match_domain)/-) { + if (ref($dcroles) eq 'HASH') { + if ($dcroles->{$1}) { + $output .= &adhoc_roles_row($1,''); + } + } + } } } - } - } - if ($output) { - if ($doheaders > 0) { - $r->print("
".&mt($type)." | ' + .&mt($type) + .' | ' + .&Apache::loncommon::end_data_table_empty_row() + ); + } + $r->print($output); + } + } } - my $tremark=''; - my $tfont='#003300'; - if ($env{'request.role'} eq 'cm') { - $r->print('||||
'); - } else { - $r->print(' | '); - } - } - $r->print(' | '.&mt('No role specified'). - ' | '.$tremark. - ' |
This is LON-CAPA '.
- $r->dir_config('lonVersion').'
'.
- ''.&mt('Logout').'
' + .&mt('[_1]Ad hoc[_2] roles in domain [_3] --' + ,'','',$dcdom) + .' | ' + .'';
+ my $selectcclink = &courselink($dcdom,$rowtype);
my $ccrole = &Apache::lonnet::plaintext('cc');
- $output.= ''.
- &mt('[_1]: [_2] from domain [_3]',$ccrole,$selectlink,$dcdom).
- ' | |||
';
my $carole = &Apache::lonnet::plaintext('ca');
- my $inputlink='';
- my $gobutton='';
- $output.= ''.
- &mt('[_1]: [_2] in domain [_3] [_4]',$carole,$inputlink,$dcdom,$gobutton).
- ' | ||||
' + .' | '.&mt('[_1]: [_2]',$carole,$selectcalink).' | '
+ .'