Diff for /loncom/interface/domainprefs.pm between versions 1.34 and 1.40

version 1.34, 2007/12/12 19:44:53 version 1.40, 2008/01/04 17:47:51
Line 281  sub handler { Line 281  sub handler {
               ' />  '.                ' />  '.
               '<input type="button" value="uncheck all" '.                '<input type="button" value="uncheck all" '.
               'onclick="javascript:uncheckAll(document.pickactions.actions)"'.                'onclick="javascript:uncheckAll(document.pickactions.actions)"'.
               ' /></p>');                ' /></p><div class="LC_left_float">');
           my ($numitems,$midpoint,$seconddiv,$count); 
           $numitems = @prefs_order;
           $midpoint = int($numitems/2);
           if ($numitems%2) {
               $midpoint ++;
           }
           $count = 0;
         foreach my $item (@prefs_order) {          foreach my $item (@prefs_order) {
             $r->print('<p><label><input type="checkbox" name="actions" value="'.$item.'" />&nbsp;'.$prefs{$item}->{'text'}.'</label></p>');              $r->print('<h4><label><input type="checkbox" name="actions" value="'.$item.'" />&nbsp;'.$prefs{$item}->{'text'}.'</label></h4>');
               $count ++;
               if ((!$seconddiv) && ($count >= $midpoint)) {
                   $r->print('</div>'."\n".'<div class="LC_left_float">'."\n");
                   $seconddiv = 1;
               }
         }          }
         $r->print('<h3>'.&mt('Display options').'</h3>'."\n".          $r->print('</div><div class="LC_clear_float_footer"></div><h3>'.
                     &mt('Display options').'</h3>'."\n".
                   '<p><span class="LC_nobreak">'.&mt('Display using: ')."\n".                    '<p><span class="LC_nobreak">'.&mt('Display using: ')."\n".
                   '<label><input type="radio" name="numcols" value="1">'.                    '<label><input type="radio" name="numcols" value="1">'.
                   &mt('one column').'</label>&nbsp;&nbsp;'.                    &mt('one column').'</label>&nbsp;&nbsp;'.
Line 823  sub display_color_options { Line 836  sub display_color_options {
                 }                  }
             }              }
             if ($showfile) {              if ($showfile) {
                 $showfile = &Apache::loncommon::lonhttpdurl($showfile);                  if ($showfile =~ m{^/(adm|res)/}) {
                 $fullsize =  &Apache::loncommon::lonhttpdurl($imgfile);                      if ($showfile =~ m{^/res/}) {
                           my $local_showfile =
                               &Apache::lonnet::filelocation('',$showfile);
                           &Apache::lonnet::repcopy($local_showfile);
                       }
                       $showfile = &Apache::loncommon::lonhttpdurl($showfile);
                   }
                   if ($imgfile) {
                       if ($imgfile  =~ m{^/(adm|res)/}) {
                           if ($imgfile =~ m{^/res/}) {
                               my $local_imgfile =
                                   &Apache::lonnet::filelocation('',$imgfile);
                               &Apache::lonnet::repcopy($local_imgfile);
                           }
                           $fullsize = &Apache::loncommon::lonhttpdurl($imgfile);
                       } else {
                           $fullsize = $imgfile;
                       }
                   }
                 $datatable.= '<td>';                  $datatable.= '<td>';
                 if (!$is_custom->{$img}) {                  if (!$is_custom->{$img}) {
                     $datatable .= &mt('Default in use:').'<br />';                      $datatable .= &mt('Default in use:').'<br />';
Line 1022  sub print_autoenroll { Line 1053  sub print_autoenroll {
         }          }
     }      }
     my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1);      my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1);
       my $notif_sender;
       if (ref($settings) eq 'HASH') {
           $notif_sender = $settings->{'sender_uname'};
       }
     my $datatable='<tr class="LC_odd_row">'.      my $datatable='<tr class="LC_odd_row">'.
                   '<td>'.&mt('Auto-enrollment active?').'</td>'.                    '<td>'.&mt('Auto-enrollment active?').'</td>'.
                   '<td class="LC_right_item"><span class="LC_nobreak"><label>'.                    '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
Line 1034  sub print_autoenroll { Line 1069  sub print_autoenroll {
                   '</td><td class="LC_right_item"><span class="LC_nobreak">'.                    '</td><td class="LC_right_item"><span class="LC_nobreak">'.
                   &mt('username').':&nbsp;'.                    &mt('username').':&nbsp;'.
                   '<input type="text" name="sender_uname" value="'.                    '<input type="text" name="sender_uname" value="'.
                   $settings->{'sender_uname'}.                    $notif_sender.'" size="10" />&nbsp;&nbsp;'.&mt('domain').
                   '" size="10" />&nbsp;&nbsp;'.&mt('domain').  
                   ':&nbsp;'.$domform.'</span></td></tr>';                    ':&nbsp;'.$domform.'</span></td></tr>';
     $$rowtotal += 2;      $$rowtotal += 2;
     return $datatable;      return $datatable;
Line 1178  sub print_directorysrch { Line 1212  sub print_directorysrch {
     foreach my $title (@{$titleorder}) {      foreach my $title (@{$titleorder}) {
         if (defined($searchtitles->{$title})) {          if (defined($searchtitles->{$title})) {
             my $check = ' ';              my $check = ' ';
             if (ref($settings->{'searchby'}) eq 'ARRAY') {              if (ref($settings) eq 'HASH') { 
                 if (grep(/^\Q$title\E$/,@{$settings->{'searchby'}})) {                  if (ref($settings->{'searchby'}) eq 'ARRAY') {
                     $check = ' checked="checked" ';                      if (grep(/^\Q$title\E$/,@{$settings->{'searchby'}})) {
                           $check = ' checked="checked" ';
                       }
                 }                  }
             }              }
             $datatable .= '<td class="LC_left_item">'.              $datatable .= '<td class="LC_left_item">'.
Line 1331  sub print_usercreation { Line 1367  sub print_usercreation {
                 $rowcount ++;                  $rowcount ++;
             }              }
         }          }
           if ($rowcount == 0) {
               $datatable .= '<tr><td colspan="2">'.&mt('No format rules have been defined for usernames or IDs in this domain.').'</td></tr>';  
               $$rowtotal ++;
               $rowcount ++;
           }
     } elsif ($position eq 'middle') {      } elsif ($position eq 'middle') {
         my @creators = ('author','course');          my @creators = ('author','course');
           my ($rules,$ruleorder) =
               &Apache::lonnet::inst_userrules($dom,'username');
         my %lt = &usercreation_types();          my %lt = &usercreation_types();
         my %checked;          my %checked;
         if (ref($settings) eq 'HASH') {          if (ref($settings) eq 'HASH') {
Line 1363  sub print_usercreation { Line 1406  sub print_usercreation {
             $datatable .= '<tr'.$css_class.'>'.              $datatable .= '<tr'.$css_class.'>'.
                          '<td><span class="LC_nobreak">'.$lt{$item}.                           '<td><span class="LC_nobreak">'.$lt{$item}.
                          '</span></td><td align="right">';                           '</span></td><td align="right">';
             foreach my $option ('any','official','unofficial','none') {              my @options = ('any');
               if (ref($rules) eq 'HASH') {
                   if (keys(%{$rules}) > 0) {
                       push(@options,('official','unofficial'));
                   }
               }
               push(@options,'none');
               foreach my $option (@options) {
                 my $check = ' ';                  my $check = ' ';
                 if ($checked{$item} eq $option) {                  if ($checked{$item} eq $option) {
                     $check = ' checked="checked" ';                      $check = ' checked="checked" ';
Line 1391  sub print_usercreation { Line 1441  sub print_usercreation {
                     }                      }
                 }                  }
             }              }
           } else {
               foreach my $item (@contexts) {
                   foreach my $auth (@authtypes) {
                       $checked{$item}{$auth} = ' checked="checked" ';
                   }
               }
         }          }
         my @authtypes = ('int','krb4','krb5','loc');  
         my %title = &context_names();          my %title = &context_names();
         my %authname = &authtype_names();          my %authname = &authtype_names();
         my $rownum = 0;          my $rownum = 0;
Line 1446  sub user_formats_row { Line 1501  sub user_formats_row {
                     $output .= '<tr>';                      $output .= '<tr>';
                 }                  }
                 my $check = ' ';                  my $check = ' ';
                 if (ref($settings->{$type.'_rule'}) eq 'ARRAY') {                  if (ref($settings) eq 'HASH') {
                     if (grep(/^\Q$ruleorder->[$i]\E$/,@{$settings->{$type.'_rule'}})) {                      if (ref($settings->{$type.'_rule'}) eq 'ARRAY') {
                         $check = ' checked="checked" ';                          if (grep(/^\Q$ruleorder->[$i]\E$/,@{$settings->{$type.'_rule'}})) {
                               $check = ' checked="checked" ';
                           }
                     }                      }
                 }                  }
                 $output .= '<td class="LC_left_item">'.                  $output .= '<td class="LC_left_item">'.
Line 1703  sub usertype_update_row { Line 1760  sub usertype_update_row {
                     $datatable .= '<tr>';                      $datatable .= '<tr>';
                 }                  }
                 my $check = ' ';                  my $check = ' ';
                 if (ref($settings->{'fields'}) eq 'HASH') {                  if (ref($settings) eq 'HASH') {
                     if (ref($settings->{'fields'}{$type}) eq 'ARRAY') {                      if (ref($settings->{'fields'}) eq 'HASH') {
                         if (grep(/^\Q$fields->[$i]\E$/,@{$settings->{'fields'}{$type}})) {                          if (ref($settings->{'fields'}{$type}) eq 'ARRAY') {
                             $check = ' checked="checked" ';                              if (grep(/^\Q$fields->[$i]\E$/,@{$settings->{'fields'}{$type}})) {
                                   $check = ' checked="checked" ';
                               }
                         }                          }
                     }                      }
                 }                  }
Line 1863  sub modify_colors { Line 1922  sub modify_colors {
             }              }
         }          }
         my ($width,$height) = &thumb_dimensions();          my ($width,$height) = &thumb_dimensions();
           if (ref($domconfig->{$role}) ne 'HASH') {
               $domconfig->{$role} = {};
           }
         foreach my $img (@images) {          foreach my $img (@images) {
     if ( ! $env{'form.'.$role.'_'.$img.'.filename'}       if ( ! $env{'form.'.$role.'_'.$img.'.filename'} 
  && !defined($domconfig->{$role}{$img})   && !defined($domconfig->{$role}{$img})

Removed from v.1.34  
changed lines
  Added in v.1.40


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