[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonparmset.pm

raeburn raeburn at source.lon-capa.org
Thu May 10 13:50:07 EDT 2012


raeburn		Thu May 10 17:50:07 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonparmset.pm 
  Log:
  - For 2.11
    - Backport 1.523 (part).
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.522.2.1 loncom/interface/lonparmset.pm:1.522.2.2
--- loncom/interface/lonparmset.pm:1.522.2.1	Mon May  7 23:46:11 2012
+++ loncom/interface/lonparmset.pm	Thu May 10 17:50:07 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.522.2.1 2012/05/07 23:46:11 raeburn Exp $
+# $Id: lonparmset.pm,v 1.522.2.2 2012/05/10 17:50:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -873,6 +873,26 @@
 
 }
 
+sub showhide_js {
+    return <<"COURSECONTENTSCRIPT";
+
+function showHide_courseContent() {
+    var parmlevValue=document.getElementById("parmlev").value;
+    if (parmlevValue == 'general') {
+        document.getElementById('mapmenu').style.display="none";
+    } else {
+        if ((parmlevValue == "full") || (parmlevValue == "map")) {
+            document.getElementById('mapmenu').style.display ="";
+        } else {
+            document.getElementById('mapmenu').style.display="none";
+        }
+    }
+    return;
+}
+
+COURSECONTENTSCRIPT
+}
+
 sub startpage {
     my ($r,$psymb) = @_;
 
@@ -880,7 +900,7 @@
                       'onload'   => "group_or_section('cgroup')",
                     );
     if (!$psymb) {
-        $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup')";
+        $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup'); resize_scrollbox('mapmenuscroll','1','1');";
     }
 
     if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
@@ -892,9 +912,16 @@
        text=>"Table Mode",
        help => 'Course_Setting_Parameters'});
     }
+    my $js = &page_js().'
+<script type="text/javascript">
+// <![CDATA[
+'.
+            &Apache::lonhtmlcommon::resize_scrollbox_js('params').'
+// ]]>
+</script>
+';
     my $start_page =
-    &Apache::loncommon::start_page('Set/Modify Course Parameters',
-                       &page_js(),
+    &Apache::loncommon::start_page('Set/Modify Course Parameters',$js,
                        {'add_entries' => \%loaditems,});
     my $breadcrumbs =
     &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
@@ -1513,8 +1540,12 @@
 
 sub partmenu {
     my ($r,$allparts,$psprt)=@_;
+    my $selsize = 1+scalar(keys(%{$allparts}));
+    if ($selsize > 8) {
+        $selsize = 8;
+    }
 
-    $r->print('<select multiple="multiple" name="psprt" size="8">');
+    $r->print('<select multiple="multiple" name="psprt" size="'.$selsize.'">');
     $r->print('<option value="all"');
     $r->print(' selected="selected"') unless (@{$psprt});
     $r->print('>'.&mt('All Parts').'</option>');
@@ -1715,12 +1746,12 @@
            .'</div>'
         );
 
-        $r->print(&Apache::loncommon::start_scrollbox());
-        $r->print(&Apache::loncommon::start_data_table());
+        $r->print(&Apache::loncommon::start_scrollbox(undef,undef,undef,'mapmenuscroll'));
+        $r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner'));
 
         # Display row: "All Maps or Folders"
         $r->print(
-            &Apache::loncommon::start_data_table_row()
+            &Apache::loncommon::start_data_table_row(undef,'picklevel')
            .'<td>'
            .'<label>'
            .'<input type="radio" name="pschp"'
@@ -1795,8 +1826,9 @@
             );
         }
 
-        $r->print(&Apache::loncommon::end_data_table());
-        $r->print(&Apache::loncommon::end_scrollbox());
+        $r->print(&Apache::loncommon::end_data_table().
+                  '<br style="line-height:2px;" />'.
+                  &Apache::loncommon::end_scrollbox());
     }
 }
 
@@ -2199,27 +2231,15 @@
         }
 
         # Step 1
-        $r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification')));
-        $r->print(<<COURSECONTENTSCRIPT);
+        $r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification'),'parmstep1'));
+        $r->print('
 <script type="text/javascript">
-// <![CDATA[
-function showHide_courseContent(){
-        var parmlevValue=document.getElementById("parmlev").value;
-        if (parmlevValue == 'general') {
-            document.getElementById('mapmenu').style.display="none";
-        } else {
-            if ((parmlevValue == "full") || (parmlevValue == "map")) {
-                document.getElementById('mapmenu').style.display ="";
-            } else {
-                document.getElementById('mapmenu').style.display="none";
-            }
-        }        
-    }
+// <![CDATA['.
+                 &showhide_js().'
 // ]]>
 </script>
-COURSECONTENTSCRIPT
-
-        $r->print(&Apache::lonhtmlcommon::start_pick_box());
+');
+        $r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel'));
         &levelmenu($r,\%alllevs,$parmlev);
         $r->print(&Apache::lonhtmlcommon::row_closure());
         &mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp);
@@ -2230,11 +2250,11 @@
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
 
         # Step 2
-        $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification')));
+        $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));
         &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder);
 
         # Step 3
-        $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)')));
+        $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));
         $r->print(&Apache::lonhtmlcommon::start_pick_box());
         &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
         $r->print(&Apache::lonhtmlcommon::row_closure(1));
@@ -3267,7 +3287,21 @@
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
         text=>"Overview Mode"});
-    my $start_page = &Apache::loncommon::start_page('Set Parameters');
+
+    my %loaditems = (
+                      'onload'   => "showHide_courseContent(); resize_scrollbox('mapmenuscroll','1','1');",
+                    );
+    my $js = '
+<script type="text/javascript">
+// <![CDATA[
+'.
+            &Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n".
+            &showhide_js()."\n".
+'// ]]>
+</script>
+';
+    my $start_page = &Apache::loncommon::start_page('Set Parameters',$js,
+                                                    {'add_entries' => \%loaditems,});
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
     $r->print($start_page.$breadcrumbs);
     $r->print(<<ENDOVER);
@@ -3332,7 +3366,7 @@
     $r->print('<div class="LC_Box">');
     #$r->print('<h2 class="LC_hcell">Step 1</h2>');
     $r->print('<div>');
-    $r->print(&Apache::lonhtmlcommon::start_pick_box());
+    $r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel'));
     &levelmenu($r,\%alllevs,$parmlev);
     if ($parmlev ne 'general') {
         $r->print(&Apache::lonhtmlcommon::row_closure());




More information about the LON-CAPA-cvs mailing list