[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 07 Jun 2006 20:52:16 -0000


albertel		Wed Jun  7 16:52:16 2006 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  - fixes to discussion group &mt()
  - switch to course_type accessor
  - switch to <span class="LC_error">
  
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.156 loncom/auth/lonroles.pm:1.157
--- loncom/auth/lonroles.pm:1.156	Wed Jun  7 16:07:09 2006
+++ loncom/auth/lonroles.pm	Wed Jun  7 16:52:16 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.156 2006/06/07 20:07:09 albertel Exp $
+# $Id: lonroles.pm,v 1.157 2006/06/07 20:52:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -266,18 +266,14 @@
 			} else {
                             my $type = 'Course/Group';
 			    if (!$env{'request.course.id'}) {
-                                if (defined($env{'course.'.
-                                            $env{'request.course.id'}.'.type'})) {
-                                    $type = $env{'course.'.
-                                                 $env{'request.course.id'}.'.type'};
-                                }
+				$type = &Apache::loncommon::course_type();
 				&Apache::lonnet::appenv(
 				      "request.course.id"  => $cdom.'_'.$cnum);
 				$furl='/adm/roles?tryagain=1';
 				$msg=
-				    '<h1><font color="red">'.
-			 &mt('Could not initialize [_1] at this time.',lc($type)).
-		    '</font></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr;
+				    '<h1><span class="LC_error">'.
+				    &mt('Could not initialize '.lc($type).' at this time.').
+				    '</span></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr;
 			    }
 			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
 			    &Apache::lonnet::appenv('request.role.adv'=>$tadv);
@@ -305,7 +301,7 @@
 					) {
 					my $startpage = &courseloadpage($courseid);
 					unless ($startpage eq 'firstres') {         
-					    $msg = &mt('Entering [_1] ....',lc($type));
+					    $msg = &mt('Entering '.lc($type).' ....');
 					    &redirect_user($r,&mt('New in course'),
 							   '/adm/whatsnew?refpage=start',$msg,
 							   $env{'environment.remotenavmap'});
@@ -318,8 +314,8 @@
 # Guess not ...
 				    $furl=&Apache::lonpageflip::first_accessible_resource();
 				}
-                                $msg = &mt('Entering [_1] ...',lc($type));
-				&redirect_user($r,&mt('Entering [_1]',$type),
+                                $msg = &mt('Entering '.lc($type).' ...');
+				&redirect_user($r,&mt('Entering '.$type),
 					       $furl,$msg,
 					       $env{'environment.remotenavmap'});
 			    }
@@ -424,8 +420,8 @@
     } else {
         if ($env{'user.error.msg'}) {
 	    $r->print(
- '<h3><font color="red">'.
- &mt('You need to choose another user role or enter a specific course for this function').'</font></h3>');
+ '<h3><span class="LC_error">'.
+ &mt('You need to choose another user role or enter a specific course for this function').'</span></h3>');
 	}
     }
 # -------------------------------------------------------- Choice or no choice?
@@ -745,10 +741,8 @@
 			$ttype='Construction Space';
 			$twhere='User: '.$trest.', Domain: '.$tdom;
 		    } else {
-			$ttype='Course';
-                        if (defined($env{'course.'.$tdom.'_'.$trest.'.type'})) {
-                            $ttype = $env{'course.'.$tdom.'_'.$trest.'.type'};
-                        }
+			$ttype= 
+			    &Apache::loncommon::course_type($tdom.'_'.$trest);
 			$twhere=$env{'course.'.$tdom.'_'.$trest.'.description'};
 			if ($tsec) {
 			    $twhere.=' (Section: '.$tsec.')';