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

faziophi faziophi@source.lon-capa.org
Thu, 07 Jan 2010 18:21:25 -0000


faziophi		Thu Jan  7 18:21:25 2010 EDT

  Modified files:              
    /loncom/interface	lonconfigsettings.pm courseprefs.pm 
  Log:
  course prefs --> jQuery accordion.  in order to not disrupt domain prefs,
  etc. for now, some style information is changed dynamically through
  jQuery CSS transformations.  also ignoring column display preferences for
  now.  but this gets something into CVS...
  
  
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.8 loncom/interface/lonconfigsettings.pm:1.9
--- loncom/interface/lonconfigsettings.pm:1.8	Mon Nov 23 21:45:18 2009
+++ loncom/interface/lonconfigsettings.pm	Thu Jan  7 18:21:25 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.8 2009/11/23 21:45:18 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.9 2010/01/07 18:21:25 faziophi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -301,17 +301,30 @@
             } else {
                 $colend = @items;
             }
-            $r->print('<p><table class="LC_double_column"><tr><td class="LC_left_col">');            for (my $i=0; $i<$colend; $i++) {
+            if ($context ne 'course') {
+            	$r->print('<p><table class="LC_double_column"><tr><td class="LC_left_col">');            
+            }
+            else {
+            	$r->print('<div id="prefs" style="max-width:900px;margin: 10px auto 10px auto;">');
+            }
+            for (my $i=0; $i<$colend; $i++) {
                 $r->print($output{$items[$i]});
             }
-            $r->print('</td><td></td><td class="LC_right_col">');
+            if ($context ne 'course') {
+            	$r->print('</td><td></td><td class="LC_right_col">');
+            }
             if ($colend < @items) {
                 for (my $i=$colend; $i<@items; $i++) {
                     $r->print($output{$items[$i]});
                 }
             }
-            $r->print('</td></tr></table></p>');
-            $r->print(&print_footer($r,$phase,'process','Save',\@actions));
+            if ($context ne 'course') {
+            	$r->print('</td></tr></table></p>');
+            }
+            else {
+            	$r->print('</div>');
+            }
+            $r->print(&print_footer($r,$phase,'process','Save Changes',\@actions));
         } else {
             $r->print('<input type="hidden" name="phase" value="" />'.
                   '<input type="hidden" name="numcols" value="'.
@@ -321,6 +334,22 @@
         }
         $r->print('</form>');
     }
+    if ($context eq 'course') {
+    	$r->print('
+<script type="text/javascript">
+	$(document).ready(function(){
+		$("#prefs").accordion({
+			autoHeight: false
+		});
+		$("#prefs td.LC_left_item").css("text-align", "right");
+		$("#prefs td.LC_left_item").css("width", "40%");
+		$("#prefs td.LC_left_item").css("padding-right", "10px");		
+		$("#prefs td.LC_right_item").css("text-align", "left");
+		$("#prefs td.LC_right_item").css("width", "60%");		
+	});
+</script>
+');
+    }
     $r->print(&Apache::loncommon::end_page());
     return;
 }
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.15 loncom/interface/courseprefs.pm:1.16
--- loncom/interface/courseprefs.pm:1.15	Sun Jan  3 01:58:15 2010
+++ loncom/interface/courseprefs.pm	Thu Jan  7 18:21:25 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.15 2010/01/03 01:58:15 raeburn Exp $
+# $Id: courseprefs.pm,v 1.16 2010/01/07 18:21:25 faziophi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -366,16 +366,11 @@
     my $itemtext = $item->{'itemtext'};
     my $rowtotal = 0;
     my $output =
-         '<table class="LC_nested_outer">
-          <tr>
-           <th align="left" valign="middle"><span class="LC_font_larger">'.
-           &mt($item->{text}).'&nbsp;'.
-           &Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n".
-          '</tr>';
+        '<h3><a href="#">'.&mt($item->{text}).'</a></h3>
+        <div>&nbsp;<span style="float:right">'.
+         &Apache::loncommon::help_open_topic($item->{'help'}).'</span>';
     if (($action eq 'feedback') || ($action eq 'classlists')) {
         $output .= '
-          <tr>
-           <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
               <td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>
@@ -389,10 +384,6 @@
         }
         $output .= '
            </table>
-          </td>
-         </tr>
-         <tr>
-           <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
               <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';
@@ -403,10 +394,6 @@
             $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).
                        '
             </table>
-           </td>
-          </tr>
-          <tr>
-           <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
               <td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
@@ -415,8 +402,6 @@
         }
     } else {
         $output .= '
-          <tr>
-           <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
               <td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>
@@ -449,9 +434,7 @@
     }
     $output .= '
    </table>
-  </td>
- </tr>
-</table><br />';
+</div>';
     return ($output,$rowtotal);
 }