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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 13 Oct 2005 18:31:08 -0000


raeburn		Thu Oct 13 14:31:08 2005 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Responding to style police recommendations.
  Adding box for username -> e-mail conversion auth-based options.  
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.112 loncom/interface/lonhtmlcommon.pm:1.113
--- loncom/interface/lonhtmlcommon.pm:1.112	Tue Oct  4 15:59:15 2005
+++ loncom/interface/lonhtmlcommon.pm	Thu Oct 13 14:31:06 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.112 2005/10/04 19:59:15 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.113 2005/10/13 18:31:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1246,7 +1246,7 @@
 #
 # In general a &submit_row() call should proceed the call to &end_pick_box(),
 # as this routine adds a button for form submission.
-# &submit_row(0 does not require a &row_closure after it.
+# &submit_row() does not require a &row_closure after it.
 #  
 # &start_pick_box() creates a bounding table with 1-pixel wide black border.
 # rows should be placed between calls to &start_pick_box() and &end_pick_box.
@@ -1317,7 +1317,7 @@
 }
 
 sub row_closure {
-    my $output .= <<"ENDTWO";
+    my $output = <<"ENDTWO";
               </tr>
              </table>
             </td>
@@ -1336,9 +1336,9 @@
     my $output = &row_title($col_width,$tablecolor,$title);
     $output .= qq|               <td>
                                   <select name="roles" multiple >\n|;
-    foreach (@$roles) {
-        my $plrole=&Apache::lonnet::plaintext($_);
-        $output .= '  <option value="'.$_.'">'.$plrole.'</option>';
+    foreach my $role (@$roles) {
+        my $plrole=&Apache::lonnet::plaintext($role);
+        $output .= '  <option value="'.$role.'">'.$plrole.'</option>';
     }
     $output .= qq|                </select>
                                  </td>\n|;
@@ -1381,13 +1381,13 @@
             my @items = ();
             my @longitems = ();
             if ($$idlist{$$codetitles[0]} =~ /","/) {
-                @items = split/","/,$$idlist{$$codetitles[0]};
+                @items = split(/","/,$$idlist{$$codetitles[0]});
             } else {
                 $items[0] = $$idlist{$$codetitles[0]};
             }
             if (defined($$idlist_titles{$$codetitles[0]})) {
                 if ($$idlist_titles{$$codetitles[0]} =~ /","/) {
-                    @longitems = split/","/,$$idlist_titles{$$codetitles[0]};
+                    @longitems = split(/","/,$$idlist_titles{$$codetitles[0]});
                 } else {
                     $longitems[0] = $$idlist_titles{$$codetitles[0]};
                 }
@@ -1424,7 +1424,7 @@
     my $output = &row_title($col_width,$tablecolor,$title);
     $output .= qq|              <td>
                                     <select name="types" multiple>\n|;
-    foreach my $status_type (sort keys (%{$types})) {
+    foreach my $status_type (sort(keys(%{$types}))) {
         $output .= '  <option value="'.$status_type.'">'.$$types{$status_type}.'</option>';
     }
     $output .= qq|                   </select>
@@ -1437,13 +1437,13 @@
     my ($authtypes,$col_width,$tablecolor,$title,$descrip) = @_;
     my $output = &row_title($col_width,$tablecolor,$title);
     my @rowcols = ('#eeeeee','#dddddd');
-    $output .= '              <td>'.$descrip.'
-                               <table>
-                                <tr>
-                                 <td><b>'.&mt('Authentication Method').'</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>&nbsp;&nbsp;&nbsp;</td><td><b>'.&mt('Username -> e-mail conversion').'</b></td>
+    $output .= '              <td>'.$descrip;
+    $output .= &start_pick_box('50%'); 
+    $output .= '                <tr bgcolor="'.$tablecolor.'">
+                                 <td><b>'.&mt('Authentication Method').'</b></td><td align="right"><b>'.&mt('Username -> e-mail conversion').'</b></td>
                                 </tr>'."\n";
     my $rownum = 0;
-    foreach my $auth (sort keys (%{$authtypes})) {
+    foreach my $auth (sort(keys(%{$authtypes}))) {
         my ($userentry,$size);
         my $rowiter = $rownum%2;
         if ($auth =~ /^krb/) {
@@ -1453,11 +1453,11 @@
             $userentry = 'username@';
             $size = 15;
         }
-        $output .= '<tr rowcolor="'.$rowcols[$rowiter].'"><td>  '.$$authtypes{$auth}.'</td><td>&nbsp;&nbsp;&nbsp;</td><td align="right">'.$userentry.'</td><td><input type="text" name="'.$auth.'" size="'.$size.'" /></td></tr>';
+        $output .= '<tr bgcolor="'.$rowcols[$rowiter].'"><td>  '.$$authtypes{$auth}.'</td><td align="right">'.$userentry.'<input type="text" name="'.$auth.'" size="'.$size.'" /></td></tr>';
         $rownum ++;
     }
-    $output .= "                   </table>
-                                  </td>\n";
+    $output .= &end_pick_box();
+    $output .= "                   <br /></td>\n"; 
     $output .= &row_closure();
     return $output;
 }
@@ -1465,7 +1465,7 @@
 
 sub submit_row {
     my ($col_width,$tablecolor,$title,$cmd,$submit_text) = @_;
-    my $output .= &row_title($col_width,$tablecolor,$title);
+    my $output = &row_title($col_width,$tablecolor,$title);
     $output .= qq|
             <td width="100%" valign="top" align="right">
              <br />