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

bisitz bisitz@source.lon-capa.org
Tue, 12 Jan 2010 18:11:58 -0000


bisitz		Tue Jan 12 18:11:58 2010 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Optimizations for Resource Parameters (Table Mode):
  - Moved step 1 elements into one single pick_box
  - Moved parts box ("partmenu") from step 2 to step 1 where it makes more sense
    (to also hide it when course level is chosen could be an option)
  - Simple parameter selection lists ("shortCuts"):
      - Consistent layout (use funclist)
      - funclist usage automatically brings much better floating characteristics
      - Moved "Show detailed Parameter Selection" link to bottom of current box
      - Wrapped lists in <hr> to better separate it from the rest
  - Removed unused style "LC_parm_overview_parm_menu_selectors"
  - Added/Updated some code comments and added some code separating line breaks
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.490 loncom/interface/lonparmset.pm:1.491
--- loncom/interface/lonparmset.pm:1.490	Sun Jan 10 21:14:14 2010
+++ loncom/interface/lonparmset.pm	Tue Jan 12 18:11:58 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.490 2010/01/10 21:14:14 raeburn Exp $
+# $Id: lonparmset.pm,v 1.491 2010/01/12 18:11:58 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1361,13 +1361,17 @@
                  .'</li>'
         );
     }
-    $r->print('</ul>'
-             .'<p><a href="javascript:showParms()">'
-             .&mt('Show detailed Parameter Selection')
-             .'</a></p>'
-    );
+    $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));
 }
@@ -1551,45 +1555,33 @@
 sub shortCuts {
     my ($r,$allparms,$pscat,$keyorder)=@_;
 
-    #part to print out the shortcuts for parmselection
-    $r->print('<table><tr id="LC_parm_overview_parm_menu_selectors">'
-             .'<td valign="top">'
-             .'<fieldset><legend>'.&mt('Parameter Selection').'</legend>'
-             .'<span class="LC_nobreak">'
-             .'&bull; <a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>'
-             .'</span>'
-             .'<br />'
-             .'<span class="LC_nobreak">'
-             .'&bull; <a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>'
-             .'</span>'
-             .'<br />'
-             .'<span class="LC_nobreak">'
-             .'&bull; <a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>'
-             .'</span>'
-             .'</fieldset>'
-             .'</td>'
-             .'<td colspan="2" valign="top">'
-             .'<fieldset><legend>'.&mt('Add Selection for...').'</legend>'
-             .'<span class="LC_nobreak">'
-             .'&bull; <a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>'
-             .'</span>'
-             .'<span class="LC_nobreak">'
-             .' &bull; <a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>'
-             .'</span>'
-#            .'<br />'
-             .'<span class="LC_nobreak">'
-             .' &bull; <a href="javascript:checkdisset()">'.&mt('Discussion Settings').'</a>'
-             .'</span>'
-             .'<span class="LC_nobreak">'
-             .' &bull; <a href="javascript:checkvisi()">'.&mt('Visibilities').'</a>'
-             .'</span>'
-#            .'<br />'
-             .'<span class="LC_nobreak">'
-             .' &bull; <a href="javascript:checkparts()">'.&mt('Part Parameters').'</a>'
-             .'</span>'
-             .'</fieldset>'
-             .'</td>'
-             .'</tr></table>');
+    # Parameter Selection
+    $r->print(
+        &Apache::lonhtmlcommon::start_funclist(&mt('Parameter Selection'))
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>')
+       .&Apache::lonhtmlcommon::end_funclist()
+    );
+
+    # Add Selection for...
+    $r->print(
+        &Apache::lonhtmlcommon::start_funclist(&mt('Add Selection for...'))
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkdisset()">'.&mt('Discussion Settings').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkvisi()">'.&mt('Visibilities').'</a>')
+       .&Apache::lonhtmlcommon::add_item_funclist(
+            '<a href="javascript:checkparts()">'.&mt('Part Parameters').'</a>')
+       .&Apache::lonhtmlcommon::end_funclist()
+    );
 }
 
 sub partmenu {
@@ -1721,11 +1713,6 @@
     &parmmenu($r,$allparms,$pscat,$keyorder);
     $r->print(&Apache::lonhtmlcommon::end_pick_box());
     &parmboxes($r,$allparms,$pscat,$keyorder);
-    $r->print(&Apache::lonhtmlcommon::start_pick_box());
-    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
-    &partmenu($r,$allparts,$psprt);
-    $r->print(&Apache::lonhtmlcommon::row_closure(1));
-    $r->print(&Apache::lonhtmlcommon::end_pick_box());
 }
 
 sub mapmenu {
@@ -2198,7 +2185,6 @@
 </script>
 ENDPARMSELSCRIPT
     
-    # Display Unit 1 "General Parameters"
     if (!$pssymb) {
         my $parmselhiddenstyle=' style="display:none"';
         if($env{'form.hideparmsel'} eq 'hidden') {
@@ -2207,6 +2193,7 @@
            $r->print('<div id="parmsel">');
         }
 
+        # Step 1
         $r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification')));
         $r->print(<<COURSECONTENTSCRIPT);
 <script type="text/javascript">
@@ -2229,26 +2216,33 @@
 
         $r->print(&Apache::lonhtmlcommon::start_pick_box());
         &levelmenu($r,\%alllevs,$parmlev);
-        $r->print(&Apache::lonhtmlcommon::row_closure(1));
-        $r->print(&Apache::lonhtmlcommon::end_pick_box());
-        $r->print(&Apache::lonhtmlcommon::start_pick_box());
+        $r->print(&Apache::lonhtmlcommon::row_closure());
         &mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp);
+        $r->print(&Apache::lonhtmlcommon::row_closure());
+        $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
+        &partmenu($r,\%allparts,\@psprt);
         $r->print(&Apache::lonhtmlcommon::row_closure(1));
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
-        #Display Unit 2 "Select Parameter"   
+
+        # Step 2
         $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification')));
         &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
+
+        # Step 3
         $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)')));
         $r->print(&Apache::lonhtmlcommon::start_pick_box());
         &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
         $r->print(&Apache::lonhtmlcommon::row_closure(1));
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
+
+        # Update Display Button
         $r->print('<p>'
              .'<input type="submit" name="dis"'
              .' value="'.&mt('Update Parameter Display').'" />'
              .'<input type="hidden" name="hideparmsel" value="hidden" />'
              .'</p>');
         $r->print('</div>');
+
         # Offer link to display parameter selection again
         $r->print('<p id="parmsellink"');
         if ($env{'form.hideparmsel'} ne 'hidden') {