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

raeburn raeburn at source.lon-capa.org
Sun Sep 2 11:22:30 EDT 2018


raeburn		Sun Sep  2 15:22:30 2018 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    Backport 1.327, 1.329, 1.330, 1.331, 1.332, 1.333, 1.334 (part)
  
  
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.86 loncom/interface/domainprefs.pm:1.160.6.87
--- loncom/interface/domainprefs.pm:1.160.6.86	Tue Oct 17 14:07:23 2017
+++ loncom/interface/domainprefs.pm	Sun Sep  2 15:22:28 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.86 2017/10/17 14:07:23 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.87 2018/09/02 15:22:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1278,7 +1278,7 @@
             } else {
                 $datatable .= '<input type="file" name="loginheadtag_'.$lonhost.'" />';
             }
-            $datatable .= '</td><td><input type="textbox" name="loginheadtagexempt_'.$lonhost.'" value="'.$exempt.'" /></td></tr>';
+            $datatable .= '</td><td><input type="text" name="loginheadtagexempt_'.$lonhost.'" value="'.$exempt.'" /></td></tr>';
         }
         $datatable .= '</table></td></tr>';
     }
@@ -1438,7 +1438,7 @@
     my $datatable = '<tr'.$css_class.'>'.
         '<td>'.$choices->{'font'}.'</td>';
     if (!$is_custom->{'font'}) {
-        $datatable .=  '<td>'.&mt('Default in use:').' <span id="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>';
+        $datatable .=  '<td>'.&mt('Default in use:').' <span class="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>';
     } else {
         $datatable .= '<td> </td>';
     }
@@ -1447,12 +1447,12 @@
     $datatable .= '<td><span class="LC_nobreak">'.
                   '<input type="text" class="colorchooser" size="10" name="'.$role.'_font"'.
                   ' value="'.$current_color.'" /> '.
-                  ' </td></tr>';
+                  ' </span></td></tr>';
     unless ($role eq 'login') { 
         $datatable .= '<tr'.$css_class.'>'.
                       '<td>'.$choices->{'fontmenu'}.'</td>';
         if (!$is_custom->{'fontmenu'}) {
-            $datatable .=  '<td>'.&mt('Default in use:').' <span id="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
+            $datatable .=  '<td>'.&mt('Default in use:').' <span class="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
         } else {
             $datatable .= '<td> </td>';
         }
@@ -1462,7 +1462,7 @@
                       '<input class="colorchooser" type="text" size="10" name="'
 		      .$role.'_fontmenu"'.
                       ' value="'.$current_color.'" /> '.
-                      ' </td></tr>';
+                      ' </span></td></tr>';
     }
     my $switchserver = &check_switchserver($dom,$confname);
     foreach my $img (@{$images}) {
@@ -1579,7 +1579,7 @@
     my $bgs_def;
     foreach my $item (@{$bgs}) {
         if (!$is_custom->{$item}) {
-            $bgs_def .= '<td><span class="LC_nobreak">'.$choices->{$item}.'</span> <span id="css_default_'.$role.'_'.$item.'" style="background-color: '.$defaults->{'bgs'}{$item}.';">   </span><br />'.$defaults->{'bgs'}{$item}.'</td>';
+            $bgs_def .= '<td><span class="LC_nobreak">'.$choices->{$item}.'</span> <span class="css_default_'.$role.'_'.$item.'" style="background-color: '.$defaults->{'bgs'}{$item}.';">   </span><br />'.$defaults->{'bgs'}{$item}.'</td>';
         }
     }
     if ($bgs_def) {
@@ -1607,7 +1607,7 @@
     my $links_def;
     foreach my $item (@{$links}) {
         if (!$is_custom->{$item}) {
-            $links_def .= '<td>'.$choices->{$item}.'<br /><span id="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'links'}{$item}.';">'.$defaults->{'links'}{$item}.'</span></td>';
+            $links_def .= '<td>'.$choices->{$item}.'<br /><span class="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'links'}{$item}.';">'.$defaults->{'links'}{$item}.'</span></td>';
         }
     }
     if ($links_def) {
@@ -1693,17 +1693,15 @@
     my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
     my $output;
     if ($img eq 'login') {
-            # suppress image for Log-in header
+        $output = '</td><td>'.$logincolors; # suppress image for Log-in header
     } elsif (!$is_custom) {
         if ($img ne 'domlogo') {
-            $output .= &mt('Default image:').'<br />';
+            $output = &mt('Default image:').'<br />';
         } else {
-            $output .= &mt('Default in use:').'<br />';
+            $output = &mt('Default in use:').'<br />';
         }
     }
-    if ($img eq 'login') { # suppress image for Log-in header
-        $output .= '<td>'.$logincolors;
-    } else {
+    if ($img ne 'login') {
         if ($img_import) {
             $output .= '<input type="hidden" name="'.$role.'_import_'.$img.'" value="'.$imgfile.'" />';
         }
@@ -2314,7 +2312,7 @@
         $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
     }
     $datatable .= '</select> '."\n".
-                  '<input type="checkbox" name="'.$type.'_addbook" value="1" />'.&mt('Add').'</td>'."\n".
+                  '<input type="checkbox" name="'.$type.'_addbook" value="1" />'.&mt('Add').'</span></td>'."\n".
                   '<td colspan="2">'.
                   '<span class="LC_nobreak">'.&mt('Subject:').'<input type="text" size="15" name="'.$type.'_addbook_subject" value="" /></span> '."\n".
                   (' 'x2).
@@ -2331,13 +2329,13 @@
         } else {
             $datatable .= '<input type="file" name="'.$type.'_addbook_image" value="" />';
         }
+        $datatable .= '</span>'."\n";
     }
-    $datatable .= '</span>'."\n".
-                  '<span class="LC_nobreak">'.&mt('LON-CAPA course:').' '.
+    $datatable .= '<span class="LC_nobreak">'.&mt('LON-CAPA course:').' '.
                   &Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom').
                   '<input type="text" size="25" name="'.$type.'_addbook_cnum" value="" />'.
                   &Apache::loncommon::selectcourse_link
-                      ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course');
+                      ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course').
                   '</span></td>'."\n".
                   '</tr>'."\n";
     $itemcount ++;
@@ -2516,7 +2514,7 @@
                   '<td>'.&mt('Failsafe for no drops when institutional data missing').'</td>'.
                   '<td class="LC_right_item"><span class="LC_nobreak">'.
                   '<input type="text" name="autoenroll_failsafe"'.
-                  ' value="'.$failsafe.'" size="4" /></td></tr>';
+                  ' value="'.$failsafe.'" size="4" /></span></td></tr>';
     $$rowtotal += 4;
     return $datatable;
 }
@@ -2943,7 +2941,7 @@
                               'value="'.$bccemails{$type}.'"  /></fieldset>'.
                               '<fieldset><legend>'.&mt('Optional added text').'</legend>'.
                               &mt('Text automatically added to e-mail:').' '.
-                              '<input type="text" name="'.$type.'_includestr" value="'.$includestr{$type}.'" /><br >'.
+                              '<input type="text" name="'.$type.'_includestr" value="'.$includestr{$type}.'" /><br />'.
                               '<span class="LC_nobreak">'.&mt('Location:').' '.
                               '<label><input type="radio" name="'.$type.'_includeloc" value="s"'.$locchecked{'s'}.' />'.&mt('in subject').'</label>'.
                               (' 'x2).
@@ -3004,7 +3002,7 @@
                     if ($currfield{$field} eq 'no') {
                         $display = ' style="display:none"';
                     }
-                    $datatable .= '</td></tr><tr id="help_screenshotsize"'.$display.' />'.
+                    $datatable .= '</td></tr><tr id="help_screenshotsize"'.$display.'>'.
                                   '<td>'.&mt('Maximum size for upload (MB)').'</td><td>'.
                                   '<input type="text" size="5" name="helpform_maxsize" value="'.$maxsize.'" />';
                 }
@@ -3210,7 +3208,9 @@
                                                                 \@templateroles,$newcust).
                       &Apache::lonuserutils::custom_role_table('Course',\%full,\%levels,
                                                                \%levelscurrent,$newcust).
-                      '</fieldset></td></tr>';
+                      '</fieldset>'.
+                      &helpsettings_javascript(\@roles_by_num,$maxnum,$hiddenstr,$formname).
+                      '</td></tr>';
         $count ++;
         $$rowtotal += $count;
     }
@@ -3927,7 +3927,7 @@
                               '</label></span> ';
             }
         } elsif ($item eq 'markup') {
-            $datatable .= '<textarea name="'.$caller.'_validation_markup" cols="50" rows="5" wrap="soft">'.
+            $datatable .= '<textarea name="'.$caller.'_validation_markup" cols="50" rows="5">'.
                            $currvalidation{$item}.
                               '</textarea>';
         }
@@ -3949,7 +3949,7 @@
         my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
                                                        'validationdc',%currhash);
         my $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
-        $datatable .= '</td></tr><tr'.$css_class.'><td>';
+        $datatable .= '<tr'.$css_class.'><td>';
         if ($numdc > 1) {
             $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)');
         } else {
@@ -5042,7 +5042,7 @@
         $datatable .= '<tr'.$css_class.'>'.
                      '<td class="LC_left_item">'.&mt('Mapping of Shibboleth environment variable names to user data fields (SSO auth)').'</td>'.
                      '<td class="LC_left_item">'."\n".
-                     '<table><tr><td>'."\n";
+                     '<table>'."\n";
         for (my $i=0; $i<@fields; $i++) {
             $rem = $i%($numperrow);
             if ($rem == 0) {
@@ -5525,7 +5525,7 @@
                                    1 => 'Yes, allow login then update passwd file using default cost (if higher)',
                                    2 => 'Yes, disallow login if stored cost is less than domain default',
                                  );
-                $datatable .= '<table wisth="100%">';
+                $datatable .= '<table width="100%">';
                 foreach my $option (@options) {
                     my $checked = ' ';
                     my $onclick;
@@ -5876,7 +5876,7 @@
                              '<input type="radio" name="coursecat_'.$item.'" value="'.$type.'"'.$ischecked.
                              ' />'.$lt{$type}.'</label> ';
            }
-           $datatable .= '</td></tr>';
+           $datatable .= '</span></td></tr>';
            $itemcount ++;
         }
         $$rowtotal += $itemcount;
@@ -6087,7 +6087,7 @@
                 $datatable .= &initialize_categories($itemcount);
             }
         } else {
-            $datatable .= '<td class="LC_right_item">'.$hdritem->{'header'}->[1]->{'col2'}.'</td>'
+            $datatable .= '<tr><td class="LC_right_item">'.$hdritem->{'header'}->[1]->{'col2'}.'</td></tr>'
                           .&initialize_categories($itemcount);
         }
         $$rowtotal += $itemcount;
@@ -6135,7 +6135,7 @@
                       '<span class="LC_nobreak">'.
                       '<input type="text" name="'.$type.'_machines" '.
                       'value="'.$machineaccess{$type}.'" size="10" />'.
-                      '</td></tr>'."\n";
+                      '</span></td></tr>'."\n";
     }
     $$rowtotal += $rownum;
     return $datatable;
@@ -6360,7 +6360,7 @@
     my $select1 = '';
     foreach my $default ('instcode','communities') {
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
-        $chgstr = ' onchange="javascript:reorderCats(this.form,'."'',$default"."_pos','0'".');"';
+        $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','0'".');"';
         if ($default eq 'communities') {
             $select1 = $select0;
             $select0 = '';
@@ -6385,8 +6385,9 @@
                   .'<option value="0">1</option>'
                   .'<option value="1">2</option>'
                   .'<option value="2" selected="selected">3</option></select> '
-                  .&mt('Add category').'</td><td>'.&mt('Name:')
-                  .' <input type="text" size="20" name="addcategory_name" value="" /></td></tr>';
+                  .&mt('Add category').'</span></td><tda<span class="LC_nobreak">>'.&mt('Name:')
+                  .' <input type="text" size="20" name="addcategory_name" value="" /></span>'
+                  .'</td></tr>';
     return $datatable;
 }
 
@@ -6441,7 +6442,7 @@
                             pop(@{$path});
                         }
                     } else {
-                        $text .= &mt('Add subcategory:').' </span><input type="textbox" size="20" name="addcategory_name_';
+                        $text .= &mt('Add subcategory:').' </span><input type="text" size="20" name="addcategory_name_';
                         if ($j == $numchildren) {
                             $text .= $name;
                         } else {
@@ -6464,7 +6465,7 @@
                 my $colspan;
                 if ($parent ne 'instcode') {
                     $colspan = $maxdepth - $depth - 1;
-                    $text .= '<td colspan="'.$colspan.'">'.&mt('Add subcategory:').'<input type="textbox" size="20" name="subcat_'.$name.'" value="" /></td>';
+                    $text .= '<td colspan="'.$colspan.'">'.&mt('Add subcategory:').'<input type="text" size="20" name="subcat_'.$name.'" value="" /></td>';
                 }
             }
         }
@@ -6659,7 +6660,7 @@
         $rem = @{$types}%($numinrow);
     }
     my $colsleft = $numinrow - $rem;
-    if (($rem == 0) && (@{$types} > 0)) {
+    if ($rem == 0) {
         $output .= '<tr>';
     }
     if ($colsleft > 1) {


More information about the LON-CAPA-cvs mailing list