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

www www@source.lon-capa.org
Sat, 15 Jan 2011 21:49:37 -0000


www		Sat Jan 15 21:49:37 2011 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonparmset.pm 
  Log:
  More compact layout for parameter selection
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.996 loncom/interface/loncommon.pm:1.997
--- loncom/interface/loncommon.pm:1.996	Sat Jan 15 16:21:41 2011
+++ loncom/interface/loncommon.pm	Sat Jan 15 21:49:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.996 2011/01/15 16:21:41 www Exp $
+# $Id: loncommon.pm,v 1.997 2011/01/15 21:49:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6885,7 +6885,11 @@
 
 
 sub start_scrollbox {
-   return '<table style="width: 600px;"><tr><td style="width: 500px;"><div style="overflow:auto; width:500px; height: 200px;">';
+   my ($outerwidth,$width,$height)=@_;
+   unless ($outerwidth) { $outerwidth='520px'; }
+   unless ($width) { $width='500px'; }
+   unless ($height) { $height='200px'; }
+   return "<table style='width: $outerwidth; border: 1px solid black;'><tr><td style='width: $width;' bgcolor='#FFFFFF'><div style='overflow:auto; width:$width; height: $height;'>";
 }
 
 sub end_scrollbox {
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.509 loncom/interface/lonparmset.pm:1.510
--- loncom/interface/lonparmset.pm:1.509	Sat Jan 15 16:21:42 2011
+++ loncom/interface/lonparmset.pm	Sat Jan 15 21:49:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.509 2011/01/15 16:21:42 www Exp $
+# $Id: lonparmset.pm,v 1.510 2011/01/15 21:49:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1264,14 +1264,12 @@
             ele = document.forms.parmform.elements[i];
             if (ele.name == checkName) {
                 document.forms.parmform.elements[i].checked=value;
-                document.getElementById(document.forms.parmform.elements[i].value.concat(li)).style.display = displayOverview;
             }
         }
     }
 
     function checkthis(thisvalue, checkName) {
 
-        document.getElementById(thisvalue.concat("_li")).style.display = "";        
 
     for (i=0; i<document.forms.parmform.elements.length; i++) {
             ele = document.forms.parmform.elements[i];
@@ -1322,57 +1320,13 @@
     checkthis('problemstatus','pscat');
     }
 
-    function hideParms() {
-        document.getElementById('LC_parm_overview_parm_menu').style.display = "none";
-    }
-
-    function showParms() {
-        document.getElementById('LC_parm_overview_parm_menu').style.display = "";
-    }
-
-    function checkboxChecked(id) {
-        var li = "_li";
-        var id_li = id.concat(li);
-        if (document.getElementById(id_li).style.display == "none") {
-            document.getElementById(id_li).style.display = "";
-        }
-        else {
-            document.getElementById(id_li).style.display = "none";
-        }
-    }
 // ]]>
 </script>
 ENDSCRIPT
-    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
-
-    #part to print selected parms overview
-    $r->print(&mt('Selected Parameters:').'<br />');
-
-    #print out all possible parms and hide them by default
-    $r->print('<ul class="LC_parm_parmlist">');
-    foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {
-        $r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"');
-        if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) {
-            $r->print(' style="display:none"');
-        }
-        $r->print('>'
-                 .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey)
-                 .'</li>'
-        );
-    }
-    $r->print('</ul>');
 
     $r->print('<hr />');
     &shortCuts($r,$allparms,$pscat,$keyorder);
     $r->print('<hr />');
-
-    $r->print(
-        '<p><a href="javascript:showParms()">'
-       .&mt('Show detailed Parameter Selection')
-       .'</a></p>'
-    );
-
-    $r->print(&Apache::lonhtmlcommon::row_closure(1));
 }
 # return a hash
 sub categories {
@@ -1498,24 +1452,12 @@
         'file_submission' => [],
         'misc' => [],
     );
-    my $hidelink =
-        '<p>'
-       .'<a href="javascript:hideParms()">'
-       .&mt('Hide detailed Parameter Selection')
-       .'</a>'
-       .'</p>'
-       ."\n";
-;
+
     foreach $tempparameter (keys %$allparms) {
         &whatIsMyCategory($tempparameter, \%categoryList);
     }
     #part to print the parm-list
-    $r->print(
-        '<div id="LC_parm_overview_parm_menu" class="LC_Box" style="display:none">'."\n"
-       .'<h3>'.&mt('Parameter').'</h3>'."\n"
-       .$hidelink
-       .'<div class="LC_columnSection">'."\n"
-    );
+    $r->print('<div class="LC_columnSection">'."\n");
 
     #Print parameters
     for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) {
@@ -1530,7 +1472,6 @@
                     $r->print('<span class="LC_nobreak">'
                              .'<label><input type="checkbox" name="pscat" ');
                 $r->print('value="'.$tempkey.'" ');
-                $r->print('onclick="checkboxChecked(\''.$tempkey.'\')"');
                 if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
                     $r->print(' checked="checked"');
                 }
@@ -1542,12 +1483,7 @@
         }
     }
 
-    #&shortCuts($r,$allparms,$pscat,$keyorder);
-    $r->print(
-        "</div>\n"
-       .$hidelink
-       ."</div>\n"
-    );
+    $r->print("</div>\n");
 }
 #
 # This function offers some links on the parameter section to get with one click a group a parameters
@@ -1708,11 +1644,19 @@
 # This function shows on table Mode the available Parameters for the selected Resources
 #
 sub displaymenu {
-    my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_;
+    my ($r,$allparms,$pscat,$psprt,$keyorder)=@_;
+
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
+    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
+
     &parmmenu($r,$allparms,$pscat,$keyorder);
-    $r->print(&Apache::lonhtmlcommon::end_pick_box());
+    $r->print(&Apache::loncommon::start_scrollbox());
     &parmboxes($r,$allparms,$pscat,$keyorder);
+    $r->print(&Apache::loncommon::end_scrollbox());
+
+    $r->print(&Apache::lonhtmlcommon::row_closure(1));
+    $r->print(&Apache::lonhtmlcommon::end_pick_box());
+ 
 }
 
 sub mapmenu {
@@ -2288,7 +2232,7 @@
 
         # Step 2
         $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification')));
-        &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
+        &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder);
 
         # Step 3
         $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)')));
@@ -3378,10 +3322,7 @@
 
     $r->print('<div class="LC_Box">');
     $r->print('<div>');
-    $r->print(&Apache::lonhtmlcommon::start_pick_box());
-    &parmmenu($r,\%allparms,\@pscat,\%keyorder);
-    $r->print(&Apache::lonhtmlcommon::end_pick_box());
-    &parmboxes($r,\%allparms,\@pscat,\%keyorder);
+    &displaymenu($r,\%allparms,\@pscat,\%keyorder);
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
     $r->print('<table>'.