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

faziophi faziophi@source.lon-capa.org
Fri, 08 Jan 2010 00:04:05 -0000


faziophi		Fri Jan  8 00:04:05 2010 EDT

  Modified files:              
    /loncom/interface	courseprefs.pm 
  Log:
  - Support "advanced" preferences" in general settings section
  
  
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.18 loncom/interface/courseprefs.pm:1.19
--- loncom/interface/courseprefs.pm:1.18	Thu Jan  7 20:33:22 2010
+++ loncom/interface/courseprefs.pm	Fri Jan  8 00:04:04 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.18 2010/01/07 20:33:22 faziophi Exp $
+# $Id: courseprefs.pm,v 1.19 2010/01/08 00:04:04 faziophi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -163,7 +163,7 @@
                      help => 'Course_Environment',
                      ordered => ['description','courseid','categories',
                                  'hidefromcat','externalsyllabus',
-                                 'url','rolenames','cloners'],
+                                 'cloners','url','rolenames'],
                      itemtext => {
                                    description      => $lt{'desc'},
                                    courseid         => $lt{'idnu'},
@@ -1309,6 +1309,7 @@
                            '</span>',
                    input => 'textbox',
                    size  => '40',
+                   advanced => 1
                  },
         'description'  => { 
                    text => '<b>'.&mt($itemtext->{'description'}).'</b>',
@@ -1326,12 +1327,14 @@
                            &mt('Coordinators included automatically'),
                    input => 'textbox',
                    size  => '40',
+                   advanced => 1
                          },
         'rolenames'  => { 
                    text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.
                             '('.$replace.')',
                    input => 'textbox',
                    size  => '20',
+                   advanced => 1
                         },
         'externalsyllabus' => {
                    text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.
@@ -1360,7 +1363,11 @@
             next if (!$can_categorize);
         }
         $count ++;
-        $datatable .= &item_table_row_start($items{$item}{text},$count);
+        if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) {
+        	$datatable .= &item_table_row_start($items{$item}{text},$count,"advanced");
+        } else {
+        	$datatable .= &item_table_row_start($items{$item}{text},$count);
+        }
         if ($items{$item}{input} eq 'radio') {
             $datatable .= &yesno_radio($item,$settings);
         } elsif ($item eq 'cloners') {
@@ -2431,15 +2438,13 @@
 }
 
 sub item_table_row_start {
-    my ($text,$count) = @_;
+    my ($text,$count,$add_class) = @_;
     my $output;
-    if ($count%2) {
-        $output .= '<tr class="LC_odd_row">';
-    } else {
-        $output .= '<tr>';
-    }
+	my $css_class = ($count % 2) ? 'LC_odd_row' : 'LC_even_row';
+	$css_class = (join(' ',$css_class,$add_class)) unless ($add_class eq '');
+	$output .= '<tr class="'.$css_class.'">'."\n";;
     $output .= '<td class="LC_left_item">'.$text.
-               '</td><td class="LC_right_item" align="right">';
+               '</td><td class="LC_right_item">';
     return $output;
 }