Diff for /loncom/interface/courseprefs.pm between versions 1.104 and 1.106

version 1.104, 2022/02/16 15:58:28 version 1.106, 2022/03/12 21:24:17
Line 2815  function toggleLinkProtReqUser(form,item Line 2815  function toggleLinkProtReqUser(form,item
     }      }
     return;      return;
 }  }
   
   function uncheckLinkProtMakeVis(item,num) {
       if (document.getElementById('linkprot_'+item+'_'+num)) {
           var currtype = document.getElementById('linkprot_'+item+'_'+num).type;
           if (currtype.toLowerCase() == 'checkbox') {
               document.getElementById('linkprot_'+item+'_'+num).checked = false;
           }
       }
       return;
   }
 ENDSCRIPT  ENDSCRIPT
   
 }  }
Line 5623  sub menucollections_display { Line 5633  sub menucollections_display {
   
 sub print_linkprotection {  sub print_linkprotection {
     my ($cdom,$cnum,$settings,$rowtotal,$crstype,$noedit,$context) = @_;      my ($cdom,$cnum,$settings,$rowtotal,$crstype,$noedit,$context) = @_;
     unless (ref($settings) eq 'HASH') {  
         return;  
     }  
   
     my %linkprotection;      my %linkprotection;
     my $count = 0;      my $count = 0;
Line 5670  sub print_linkprotection { Line 5677  sub print_linkprotection {
         }          }
     }      }
   
     if (ref($settings->{'linkprot'}) eq 'HASH') {      if ((ref($settings) eq 'HASH') && (ref($settings->{'linkprot'}) eq 'HASH')) {
         if (keys(%{$settings->{'linkprot'}})) {          if (keys(%{$settings->{'linkprot'}})) {
             my @current = sort { $a <=> $b } keys(%{$settings->{'linkprot'}});              my @current = sort { $a <=> $b } keys(%{$settings->{'linkprot'}});
             $next += $current[-1];              $next += $current[-1];
Line 5767  sub print_linkprotection { Line 5774  sub print_linkprotection {
                                       '</label>&nbsp;&nbsp;</span><div id="linkprot_divchgsecret_'.$i.'" style="display:none" />'.                                        '</label>&nbsp;&nbsp;</span><div id="linkprot_divchgsecret_'.$i.'" style="display:none" />'.
                                       '<span class="LC_nobreak">'.&mt('New Secret').':'.                                        '<span class="LC_nobreak">'.&mt('New Secret').':'.
                                       '<input type="password" size="20" name="linkprot_secret_'.$i.'" value="" autocomplete="off"'.$disabled.' />'.                                        '<input type="password" size="20" name="linkprot_secret_'.$i.'" value="" autocomplete="off"'.$disabled.' />'.
                                       '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.linkprot_secret_'.$i.'.type='."'text'".' } else { this.form.linkprot_secret_'.$i.'.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label>'.                                        '<label><input type="checkbox" name="linkprot_visible_'.$i.'" id="linkprot_visible_'.$i.'" onclick="if (this.checked) { this.form.linkprot_secret_'.$i.'.type='."'text'".' } else { this.form.linkprot_secret_'.$i.'.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label>'.
                                       '<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span></div>';                                        '<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span></div>';
                     } else {                      } else {
                         $datatable .=                          $datatable .=
                             '<span class="LC_nobreak">'.$desc{'secret'}.':'.                              '<span class="LC_nobreak">'.$desc{'secret'}.':'.
                             '<input type="password" size="20" name="linkprot_secret_'.$i.'" value="" autocomplete="off"'.$disabled.' />'.                              '<input type="password" size="20" name="linkprot_secret_'.$i.'" value="" autocomplete="off"'.$disabled.' />'.
                             '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.linkprot_secret_'.$i.'.type='."'text'".' } else { this.form.linkprot_secret_'.$i.'.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label>'.                              '<label><input type="checkbox" name="linkprot_visible_'.$i.'" id="linkprot_visible_'.$i.'" onclick="if (this.checked) { this.form.linkprot_secret_'.$i.'.type='."'text'".' } else { this.form.linkprot_secret_'.$i.'.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label>'.
                             '<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span>';                              '<input type="hidden" name="linkprot_id_'.$i.'" value="'.$num.'" /></span>';
                     }                      }
                 }                  }
Line 5793  sub print_linkprotection { Line 5800  sub print_linkprotection {
     $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".      $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".
                   '<input type="hidden" name="linkprot_maxnum" value="'.$next.'" />'."\n".                    '<input type="hidden" name="linkprot_maxnum" value="'.$next.'" />'."\n".
                   '<input type="checkbox" name="linkprot_add" value="1"'.$disabled.' />'.&mt('Add').'</span></td>'."\n".                    '<input type="checkbox" name="linkprot_add" value="1"'.$disabled.' />'.&mt('Add').'</span></td>'."\n".
                   '<td>';                    '<td width="100%">';
     my ($usersty,$onclickrequser,%checkedrequser);      my ($usersty,$onclickrequser,%checkedrequser);
     if ($ltiauth) {      if ($ltiauth) {
         $usersty = 'display:none';          $usersty = 'display:none';
Line 5825  sub print_linkprotection { Line 5832  sub print_linkprotection {
         $datatable .= '<span class="LC_nobreak">'.$desc{'key'}.':<input type="text" size="25" name="linkprot_key_add" value="" autocomplete="off"'.$disabled.' /></span> '."\n".          $datatable .= '<span class="LC_nobreak">'.$desc{'key'}.':<input type="text" size="25" name="linkprot_key_add" value="" autocomplete="off"'.$disabled.' /></span> '."\n".
                       ('&nbsp;'x2).                        ('&nbsp;'x2).
                       '<span class="LC_nobreak">'.$desc{'secret'}.':<input type="password" size="20" name="linkprot_secret_add" value="" autocomplete="off"'.$disabled.' />'.                        '<span class="LC_nobreak">'.$desc{'secret'}.':<input type="password" size="20" name="linkprot_secret_add" value="" autocomplete="off"'.$disabled.' />'.
                       '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.linkprot_secret_add.type='."'text'".' } else { this.form.linkprot_secret_add.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n";                        '<label><input type="checkbox" name="linkprot_visible_add" id="linkprot_visible_add" onclick="if (this.checked) { this.form.linkprot_secret_add.type='."'text'".' } else { this.form.linkprot_secret_add.type='."'password'".' }"'.$disabled.' />'.&mt('Visible input').'</label></span> '."\n";
     }      }
     if ($ltiauth) {      if ($ltiauth) {
         $datatable .= '</fieldset>'.          $datatable .= '</fieldset>'.

Removed from v.1.104  
changed lines
  Added in v.1.106


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>