[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncreateuser.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 23 Nov 2006 00:04:10 -0000


raeburn		Wed Nov 22 19:04:10 2006 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm loncommon.pm 
  Log:
  Existing Roles table in data_table style in CUSR 
  
  LC_createuser class added to loncommon::standard_css()   
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.136 loncom/interface/loncreateuser.pm:1.137
--- loncom/interface/loncreateuser.pm:1.136	Wed Nov 22 16:55:53 2006
+++ loncom/interface/loncreateuser.pm	Wed Nov 22 19:04:09 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.136 2006/11/22 21:55:53 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.137 2006/11/23 00:04:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -623,7 +623,6 @@
 # Is this a custom role? Get role owner and title.
 	       my ($croleudom,$croleuname,$croletitle)=
 	           ($role_code=~/^cr\/(\w+)\/(\w+)\/(\w+)$/);
-               my $bgcol='ffffff';
                my $allowed=0;
                my $delallowed=0;
 	       my $sortkey=$role_code;
@@ -664,9 +663,6 @@
 		       }
 		   }
                    # Compute the background color based on $area
-                   $bgcol=$1.'_'.$2;
-                   $bgcol=~s/[^7-9a-e]//g;
-                   $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
                    if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) {
                        $carea.='<br />Section: '.$3;
 		       $sortkey.="\0$3";
@@ -706,9 +702,8 @@
                        $allowed=0;
                    }
                }
-	       $bgcol='77FF77';
                my $row = '';
-               $row.='<tr bgcolor="#'.$bgcol.'"><td>';
+               $row.= '<td>';
                my $active=1;
                $active=0 if (($role_end_time) && ($now>$role_end_time));
                if (($active) && ($allowed)) {
@@ -745,7 +740,7 @@
                                                    : '&nbsp;' ).
                       '</td><td>'.($role_end_time  ?localtime($role_end_time)
                                                    : '&nbsp;' )
-                      ."</td></tr>\n";
+                      ."</td>";
 	       $sortrole{$sortkey}=$envkey;
 	       $roletext{$envkey}=$row;
 	       $roleclass{$envkey}=$class;
@@ -758,30 +753,35 @@
 	       $output{$type} = '';
 	       foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {
 		   if ( ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/ ) && ($rolepriv{$sortrole{$which}}) ) { 
-		       $output{$type}.=$roletext{$sortrole{$which}};
+		       $output{$type}.=
+                             &Apache::loncommon::start_data_table_row().
+                             $roletext{$sortrole{$which}}.
+                             &Apache::loncommon::end_data_table_row();
 		   }
 	       }
 	       unless($output{$type} eq '') {
-		   $output{$type} = "<tr bgcolor='#BBffBB'>".
-			     "<td align='center' colspan='7'>".&mt($type)."</td>".
+		   $output{$type} = '<tr class="LC_info_row">'.
+			     "<td align='center' colspan='7'>".&mt($type)."</td></tr>".
                               $output{$type};
                    $rolesdisplay = 1;
 	       }
 	   }
            if ($rolesdisplay == 1) {
-               $r->print(<<END);
+               $r->print('
 <hr />
-<h3>$lt{'rer'}</h3>
-<table>
-<tr><th>$lt{'rev'}</th><th>$lt{'ren'}</th><th>$lt{'del'}</th><th>$lt{'rol'}</th><th>$lt{'e
-xt'}</th><th>$lt{'sta'}</th><th>$lt{'end'}</th>
-END
+<h3>'.$lt{'rer'}.'</h3>'.
+&Apache::loncommon::start_data_table("LC_createuser").
+&Apache::loncommon::start_data_table_header_row().
+'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}.
+'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.
+'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'.
+&Apache::loncommon::end_data_table_header_row());
                foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') {
                    if ($output{$type}) {
                        $r->print($output{$type}."\n");
                    }
                }
-	       $r->print('</table>');
+	       $r->print(&Apache::loncommon::end_data_table());
            }
         }  # End of unless
 	my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
@@ -1774,8 +1774,9 @@
                     if (%sections_count) {
                         my $currsec = &course_sections(\%sections_count,$protectedcourse.'_'.$role);
                         $table .= 
-                    '<td><table border="0" cellspacing="0" cellpadding="0">'.
-                     '<tr><td valign="top">'.$lt{'exs'}.'<br />'.
+                    '<td><table class="LC_createuser">'.
+                     '<tr class="LC_section_row">
+                        <td valign="top">'.$lt{'exs'}.'<br />'.
                         $currsec.'</td>'.
                      '<td>&nbsp;&nbsp;</td>'.
                      '<td valign="top">&nbsp;'.$lt{'new'}.'<br />'.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.472 loncom/interface/loncommon.pm:1.473
--- loncom/interface/loncommon.pm:1.472	Tue Nov 21 16:38:44 2006
+++ loncom/interface/loncommon.pm	Wed Nov 22 19:04:09 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.472 2006/11/21 21:38:44 raeburn Exp $
+# $Id: loncommon.pm,v 1.473 2006/11/23 00:04:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3514,6 +3514,19 @@
   background-color: #EEE;
 }
 
+table.LC_createuser {
+}
+
+table.LC_createuser tr.LC_section_row td {
+  font-size: smaller;
+}
+
+table.LC_createuser tr.LC_info_row td  {
+  background-color: #CCC;
+  font-weight: bold;
+  text-align: center;
+}
+
 table.LC_calendar {
   border: 1px solid #000000;
   border-collapse: collapse;