--- loncom/auth/lonroles.pm 2003/09/15 21:50:49 1.69
+++ loncom/auth/lonroles.pm 2004/02/10 19:23:11 1.80.4.1
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.69 2003/09/15 21:50:49 albertel Exp $
+# $Id: lonroles.pm,v 1.80.4.1 2004/02/10 19:23:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,11 +51,12 @@ use Apache::File();
use Apache::lonmenu;
use Apache::loncommon;
use Apache::lonannounce;
+use Apache::lonlocal;
sub redirect_user {
my ($r,$title,$url,$msg) = @_;
$msg = $title if (! defined($msg));
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
my $swinfo=&Apache::lonmenu::rawconfig();
@@ -130,7 +131,7 @@ sub handler {
# student attempts to register a new key
} else {
# print form to enter a new key
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
my $swinfo=&Apache::lonmenu::rawconfig();
@@ -164,7 +165,7 @@ ENDENTERKEY
'request.role.adv' => $tadv,
'request.role.domain' => $cdom,
'request.course.sec' => $csec);
- my $msg='Entering course ...';
+ my $msg=&mt('Entering course ...');
if (($cnum) && ($role ne 'ca')) {
my ($furl,$ferr)=
@@ -172,7 +173,7 @@ ENDENTERKEY
if (($ENV{'form.orgurl'}) &&
($ENV{'form.orgurl'}!~/^\/adm\/flip/)) {
my $dest=$ENV{'form.orgurl'};
- if ( $Apache::lonnet::perlvar{'MODPERL2'} ) {
+ if ( &Apache::lonnet::mod_perl_version() == 2 ) {
&Apache::lonnet::cleanenv();
}
$r->internal_redirect($dest);
@@ -183,7 +184,9 @@ ENDENTERKEY
"request.course.id" => $cdom.'_'.$cnum);
$furl='/adm/roles?tryagain=1';
$msg=
- '
Could not initialize course at this time.
Please try again.
'.$ferr;
+ ''.
+ &mt('Could not initialize course at this time.').
+ '
'.&mt('Please try again.').'
'.$ferr;
}
# Check to see if the user is a CC entering a course
@@ -199,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;
}
@@ -215,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;
}
@@ -227,7 +230,7 @@ ENDENTERKEY
# =============================================================== No Roles Init
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
return OK if $r->header_only;
@@ -235,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(<
@@ -274,34 +277,35 @@ ENDHEADER
} else {
if ($ENV{'user.error.msg'}) {
$r->print(
- 'You need to choose another user role or '.
- 'enter a specific course for this function
');
+ ''.
+ &mt('You need to choose another user role or enter a specific course for this function').'
');
}
}
# -------------------------------------------------------- Choice or no choice?
if ($nochoose) {
if ($advanced) {
- $r->print("Assigned User Roles
\n");
+ $r->print("".&mt('Assigned User Roles')."
\n");
} else {
- $r->print("Sorry ...
\nThis resource might be part of");
+ $r->print("".&mt('Sorry ...')."
\n".
+ &mt('This resource might be part of'));
if ($ENV{'request.course.id'}) {
- $r->print(' another');
+ $r->print(&mt(' another'));
} else {
- $r->print(' a certain');
+ $r->print(&mt(' a certain'));
}
- $r->print(' course.