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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Tue, 01 Jan 2008 18:48:17 -0000


raeburn		Tue Jan  1 13:48:17 2008 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  Two column display fro Domain Configuration main menu
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.37 loncom/interface/domainprefs.pm:1.38
--- loncom/interface/domainprefs.pm:1.37	Thu Dec 20 23:47:24 2007
+++ loncom/interface/domainprefs.pm	Tue Jan  1 13:48:17 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.37 2007/12/21 04:47:24 raeburn Exp $
+# $Id: domainprefs.pm,v 1.38 2008/01/01 18:48:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -281,11 +281,24 @@
               ' />  '.
               '<input type="button" value="uncheck all" '.
               'onclick="javascript:uncheckAll(document.pickactions.actions)"'.
-              ' /></p>');
+              ' /></p><div class="LC_left_float">');
+        my ($numitems,$midpoint,$seconddiv,$count); 
+        $numitems = @prefs_order;
+        $midpoint = int($numitems/2);
+        if ($numitems%2) {
+            $midpoint ++;
+        }
+        $count = 0;
         foreach my $item (@prefs_order) {
-            $r->print('<p><label><input type="checkbox" name="actions" value="'.$item.'" />&nbsp;'.$prefs{$item}->{'text'}.'</label></p>');
+            $r->print('<h4><label><input type="checkbox" name="actions" value="'.$item.'" />&nbsp;'.$prefs{$item}->{'text'}.'</label></h4>');
+            $count ++;
+            if ((!$seconddiv) && ($count >= $midpoint)) {
+                $r->print('</div>'."\n".'<div class="LC_left_float">'."\n");
+                $seconddiv = 1;
+            }
         }
-        $r->print('<h3>'.&mt('Display options').'</h3>'."\n".
+        $r->print('</div><div class="LC_clear_float_footer"></div><h3>'.
+                  &mt('Display options').'</h3>'."\n".
                   '<p><span class="LC_nobreak">'.&mt('Display using: ')."\n".
                   '<label><input type="radio" name="numcols" value="1">'.
                   &mt('one column').'</label>&nbsp;&nbsp;'.