Diff for /loncom/interface/domainprefs.pm between versions 1.93 and 1.99

version 1.93, 2009/04/22 14:09:13 version 1.99, 2009/08/02 07:21:18
Line 162  sub handler { Line 162  sub handler {
                                 col2 => 'Information settable when self-creating account (if directory data blank)'}],                                  col2 => 'Information settable when self-creating account (if directory data blank)'}],
                   },                    },
         'scantron' =>          'scantron' =>
                   { text => 'Scantron format file',                    { text => 'Bubblesheet format file',
                     help => 'Domain_Configuration_Scantron_Format',                      help => 'Domain_Configuration_Scantron_Format',
                     header => [ {col1 => 'Item',                      header => [ {col1 => 'Item',
                                  col2 => '',                                   col2 => '',
Line 204  sub handler { Line 204  sub handler {
         &Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname);          &Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname);
     } else {      } else {
         if (keys(%domconfig) == 0) {          if (keys(%domconfig) == 0) {
             &Apache::lonconfigsettings::print_header($r,$phase,$context);  
             my $primarylibserv = &Apache::lonnet::domain($dom,'primary');              my $primarylibserv = &Apache::lonnet::domain($dom,'primary');
             my @ids=&Apache::lonnet::current_machine_ids();              my @ids=&Apache::lonnet::current_machine_ids();
             if (!grep(/^\Q$primarylibserv\E$/,@ids)) {              if (!grep(/^\Q$primarylibserv\E$/,@ids)) {
Line 222  sub handler { Line 221  sub handler {
                     }                      }
                 }                  }
                 if ($custom_img_count > 0) {                  if ($custom_img_count > 0) {
                       &Apache::lonconfigsettings::print_header($r,$phase,$context);
                     my $switch_server = &check_switchserver($dom,$confname);                      my $switch_server = &check_switchserver($dom,$confname);
                     $r->print(                      $r->print(
     &mt('Domain configuration settings have yet to be saved for this domain via the web-based domain preferences interface.').'<br />'.      &mt('Domain configuration settings have yet to be saved for this domain via the web-based domain preferences interface.').'<br />'.
Line 634  sub print_rolecolors { Line 634  sub print_rolecolors {
     my %defaults = (      my %defaults = (
                    img => $defaultdesign{$role.'.img'},                     img => $defaultdesign{$role.'.img'},
                    font => $defaultdesign{$role.'.font'},                     font => $defaultdesign{$role.'.font'},
      fontmenu => $defaultdesign{$role.'.fontmenu'},
                    );                     );
     foreach my $item (@bgs) {      foreach my $item (@bgs) {
         $defaults{'bgs'}{$item} = $defaultdesign{$role.'.'.$item};          $defaults{'bgs'}{$item} = $defaultdesign{$role.'.'.$item};
Line 651  sub print_rolecolors { Line 652  sub print_rolecolors {
                 $designs{'font'} = $settings->{$role}->{'font'};                  $designs{'font'} = $settings->{$role}->{'font'};
                 $is_custom{'font'} = 1;                  $is_custom{'font'} = 1;
             }              }
               if ($settings->{$role}->{'fontmenu'} ne '') {
                   $designs{'fontmenu'} = $settings->{$role}->{'fontmenu'};
                   $is_custom{'fontmenu'} = 1;
               }
             foreach my $item (@bgs) {              foreach my $item (@bgs) {
                 if ($settings->{$role}->{$item} ne '') {                  if ($settings->{$role}->{$item} ne '') {
                     $designs{'bgs'}{$item} = $settings->{$role}->{$item};                      $designs{'bgs'}{$item} = $settings->{$role}->{$item};
Line 669  sub print_rolecolors { Line 674  sub print_rolecolors {
             $designs{img} = $designhash{$dom.'.'.$role.'.img'};              $designs{img} = $designhash{$dom.'.'.$role.'.img'};
             $is_custom{'img'} = 1;              $is_custom{'img'} = 1;
         }          }
           if ($designhash{$dom.'.'.$role.'.fontmenu'} ne '') {
               $designs{fontmenu} = $designhash{$dom.'.'.$role.'.fontmenu'};
               $is_custom{'fontmenu'} = 1; 
           }
         if ($designhash{$dom.'.'.$role.'.font'} ne '') {          if ($designhash{$dom.'.'.$role.'.font'} ne '') {
             $designs{font} = $designhash{$dom.'.'.$role.'.font'};              $designs{font} = $designhash{$dom.'.'.$role.'.font'};
             $is_custom{'font'} = 1;              $is_custom{'font'} = 1;
Line 697  sub display_color_options { Line 706  sub display_color_options {
     my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,      my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,
         $images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_;          $images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_;
     my $css_class = $itemcount%2?' class="LC_odd_row"':'';      my $css_class = $itemcount%2?' class="LC_odd_row"':'';
     my $datatable = '<tr'.$css_class.'>'.      my $datatable = '<tr>'.
         '<td>'.$choices->{'font'}.'</td>';          '<td>'.$choices->{'font'}.'</td>';
     if (!$is_custom->{'font'}) {      if (!$is_custom->{'font'}) {
         $datatable .=  '<td>'.&mt('Default in use:').'&nbsp;<span id="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>';          $datatable .=  '<td>'.&mt('Default in use:').'&nbsp;<span id="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>';
Line 711  sub display_color_options { Line 720  sub display_color_options {
                   '&nbsp;<span id="css_'.$role.'_font" style="background-color: '.                    '&nbsp;<span id="css_'.$role.'_font" style="background-color: '.
                   $designs->{'font'}.';">&nbsp;&nbsp;&nbsp;</span>'.                    $designs->{'font'}.';">&nbsp;&nbsp;&nbsp;</span>'.
                   '</span></td></tr>';                    '</span></td></tr>';
       $datatable .= '<tr'.$css_class.'>'.
           '<td>'.$choices->{'fontmenu'}.'</td>';
       if (!$is_custom->{'fontmenu'}) {
           $datatable .=  '<td>'.&mt('Default in use:').'&nbsp;<span id="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
       } else {
           $datatable .= '<td>&nbsp;</td>';
       }
       $fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'});
       $datatable .= '<td><span class="LC_nobreak">'.
                     '<input type="text" size="10" name="'.$role.'_fontmenu"'.
                     ' value="'.$designs->{'fontmenu'}.'" />&nbsp;'.$fontlink.
                     '&nbsp;<span id="css_'.$role.'_fontmenu" style="background-color: '.
                     $designs->{'fontmenu'}.';">&nbsp;&nbsp;&nbsp;</span>'.
                     '</span></td></tr>';
     my $switchserver = &check_switchserver($dom,$confname);      my $switchserver = &check_switchserver($dom,$confname);
     foreach my $img (@{$images}) {      foreach my $img (@{$images}) {
  $itemcount ++;   $itemcount ++;
Line 996  sub print_quotas { Line 1019  sub print_quotas {
     my $typecount = 0;      my $typecount = 0;
     my $css_class;      my $css_class;
     if ($context eq 'requestcourses') {      if ($context eq 'requestcourses') {
         @usertools = ('official','unofficial');          @usertools = ('official','unofficial','community');
     } else {      } else {
         @usertools = ('aboutme','blog','portfolio');          @usertools = ('aboutme','blog','portfolio');
     }      }
Line 1094  sub print_quotas { Line 1117  sub print_quotas {
     $typecount ++;      $typecount ++;
     $css_class = $typecount%2?' class="LC_odd_row"':'';      $css_class = $typecount%2?' class="LC_odd_row"':'';
     $datatable .= '<tr'.$css_class.'>'.      $datatable .= '<tr'.$css_class.'>'.
                   '<td><br/>'.&mt('LON-CAPA Advanced Users').'</td>'.                    '<td>'.&mt('LON-CAPA Advanced Users').
                     ' <span class="LC_nobreak">('.
                     &mt('overrides affiliation').')</span></td>'.
                   '<td class="LC_left_item" colspan="2"><br />';                    '<td class="LC_left_item" colspan="2"><br />';
     foreach my $item (@usertools) {      foreach my $item (@usertools) {
         my $checked;          my $checked;
Line 1115  sub print_quotas { Line 1140  sub print_quotas {
                       '" value="_LC_adv" '.$checked.'/>'.$titles{$item}.                        '" value="_LC_adv" '.$checked.'/>'.$titles{$item}.
                       '</label></span>&nbsp; ';                        '</label></span>&nbsp; ';
     }      }
     $datatable .= '<span class="LC_nobreak">('.&mt('overrides affiliation').      $datatable .= '</td></tr>';
                   ')</span></td></tr>';  
     $$rowtotal += $typecount;      $$rowtotal += $typecount;
     return $datatable;      return $datatable;
 }  }
Line 1448  sub tool_titles { Line 1472  sub tool_titles {
                      portfolio  => 'Portfolio',                       portfolio  => 'Portfolio',
                      official   => 'Official courses (with institutional codes)',                       official   => 'Official courses (with institutional codes)',
                      unofficial => 'Unofficial courses',                       unofficial => 'Unofficial courses',
                        community  => 'Communities',
                  );                   );
     return %titles;      return %titles;
 }  }
Line 1574  sub print_usercreation { Line 1599  sub print_usercreation {
             &Apache::loncommon::sorted_inst_types($dom);              &Apache::loncommon::sorted_inst_types($dom);
         if (ref($usertypes) eq 'HASH') {          if (ref($usertypes) eq 'HASH') {
             if (keys(%{$usertypes}) > 0) {              if (keys(%{$usertypes}) > 0) {
                 $datatable .= &insttypes_row($settings->{cancreate},$types,$usertypes,                  my $createsettings;
                   if (ref($settings) eq 'HASH') {
                       $createsettings = $settings->{cancreate};
                   }
                   $datatable .= &insttypes_row($createsettings,$types,$usertypes,
                                              $dom,$numinrow,$othertitle,                                               $dom,$numinrow,$othertitle,
                                              'statustocreate');                                               'statustocreate');
                 $$rowtotal ++;                  $$rowtotal ++;
Line 1833  sub print_scantronformat { Line 1862  sub print_scantronformat {
         %confhash);          %confhash);
     my $switchserver = &check_switchserver($dom,$confname);      my $switchserver = &check_switchserver($dom,$confname);
     my %lt = &Apache::lonlocal::texthash (      my %lt = &Apache::lonlocal::texthash (
                 default => 'Default scantron format file error',                  default => 'Default bubblesheet format file error',
                 custom  => 'Custom scantron format file error',                  custom  => 'Custom bubblesheet format file error',
              );               );
     my %scantronfiles = (      my %scantronfiles = (
         default => 'default.tab',          default => 'default.tab',
Line 1907  sub print_scantronformat { Line 1936  sub print_scantronformat {
                 }                  }
             }              }
         } else {          } else {
             $error{'default'} = &mt("Unable to copy default scantron formatfile to domain's RES space: [_1]",$switchserver);              $error{'default'} = &mt("Unable to copy default bubblesheet formatfile to domain's RES space: [_1]",$switchserver);
         }          }
     }      }
     if (ref($settings) eq 'HASH') {      if (ref($settings) eq 'HASH') {
Line 2495  sub insttypes_row { Line 2524  sub insttypes_row {
                     $output .= '<tr>';                      $output .= '<tr>';
                 }                  }
                 my $check = ' ';                  my $check = ' ';
                 if (ref($settings->{$context}) eq 'ARRAY') {                  if (ref($settings) eq 'HASH') {
                     if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {                      if (ref($settings->{$context}) eq 'ARRAY') {
                           if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
                               $check = ' checked="checked" ';
                           }
                       } elsif ($context eq 'statustocreate') {
                         $check = ' checked="checked" ';                          $check = ' checked="checked" ';
                     }                      }
                 } elsif ($context eq 'statustocreate') {  
                     $check = ' checked="checked" ';  
                 }                  }
                 $output .= '<td class="LC_left_item">'.                  $output .= '<td class="LC_left_item">'.
                            '<span class="LC_nobreak"><label>'.                             '<span class="LC_nobreak"><label>'.
Line 2519  sub insttypes_row { Line 2550  sub insttypes_row {
         $output .= '<td class="LC_left_item">';          $output .= '<td class="LC_left_item">';
     }      }
     my $defcheck = ' ';      my $defcheck = ' ';
     if (ref($settings->{$context}) eq 'ARRAY') {      if (ref($settings) eq 'HASH') {  
         if (grep(/^default$/,@{$settings->{$context}})) {          if (ref($settings->{$context}) eq 'ARRAY') {
               if (grep(/^default$/,@{$settings->{$context}})) {
                   $defcheck = ' checked="checked" ';
               }
           } elsif ($context eq 'statustocreate') {
             $defcheck = ' checked="checked" ';              $defcheck = ' checked="checked" ';
         }          }
     } elsif ($context eq 'statustocreate') {  
         $defcheck = ' checked="checked" ';  
     }      }
     $output .= '<span class="LC_nobreak"><label>'.      $output .= '<span class="LC_nobreak"><label>'.
                '<input type="checkbox" name="'.$context.'" '.                 '<input type="checkbox" name="'.$context.'" '.
Line 2697  sub color_font_choices { Line 2730  sub color_font_choices {
             links => "Link colors",              links => "Link colors",
             images => "Images",              images => "Images",
             font => "Font color",              font => "Font color",
               fontmenu => "Font Menu",
             pgbg => "Page",              pgbg => "Page",
             tabbg => "Header",              tabbg => "Header",
             sidebg => "Border",              sidebg => "Border",
Line 2763  sub modify_colors { Line 2797  sub modify_colors {
             @bgs = ('pgbg','tabbg','sidebg');               @bgs = ('pgbg','tabbg','sidebg'); 
         }          }
         $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};          $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
    $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
         foreach my $item (@bgs,@links,@logintext) {          foreach my $item (@bgs,@links,@logintext) {
             $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};              $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
         }          }
Line 2876  sub modify_colors { Line 2911  sub modify_colors {
                         $changes{$role}{'font'} = 1;                          $changes{$role}{'font'} = 1;
                     }                      }
                 }                  }
                   if ($domconfig->{$role}{'fontmenu'} ne '') {
                       if ($confhash->{$role}{'fontmenu'} ne $domconfig->{$role}{'fontmenu'}) {
                           $changes{$role}{'fontmenu'} = 1;
                       }
                   } else {
                       if ($confhash->{$role}{'fontmenu'}) {
                           $changes{$role}{'fontmenu'} = 1;
                       }
                   }
                 foreach my $item (@bgs) {                  foreach my $item (@bgs) {
                     if ($domconfig->{$role}{$item} ne '') {                      if ($domconfig->{$role}{$item} ne '') {
                         if ($confhash->{$role}{$item} ne $domconfig->{$role}{$item}) {                          if ($confhash->{$role}{$item} ne $domconfig->{$role}{$item}) {
Line 3314  sub modify_quotas { Line 3358  sub modify_quotas {
         $context = $action;          $context = $action;
     }      }
     if ($context eq 'requestcourses') {      if ($context eq 'requestcourses') {
         @usertools = ('official','unofficial');          @usertools = ('official','unofficial','community');
     } else {      } else {
         @usertools = ('aboutme','blog','portfolio');          @usertools = ('aboutme','blog','portfolio');
     }      }
Line 4200  sub modify_usercreation { Line 4244  sub modify_usercreation {
                             $chgtext .= '</ul>';                              $chgtext .= '</ul>';
                         }                          }
                     } elsif ($type eq 'statustocreate') {                      } elsif ($type eq 'statustocreate') {
                         if (@{$cancreate{'selfcreate'}} > 0) {                          if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') &&
                             if (@{$cancreate{$type}} == 0) {                              (ref($cancreate{'statustocreate'}) eq 'ARRAY')) {
                                 if (!grep(/^email$/,@{$cancreate{'selfcreate'}})) {                              if (@{$cancreate{'selfcreate'}} > 0) {
                                     $chgtext .= &mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts.");                                  if (@{$cancreate{'statustocreate'}} == 0) {
                                 }                                      if (!grep(/^email$/,@{$cancreate{'selfcreate'}})) {
                             } elsif (ref($usertypes) eq 'HASH') {                                          $chgtext .= &mt("However, no institutional affiliations (including 'other') are currently permitted to create accounts.");
                                 if (grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) {                                      }
                                     $chgtext .= &mt('creation of a new account for an institutional user is restricted to the following institutional affiliation(s):').'<ul>';                                  } elsif (ref($usertypes) eq 'HASH') {
                                     foreach my $case (@{$cancreate{$type}}) {                                      if (grep(/^(login|sso)$/,@{$cancreate{'selfcreate'}})) {
                                         if ($case eq 'default') {                                          $chgtext .= &mt('creation of a new account for an institutional user is restricted to the following institutional affiliation(s):').'<ul>';
                                             $chgtext .= '<li>'.$othertitle.'</li>';                                          foreach my $case (@{$cancreate{$type}}) {
                                         } else {                                              if ($case eq 'default') {
                                             $chgtext .= '<li>'.$usertypes->{$case}.'</li>';                                                  $chgtext .= '<li>'.$othertitle.'</li>';
                                               } else {
                                                   $chgtext .= '<li>'.$usertypes->{$case}.'</li>';
                                               }
                                         }                                          }
                                           $chgtext .= '</ul>';
                                     }                                      }
                                     $chgtext .= '</ul>';  
                                 }                                  }
                             }                              }
                         }                          }

Removed from v.1.93  
changed lines
  Added in v.1.99


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