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

raeburn raeburn@source.lon-capa.org
Wed, 06 Oct 2010 18:46:53 -0000


raeburn		Wed Oct  6 18:46:53 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/auth	lonroles.pm 
  Log:
  - Customization for GCI_3.
    - Substitute the term 'Concept Tests' for 'Roles' when appropriate.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240.2.17 loncom/auth/lonroles.pm:1.240.2.18
--- loncom/auth/lonroles.pm:1.240.2.17	Mon Oct  4 17:43:24 2010
+++ loncom/auth/lonroles.pm	Wed Oct  6 18:46:53 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.240.2.17 2010/10/04 17:43:24 raeburn Exp $
+# $Id: lonroles.pm,v 1.240.2.18 2010/10/06 18:46:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -592,6 +592,7 @@
     return OK if $r->header_only;
 
     my ($crumbtext,$pagetitle,$recent,$show_course);
+    $show_course=&Apache::loncommon::show_course();
     my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';
     if ($custommenu) {
         my $brcrum = {'bread_crumbs' => 1};
@@ -610,16 +611,25 @@
         $crumbtext = 'User Roles';
         $pagetitle = 'My Roles';
         $recent = &mt('Recent Roles');
-        $show_course=&Apache::loncommon::show_course();
+        my $standby=&mt('Role selected. Please stand by.');
         if ($show_course) {
             $crumbtext = 'Courses';
             $pagetitle = 'My Courses';
             $recent = &mt('Recent Courses');
+            $standby = &mt('Course selected. Please stand by.');
+        }
+        my $brcrum = [{ href    => '/adm/roles',
+                         text    => $crumbtext,},
+                     ];
+        my $args;
+        if (($env{'user.domain'} eq 'gcitest') && (!$numdc)) {
+            $args = {bread_crumbs        => $brcrum,
+                     bread_crumbs_nomenu => 1};
+        } else {
+            $args = {bread_crumbs => $brcrum};
         }
-        my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}];
+        my $start_page=&Apache::loncommon::start_page($pagetitle,undef,$args);
         my $swinfo=&Apache::lonmenu::rawconfig();
-        my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
-        my $standby=&mt('Role selected. Please stand by.');
         $standby=~s/\n/\\n/g;
         $r->print(<<ENDHEADER);
 $start_page
@@ -807,7 +817,15 @@
 	if ($inrole) {
 	    $r->print('<h2>'.&mt('Currently no additional roles, courses or communities').'</h2>');
 	} else {
-	    $r->print('<h2>'.&mt('Currently no active roles, courses or communities').'</h2>');
+            if ($show_course) {
+                if ($env{'user.domain'} eq 'gcitest') {
+                    $r->print('<h2>'.&mt('Currently no active Concept Tests').'</h2>');
+                } else { 
+                    $r->print('<h2>'.&mt('Currently no active courses or communities').'</h2>');
+                }
+            } else {
+	        $r->print('<h2>'.&mt('Currently no active roles, courses or communities').'</h2>');
+            }
 	}
         unless ($env{'user.domain'} eq 'gcitest') {
             &findcourse_advice($r);
@@ -815,7 +833,15 @@
         }
 	$r->print('</form>');
         if ($countfuture) {
-            $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
+            if ($show_course) {
+                if ($env{'user.domain'} eq 'gcitest') {
+                    $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture));
+                } else {
+                    $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture));
+                }
+            } else {
+                $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
+            }
             my $doheaders = &roletable_headers($r,\%roleclass,\%sortrole,
                                                $nochoose);
             &print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles,
@@ -864,7 +890,7 @@
         }
     }
 # ----------------------------------------------------------------------- Table
-    unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) {
+    unless ((!$show_course) || ($nochoose) || ($countactive==1)) {
 	$r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");
     }
     if ($env{'form.destinationurl'}) {