[LON-CAPA-cvs] cvs: loncom /homework grades.pm lonsimpleproblemedit.pm /interface loncommon.pm londocs.pm lonindexer.pm lonmeta.pm lonmsgdisplay.pm lonparmset.pm lonpickcourse.pm lonsearchcat.pm slotrequest.pm /publisher lonrights.pm /xml lonxml.pm

raeburn raeburn@source.lon-capa.org
Sun, 06 Jun 2010 02:40:45 -0000


This is a MIME encoded message

--raeburn1275792045
Content-Type: text/plain

raeburn		Sun Jun  6 02:40:45 2010 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm lonindexer.pm lonmeta.pm 
                     	lonmsgdisplay.pm lonparmset.pm lonpickcourse.pm 
                     	lonsearchcat.pm slotrequest.pm 
    /loncom/homework	grades.pm lonsimpleproblemedit.pm 
    /loncom/xml	lonxml.pm 
    /loncom/publisher	lonrights.pm 
  Log:
  - Bug 6251.
    - Third arg is now a ref to a hash, instead of a hash.
    - New (optional) fourth arg, is an additional attribute for the
      select tag, e.g., an onchange action.
  - Update calls to loncommon::select_form() accordingly.
  
  
--raeburn1275792045
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20100606024045.txt"

Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.969 loncom/interface/loncommon.pm:1.970
--- loncom/interface/loncommon.pm:1.969	Sun May 30 12:47:05 2010
+++ loncom/interface/loncommon.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.969 2010/05/30 12:47:05 droeschl Exp $
+# $Id: loncommon.pm,v 1.970 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -900,7 +900,7 @@
             $langchoices{$code} = &plainlanguagedescription($id);
         }
     }
-    return &select_form($selected,$name,%langchoices);
+    return &select_form($selected,$name,\%langchoices);
 }
 
 =pod
@@ -1786,7 +1786,7 @@
 	return &multiple_select_form($name,$value,4,\%domains);
     } else {
 	$domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];
-	return &select_form($name,$value,%domains);
+	return &select_form($name,$value,\%domains);
     }
 }
 
@@ -1848,29 +1848,36 @@
 
 =pod
 
-=item * &select_form($defdom,$name,%hash)
+=item * &select_form($defdom,$name,$hashref,$onchange)
 
 Returns a string containing a <select name='$name' size='1'> form to 
-allow a user to select options from a hash option_name => displayed text.  
+allow a user to select options from a ref to a hash containing:
+option_name => displayed text. An optional $onchange can include
+a javascript onchange item, e.g., onchange="this.form.submit();"  
+
 See lonrights.pm for an example invocation and use.
 
 =cut
 
 #-------------------------------------------
 sub select_form {
-    my ($def,$name,%hash) = @_;
-    my $selectform = "<select name=\"$name\" size=\"1\">\n";
+    my ($def,$name,$hashref,$onchange) = @_;
+    return unless (ref($hashref) eq 'HASH');
+    if ($onchange) {
+        $onchange = ' onchange="'.$onchange.'"';
+    }
+    my $selectform = "<select name=\"$name\" size=\"1\"$onchange>\n";
     my @keys;
-    if (exists($hash{'select_form_order'})) {
-	@keys=@{$hash{'select_form_order'}};
+    if (exists($hashref->{'select_form_order'})) {
+	@keys=@{$hashref->{'select_form_order'}};
     } else {
-	@keys=sort(keys(%hash));
+	@keys=sort(keys(%{$hashref}));
     }
     foreach my $key (@keys) {
         $selectform.=
 	    '<option value="'.&HTML::Entities::encode($key,'"<>&').'" '.
             ($key eq $def ? 'selected="selected" ' : '').
-                ">".$hash{$key}."</option>\n";
+                ">".$hashref->{$key}."</option>\n";
     }
     $selectform.="</select>";
     return $selectform;
@@ -1888,9 +1895,9 @@
            &mt('Filter [_1]',
 	   &select_form($env{'form.displayfilter'},
 			'displayfilter',
-			('currentfolder' => 'Current folder/page',
+			{'currentfolder' => 'Current folder/page',
 			 'containing' => 'Containing phrase',
-			 'none' => 'None'))).
+			 'none' => 'None'})).
 			 '<input type="text" name="containingphrase" size="30" value="'.&HTML::Entities::encode($env{'form.containingphrase'}).'" /></span>';
 }
 
@@ -3232,8 +3239,7 @@
 sub filecategoryselect {
     my ($name,$value)=@_;
     return &select_form($value,$name,
-			'' => &mt('Any category'),
-			map { $_,$_ } sort(keys(%category_extensions)));
+                        {'' => &mt('Any category'), map { $_,$_ } sort(keys(%category_extensions))});
 }
 
 =pod
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.427 loncom/interface/londocs.pm:1.428
--- loncom/interface/londocs.pm:1.427	Mon May  3 16:41:51 2010
+++ loncom/interface/londocs.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.427 2010/05/03 16:41:51 www Exp $
+# $Id: londocs.pm,v 1.428 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2482,11 +2482,11 @@
 # Set version
 	    $r->print(&Apache::loncommon::select_form($setversions{$linkurl},
 						      'set_version_'.$linkurl,
-						      ('select_form_order' =>
+						      {'select_form_order' =>
 						       ['',1..$currentversion,'mostrecent'],
 						       '' => '',
 						       'mostrecent' => &mt('most recent'),
-						       map {$_,$_} (1..$currentversion))));
+						       map {$_,$_} (1..$currentversion)}));
 	    $r->print('</span></td></tr><tr><td></td>');
 	    my $lastold=1;
 	    for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.206 loncom/interface/lonindexer.pm:1.207
--- loncom/interface/lonindexer.pm:1.206	Wed Mar 31 13:20:46 2010
+++ loncom/interface/lonindexer.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.206 2010/03/31 13:20:46 raeburn Exp $
+# $Id: lonindexer.pm,v 1.207 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -460,11 +460,12 @@
             push(@select_form_order,$types);
         }
         $select_file_categories{'select_form_order'} = \@select_form_order;
+        my $onchange = 'this.form.submit();';
         my $type_element=
             &Apache::loncommon::select_form(
                 $typeselect,
                 'only',
-                %select_file_categories);
+                \%select_file_categories,$onchange);
         my $type_selector = '<label>'.&mt('File Type Displayed: [_1]',
                                           $type_element).'</label>';
 
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.239 loncom/interface/lonmeta.pm:1.240
--- loncom/interface/lonmeta.pm:1.239	Mon Dec 14 14:39:23 2009
+++ loncom/interface/lonmeta.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.239 2009/12/14 14:39:23 bisitz Exp $
+# $Id: lonmeta.pm,v 1.240 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -638,7 +638,7 @@
             
             if ($values) {
                 if ($only_one) {
-                    $output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options));
+                    $output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,\%meta_options));
                 } else {
                     $output .= (&Apache::loncommon::multiple_select_form('new_'.$type,\@cur_values_inst,undef,\%meta_options));
                 }
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.152 loncom/interface/lonmsgdisplay.pm:1.153
--- loncom/interface/lonmsgdisplay.pm:1.152	Sun Jun  6 01:17:08 2010
+++ loncom/interface/lonmsgdisplay.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.152 2010/06/06 01:17:08 www Exp $
+# $Id: lonmsgdisplay.pm,v 1.153 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -225,18 +225,18 @@
    <table border="0" cellspacing="2" cellpadding="8">
     <tr>
      <td><b>'.$lt{'fold'}.'</b><br />'."\n".
-         &Apache::loncommon::select_form($folder,'folder',%formhash).'
+         &Apache::loncommon::select_form($folder,'folder',\%formhash).'
      </td>
      <td><b>'.$lt{'show'}.'</b><br />'."\n".
          &Apache::loncommon::select_form($env{'form.interdis'},'interdis',
-					 %show).'
+					 \%show).'
      </td>
      <td><b>'.$lt{'status'}.'</b><br />'."\n".
-       &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).'
+       &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
      </td>
      <td><b>'.$lt{'actn'}.'</b><br />'."\n".'
          <span class="LC_nobreak">'.
-         &Apache::loncommon::select_form('view','folderaction',%actions).
+         &Apache::loncommon::select_form('view','folderaction',\%actions).
          ' <input type="button" value="'.$lt{'go'}.
          '" onclick="javascript:folder_choice(this.form,'."'change'".');" />
          </span>
@@ -1257,7 +1257,7 @@
             $userfolders{$key} = $key;
         }
         $userfolders{''} = "";
-        $r->print(&Apache::loncommon::select_form('','movetofolder',%userfolders).
+        $r->print(&Apache::loncommon::select_form('','movetofolder',\%userfolders).
                   '</td>');
     }
     $r->print('<td>'.
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.495 loncom/interface/lonparmset.pm:1.496
--- loncom/interface/lonparmset.pm:1.495	Tue Apr 13 21:47:24 2010
+++ loncom/interface/lonparmset.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.495 2010/04/13 21:47:24 raeburn Exp $
+# $Id: lonparmset.pm,v 1.496 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2989,7 +2989,7 @@
     my %select = ((map {$_ => $_} (0..$max)),
               'select_form_order' => [0..$max]);
     $result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey,
-                           %select);
+                           \%select);
     $result .= ' '.&mt($name);
     }
     $result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />';
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.94 loncom/interface/lonpickcourse.pm:1.95
--- loncom/interface/lonpickcourse.pm:1.94	Tue Mar 16 05:11:40 2010
+++ loncom/interface/lonpickcourse.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a course
 #
-# $Id: lonpickcourse.pm,v 1.94 2010/03/16 05:11:40 raeburn Exp $
+# $Id: lonpickcourse.pm,v 1.95 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -145,7 +145,8 @@
         my $filterlist = ['domainfilter'];
         # created filter for DCs only
         if ($env{'user.adv'} && $env{'form.domainfilter'} &&
-            exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})) {
+            exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})
+            && $env{'form.form'} ne 'portform') {
             my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'form.domainfilter'});
             if ($loncaparev ne 'unknown_cmd') {
                 push(@{$filterlist},'createdfilter');
@@ -802,7 +803,7 @@
         return &Apache::loncommon::select_form( 
                             $filter->{$item},
                             $item,
-                            (      '-1' => '',
+                            {      '-1' => '',
                                 '86400' => &mt('today'),
                                '604800' => &mt('last week'),
                               '2592000' => &mt('last month'),
@@ -811,7 +812,7 @@
                              '31104000' => &mt('last year'),
                     'select_form_order' =>
                            ['-1','86400','604800','2592000','7776000',
-                            '15552000','31104000']));
+                            '15552000','31104000']});
     }
 }
 
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.323 loncom/interface/lonsearchcat.pm:1.324
--- loncom/interface/lonsearchcat.pm:1.323	Tue May  4 17:16:34 2010
+++ loncom/interface/lonsearchcat.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.323 2010/05/04 17:16:34 bisitz Exp $
+# $Id: lonsearchcat.pm,v 1.324 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2970,13 +2970,13 @@
                   .&mt('Sort by:').' '
                   .&Apache::loncommon::select_form($env{'form.sortfield'},
                                                       'sortfield',
-                                                      %sort_fields)
+                                                      \%sort_fields)
                   .' '
                   .&Apache::loncommon::select_form($env{'form.sortorder'},
                                                       'sortorder',
-                                                      (asc =>&mt('Ascending'),
+                                                      {asc =>&mt('Ascending'),
                                                        desc=>&mt('Descending')
-                                                       ))
+                                                       })
                   .'</span>';
     ##
     ## Display links for 'prev' and 'next' pages (if necessary) and Display Options
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.107 loncom/interface/slotrequest.pm:1.108
--- loncom/interface/slotrequest.pm:1.107	Thu May 27 04:44:33 2010
+++ loncom/interface/slotrequest.pm	Sun Jun  6 02:40:30 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.107 2010/05/27 04:44:33 raeburn Exp $
+# $Id: slotrequest.pm,v 1.108 2010/06/06 02:40:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1169,11 +1169,11 @@
 						    6,\%stu_display_fields,
 						    \@stu_display_order).'
            </td>
-           <td valign="top">'.&Apache::loncommon::select_form($when,'when',%when_fields).
+           <td valign="top">'.&Apache::loncommon::select_form($when,'when',\%when_fields).
           '</td>
            <td valign="top">'.&Apache::loncommon::select_form($name_filter_type,
 						 'name_filter_type',
-						 %name_filter_type_fields).
+						 \%name_filter_type_fields).
 	      '<br />'.
 	      &Apache::lonhtmlcommon::textbox('name_filter_value',
 					      $env{'form.name_filter_value'},
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.634 loncom/homework/grades.pm:1.635
--- loncom/homework/grades.pm:1.634	Mon May  3 10:51:22 2010
+++ loncom/homework/grades.pm	Sun Jun  6 02:40:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.634 2010/05/03 10:51:22 foxr Exp $
+# $Id: grades.pm,v 1.635 2010/06/06 02:40:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8537,6 +8537,14 @@
 
 sub selectfield {
    my ($full)=@_;
+   my %options = 
+          (&Apache::lonlocal::texthash(
+             'yes'       => 'with submissions',
+             'queued'    => 'in grading queue',
+             'graded'    => 'with ungraded submissions',
+             'incorrect' => 'with incorrect submissions',
+             'all'       => 'with any status'),
+             'select_form_order' => ['yes','queued','graded','incorrect','all']);
    my $result='<div class="LC_columnSection">
   
     <fieldset>
@@ -8565,14 +8573,7 @@
       <legend>
         '.&mt('Submission Status').'
       </legend>'.
-       &Apache::loncommon::select_form('all','submitonly',
-          (&Apache::lonlocal::texthash(
-             'yes'       => 'with submissions',
-             'queued'    => 'in grading queue',
-             'graded'    => 'with ungraded submissions',
-             'incorrect' => 'with incorrect submissions',
-             'all'       => 'with any status'),
-             'select_form_order' => ['yes','queued','graded','incorrect','all'])).
+       &Apache::loncommon::select_form('all','submitonly',\%options).
    '</fieldset>';
     }
     $result.='</div><br />';
@@ -8697,8 +8698,8 @@
     my $pcorrect=&mt("Percentage points for correct solution");
     my $pincorrect=&mt("Percentage points for incorrect solution");
     my $selectform=&Apache::loncommon::select_form($env{'form.upfiletype'},'upfiletype',
-						   ('iclicker' => 'i>clicker',
-                                                    'interwrite' => 'interwrite PRS'));
+						   {'iclicker' => 'i>clicker',
+                                                    'interwrite' => 'interwrite PRS'});
     $symb = &Apache::lonenc::check_encrypt($symb);
     $result.= &Apache::lonhtmlcommon::scripttag(<<ENDUPFORM);
 function sanitycheck() {
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.31 loncom/homework/lonsimpleproblemedit.pm:1.32
--- loncom/homework/lonsimpleproblemedit.pm:1.31	Wed Jan 27 23:26:09 2010
+++ loncom/homework/lonsimpleproblemedit.pm	Sun Jun  6 02:40:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Problem Parameter Setting "Editor"
 #
-# $Id: lonsimpleproblemedit.pm,v 1.31 2010/01/27 23:26:09 raeburn Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.32 2010/06/06 02:40:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -137,11 +137,11 @@
     my $selectvalue=&Apache::loncommon::select_form(
                         $value,
                         'value'.$number,
-                        %values);
+                        \%values);
     my $selectposition=&Apache::loncommon::select_form(
                            $position,
                            'position'.$number,
-                           &Apache::lonlocal::texthash(%positions));
+                           {&Apache::lonlocal::texthash(%positions)});
     my $text=$qparms{$prefix.'text'.$number};
     my %lt=&Apache::lonlocal::texthash('foil'  => 'Foil',
 				       'value' => 'Value',
@@ -309,7 +309,7 @@
            .&Apache::loncommon::select_form(
                 $qtype,
                 'questiontype',
-                &Apache::lonlocal::texthash(%questiontypes))
+                {&Apache::lonlocal::texthash(%questiontypes)})
            .'</fieldset>'
         );
         $r->print(
@@ -343,7 +343,7 @@
                       &Apache::loncommon::select_form(
                           $randomize,
                           'randomize',
-                          &Apache::lonlocal::texthash(%randomizes)).
+                          {&Apache::lonlocal::texthash(%randomizes)}).
 		  '</td></tr><tr><td bgcolor="#F0F0F0">');
 # Option Response: Options
 	    if ($qtype eq 'option') {
@@ -356,7 +356,7 @@
                   $options.'" />'.&mt('Add new option').': '.
           '<input type="text" name="newopt" size="15" />'.
           &mt('Delete an option').': '.
-          &Apache::loncommon::select_form('','delopt',('' => '',%optionshash)).
+          &Apache::loncommon::select_form('','delopt',{'' => '',%optionshash}).
           '</td></tr><tr><td>');
 	    }
 # Foils
@@ -389,7 +389,7 @@
                       &Apache::loncommon::select_form(
                           $stringtype,
                           'stringtype',
-                          &Apache::lonlocal::texthash(%stringtypes)).
+                          {&Apache::lonlocal::texthash(%stringtypes)}).
 		  '</td></tr></table><br />');
 # Hint
 	    $r->print(&hint());
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.509 loncom/xml/lonxml.pm:1.510
--- loncom/xml/lonxml.pm:1.509	Sat Jun  5 19:37:01 2010
+++ loncom/xml/lonxml.pm	Sun Jun  6 02:40:40 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.509 2010/06/05 19:37:01 www Exp $
+# $Id: lonxml.pm,v 1.510 2010/06/06 02:40:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1464,7 +1464,7 @@
            &Apache::loncommon::select_form(
                $env{'form.languages'},
                'languages',
-               &Apache::lonlocal::texthash(%langchoices)).
+               {&Apache::lonlocal::texthash(%langchoices)}).
            '</span>';
     }
     $output .=
@@ -1473,11 +1473,11 @@
        &Apache::loncommon::select_form(
            $env{'form.texengine'},
            'texengine',
-           &Apache::lonlocal::texthash
+           {&Apache::lonlocal::texthash
                (''        => '',
                 'tth'     => 'tth (TeX to HTML)',
                 'jsMath'  => 'jsMath',
-                'mimetex' => 'mimetex (Convert to Images)')).
+                'mimetex' => 'mimetex (Convert to Images)')}).
      '</span>';
     return $output;
 }
Index: loncom/publisher/lonrights.pm
diff -u loncom/publisher/lonrights.pm:1.29 loncom/publisher/lonrights.pm:1.30
--- loncom/publisher/lonrights.pm:1.29	Wed Dec  2 18:33:35 2009
+++ loncom/publisher/lonrights.pm	Sun Jun  6 02:40:44 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show and edit custom distribution rights
 #
-# $Id: lonrights.pm,v 1.29 2009/12/02 18:33:35 bisitz Exp $
+# $Id: lonrights.pm,v 1.30 2010/06/06 02:40:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -210,19 +210,19 @@
   $r->print(&Apache::loncommon::start_data_table_row().'<td align="right">');
   if ($constructmode) {
      $r->print(&Apache::loncommon::select_form('','action_0',
-                                  ('' => '',
-                                   'insertbelow' => &mt('Insert rule below'))));
+                                  {'' => '',
+                                   'insertbelow' => &mt('Insert rule below')}));
                                                 
   } else {
       $r->print('&nbsp;');
   }
   $r->print('</td><td>');
   if ($constructmode) {
-      $r->print(&Apache::loncommon::select_form
-                                 ($token->[2]->{'effect'},'effect_0',
-                                  &Apache::lonlocal::texthash
+      my %lt = &Apache::lonlocal::texthash
                                    ('allow' => 'allow',
-                                    'deny'  => 'deny')));
+                                    'deny'  => 'deny');
+      $r->print(&Apache::loncommon::select_form
+                                 ($token->[2]->{'effect'},'effect_0',\%lt));
   } else {
       $r->print($token->[2]->{'effect'});
   }
@@ -241,26 +241,28 @@
 # insert, delete, etc
 	  $r->print('<span class="LC_nobreak">'.$rulecounter.'. ');
           if ($constructmode) {
+             my %lt = &Apache::lonlocal::texthash
+                          ('' => '',
+                           'delete' => 'Delete this rule',
+                           'insertabove' => 'Insert rule above',
+                           'insertbelow' => 'Insert rule below',
+                           'moveup'      => 'Move rule up',
+                           'movedown'    => 'Move rule down'
+                           );
+
              $r->print(&Apache::loncommon::select_form(
-                    '','action_'.$rulecounter,
-                    &Apache::lonlocal::texthash
-                    ('' => '', 
-                     'delete' => 'Delete this rule',
-                     'insertabove' => 'Insert rule above',
-                     'insertbelow' => 'Insert rule below',
-                     'moveup'      => 'Move rule up',
-                     'movedown'    => 'Move rule down')));
+                    '','action_'.$rulecounter,\%lt));
 	  }
           $r->print('</span></td>'.
 		    '<td rowspan="2">');
 # effect
           if ($constructmode) {
+             my %lt = &Apache::lonlocal::texthash
+                             ('allow' => 'allow',
+                              'deny'  => 'deny');
              $r->print(&Apache::loncommon::select_form
                                  ($token->[2]->{'effect'},
-                                  'effect_'.$rulecounter,
-                                  &Apache::lonlocal::texthash
-                                   ('allow' => 'allow',
-                                    'deny'  => 'deny')));
+                                  'effect_'.$rulecounter,\%lt));
           } else {
              $r->print($token->[2]->{'effect'});
           }
@@ -269,11 +271,11 @@
 	  $r->print('</td><td rowspan="2">');
 	  my $type = ($token->[2]{'type'} || 'course');
           if ($constructmode) {
+              my %lt = &Apache::lonlocal::texthash
+                           ('course' => 'Course',
+                            'user'   => 'User');
               $r->print(&Apache::loncommon::select_form($type,
-							'type_'.$rulecounter,
-                            &Apache::lonlocal::texthash
-							('course' => 'Course',
-							 'user'   => 'User')));
+							'type_'.$rulecounter,\%lt));
           } else {
               $r->print($type);
           }
@@ -328,7 +330,7 @@
 		  my $role=$token->[2]->{'role'};
 		  unless ($role) { $role=''; }
 		  $r->print(&Apache::loncommon::select_form(
-							    $role,'role_'.$rulecounter,%hash));
+							    $role,'role_'.$rulecounter,\%hash));
 	      } else {
 		  $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'}));
 	      }

--raeburn1275792045--