[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface loncommon.pm

raeburn raeburn@source.lon-capa.org
Fri, 14 Aug 2009 07:40:51 -0000


raeburn		Fri Aug 14 07:40:51 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	loncommon.pm 
  Log:
  - Backport 1.845, part of 1.846, 1.849, 1.850, 1.864, 1.865, 1.871.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.692.4.5 loncom/interface/loncommon.pm:1.692.4.6
--- loncom/interface/loncommon.pm:1.692.4.5	Fri Aug 14 03:50:09 2009
+++ loncom/interface/loncommon.pm	Fri Aug 14 07:40:50 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.692.4.5 2009/08/14 03:50:09 raeburn Exp $
+# $Id: loncommon.pm,v 1.692.4.6 2009/08/14 07:40:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -482,7 +482,7 @@
 
 sub coursebrowser_javascript {
     my ($domainfilter,$sec_element,$formname)=@_;
-    my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
+    my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role');
    my $output = '
 <script type="text/javascript" language="JavaScript">
 // <![CDATA[
@@ -527,7 +527,7 @@
         if (multflag !=null && multflag != '') {
             url += '&multiple='+multflag;
         }
-        if (crstype == 'Course/Group') {
+        if (crstype == 'Course/Community') {
             if (formname == 'cu') {
                 crstype = document.cu.crstype.options[document.cu.crstype.selectedIndex].value; 
                 if (crstype == "") {
@@ -615,12 +615,16 @@
 
 sub selectcourse_link {
    my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
+   my $linktext = &mt('Select Course');
+   if ($selecttype eq 'Community') {
+       $linktext = &mt('Select Community');
+   }
    return '<span class="LC_nobreak">'
          ."<a href='"
          .'javascript:opencrsbrowser("'.$form.'","'.$unameele
          .'","'.$udomele.'","'.$desc.'","'.$extra_element
          .'","'.$multflag.'","'.$selecttype.'");'
-         ."'>".&mt('Select Course').'</a>'
+         ."'>".$linktext.'</a>'
          .'</span>';
 }
 
@@ -4548,9 +4552,9 @@
 
     my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';
     my $mono                 = 'monospace';
-    my $data_table_head      = $tabbg;
-    my $data_table_light     = '#EEEEEE';
-    my $data_table_dark      = '#DDDDDD';
+    my $data_table_head      = $sidebg;
+    my $data_table_light     = '#FAFAFA';
+    my $data_table_dark      = '#F0F0F0';
     my $data_table_darker    = '#CCCCCC';
     my $data_table_highlight = '#FFFF00';
     my $mail_new             = '#FFBB77';
@@ -4573,6 +4577,15 @@
     return <<END;
 h1, h2, h3, th { font-family: $sans }
 a:focus { color: red; background: yellow } 
+
+hr {
+  clear: both;
+  color: $tabbg;
+  background-color: $tabbg;
+  height: 3px;
+  border: none;
+}
+
 table.thinborder,
 
 table.thinborder tr th {
@@ -5151,7 +5164,7 @@
   border-spacing: 1px;
 }
 table.LC_pick_box td.LC_pick_box_title {
-  background: $tabbg;
+  background: $sidebg;
   font-weight: bold;
   text-align: right;
   vertical-align: top;
@@ -5159,7 +5172,7 @@
   padding: 8px;
 }
 table.LC_pick_box td.LC_selfenroll_pick_box_title {
-  background: $tabbg;
+  background: $sidebg;
   font-weight: bold;
   text-align: right;
   width: 350px;
@@ -5776,7 +5789,8 @@
             .'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' 
 	    .'xmlns="http://www.w3.org/1999/xhtml">';
     } else {
-	$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>';
+	$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.
+            '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
     }
     return $output;
 }
@@ -7912,7 +7926,8 @@
     $r->print(&mt('Samples').'<br />'.&start_data_table().
               &start_data_table_header_row());
     foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) { 
-        $r->print('<th>'.&mt('Column&nbsp;[_1]',($sample+1)).'</th>'); }
+        $r->print('<th>'.&mt('Column [_1]',($sample+1)).'</th>');
+    }
     $r->print(&end_data_table_header_row());
     foreach my $hash (@$samples) {
 	$r->print(&start_data_table_row());
@@ -9560,8 +9575,8 @@
 sub group_term {
     my $crstype = &course_type();
     my %names = (
-                  'Course' => 'group',
-                  'Group' => 'team',
+                  'Course'    => 'group',
+                  'Community' => 'group',
                 );
     return $names{$crstype};
 }
@@ -9776,7 +9791,7 @@
                 &Apache::lonnet::usertools_access($username,$domain,$tool,'reload');
         }
 
-        foreach my $crstype ('official','unofficial') {
+        foreach my $crstype ('official','unofficial','community') {
             $userenv{'canrequest.'.$crstype} =
                 &Apache::lonnet::usertools_access($username,$domain,$crstype,
                                                   'reload','requestcourses');