--- loncom/auth/lonroles.pm 2003/11/08 12:06:38 1.75 +++ loncom/auth/lonroles.pm 2003/12/08 14:25:15 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.75 2003/11/08 12:06:38 albertel Exp $ +# $Id: lonroles.pm,v 1.79 2003/12/08 14:25:15 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -202,7 +202,7 @@ ENDENTERKEY } # # Send the user to the course they selected - &redirect_user($r,'Entering Course', + &redirect_user($r,&mt('Entering Course'), $furl,$msg); return OK; } @@ -218,7 +218,7 @@ ENDENTERKEY $redirect_url .= $1; } $redirect_url .= '/'; - &redirect_user($r,'Entering Construction Space', + &redirect_user($r,&mt('Entering Construction Space'), $redirect_url); return OK; } @@ -238,7 +238,7 @@ ENDENTERKEY my $swinfo=&Apache::lonmenu::rawconfig(); my $bodytag=&Apache::loncommon::bodytag('User Roles'); my $helptag=&Apache::loncommon::help_open_topic - ("General_Intro","Click here for help"); + ("General_Intro",&mt("Click here for help")); $r->print(< @@ -412,7 +412,7 @@ ENDHEADER } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; - $ttype=&mt('Construction Space'); + $ttype='Construction Space'; $twhere=&mt('User').': '.$trest.'
'.&mt('Domain'). ': '.$tdom.'
'. ' '.&mt('Server').': '.$home; @@ -432,20 +432,20 @@ ENDHEADER } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; - $ttype=&mt('Construction Space'); + $ttype='Construction Space'; $twhere=&mt('Domain').': '.$tdom.'
'.&mt('Server'). ': '.$home; $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca'; $sortkey=$role; } elsif ($trest) { - $ttype=&mt('Course'); + $ttype='Course'; if ($tsection) { $ttype.='
'.&mt('Section/Group').': '.$tsection; } my $tcourseid=$tdom.'_'.$trest; if ($ENV{'course.'.$tcourseid.'.description'}) { $twhere=$ENV{'course.'.$tcourseid.'.description'}; - $sortkey=$twhere."\0".$envkey; + $sortkey=$tdom."\0".$twhere."\0".$envkey; unless ($twhere eq &mt('Currently not available')) { $twhere.=' '. &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). @@ -455,7 +455,8 @@ ENDHEADER my %newhash=Apache::lonnet::coursedescription ($tcourseid); if (%newhash) { - $sortkey=$newhash{'description'}."\0".$envkey; + $sortkey=$tdom."\0".$newhash{'description'}. + "\0".$envkey; $twhere=$newhash{'description'}. ' '. &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). @@ -463,16 +464,16 @@ ENDHEADER } else { $twhere=&mt('Currently not available'); $ENV{'course.'.$tcourseid.'.description'}=$twhere; - $sortkey=$twhere."\0".$envkey; + $sortkey=$tdom."\0".$twhere."\0".$envkey; } } if ($role ne 'st') { $twhere.="
".&mt('Domain').":".$tdom; } } elsif ($tdom) { - $ttype=&mt('Domain'); + $ttype='Domain'; $twhere=$tdom; $sortkey=$role.$twhere; } else { - $ttype=&mt('System'); + $ttype='System'; $twhere=&mt('system wide'); $sortkey=$role.$twhere; } @@ -519,12 +520,30 @@ ENDHEADER } } } + my $doheaders=-1; foreach my $type ('Construction Space','Course','Domain','System') { + my $haverole=0; foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { - $r->print($roletext{$sortrole{$which}}); + $haverole=1; } } + if ($haverole) { $doheaders++; } + } + foreach my $type ('Construction Space','Course','Domain','System') { + my $output; + foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { + if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { + $output.=&mt($roletext{$sortrole{$which}}); + } + } + if ($output) { + if ($doheaders > 0) { + $r->print("". + "".&mt($type).""); + } + $r->print($output); + } } my $tremark=''; my $tfont='#003300';