Diff for /loncom/interface/lonconfigsettings.pm between versions 1.6 and 1.7

version 1.6, 2009/08/23 17:21:22 version 1.7, 2009/10/29 14:57:18
Line 43  sub print_header { Line 43  sub print_header {
         ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','Domain Settings');          ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','Domain Settings');
         $action = '/adm/domainprefs';          $action = '/adm/domainprefs';
     } else {      } else {
         ($pagetitle, $brcrumtitle) = ('Course Configuration','Course Configuration');          if (&Apache::loncommon::course_type() eq 'Community') {
               ($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration');
           } else {
               ($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration');
           }
         $action = '/adm/courseprefs';          $action = '/adm/courseprefs';
     }      }
     my $alert = &mt('You must select at least one functionality type to display.');      my $alert = &mt('You must select at least one functionality type to display.');
Line 169  sub make_changes { Line 173  sub make_changes {
        {href=>"javascript:changePage(document.$phase,'$phase')",         {href=>"javascript:changePage(document.$phase,'$phase')",
         text=>"Updated"});          text=>"Updated"});
     &print_header($r,$phase,$context);      &print_header($r,$phase,$context);
       my $crstype;
       if ($context eq 'course') {
           $crstype = &Apache::loncommon::course_type();
       }
     if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') &&       if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && 
         (ref($prefs) eq 'HASH')) {          (ref($prefs) eq 'HASH')) {
         foreach my $item (@{$prefs_order}) {          foreach my $item (@{$prefs_order}) {
Line 176  sub make_changes { Line 184  sub make_changes {
                 if ($context eq 'domain') {                  if ($context eq 'domain') {
                     $r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'.                      $r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'.
                               &Apache::domainprefs::process_changes($r,$dom,                                &Apache::domainprefs::process_changes($r,$dom,
                                           $confname,$item,$roles,$values,));                                            $confname,$item,$roles,$values));
                 } else {                  } else {
                     $changes{$item} = {};                      $changes{$item} = {};
                     &Apache::courseprefs::process_changes($dom,$item,$values,                      &Apache::courseprefs::process_changes($dom,$item,$values,
                                                           $prefs->{$item},$changes{$item},                                                            $prefs->{$item},$changes{$item},
                                                           $allitems,\%disallowed);                                                            $allitems,\%disallowed,$crstype);
                     if (keys(%{$changes{$item}}) > 0) {                      if (keys(%{$changes{$item}}) > 0) {
                         $numchanged ++;                          $numchanged ++;
                     }                      }
Line 192  sub make_changes { Line 200  sub make_changes {
     if ($context eq 'course') {      if ($context eq 'course') {
         if ($numchanged) {          if ($numchanged) {
             $r->print(&Apache::courseprefs::store_changes($dom,$confname,$prefs_order,\@actions,              $r->print(&Apache::courseprefs::store_changes($dom,$confname,$prefs_order,\@actions,
                                                           $prefs,$values,\%changes));                                                            $prefs,$values,\%changes,$crstype));
         } else {          } else {
             $r->print(&mt('No changes made to course configuration.'));              if ($crstype eq 'Community') {
                   $r->print(&mt("No changes made to community configuration."));
               } else {
                   $r->print(&mt("No changes made to course configuration."));
               }
         }          }
         if (keys(%disallowed) > 0) {          if (keys(%disallowed) > 0) {
             $r->print('<p>');              $r->print('<p>');
Line 202  sub make_changes { Line 214  sub make_changes {
                 if (ref($disallowed{$item}) eq 'HASH') {                  if (ref($disallowed{$item}) eq 'HASH') {
                     if (keys(%{$disallowed{$item}}) > 0) {                      if (keys(%{$disallowed{$item}}) > 0) {
                         $r->print(&Apache::courseprefs::display_disallowed($item,$disallowed{$item},                          $r->print(&Apache::courseprefs::display_disallowed($item,$disallowed{$item},
                                                                            $prefs));                                                                             $prefs,$crstype));
                     }                      }
                 }                  }
             }              }
Line 220  sub make_changes { Line 232  sub make_changes {
   
 sub display_settings {  sub display_settings {
     my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$jscript,      my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$jscript,
         $allitems) = @_;          $allitems,$crstype) = @_;
     my %brcrumtext = &get_crumb_text();      my %brcrumtext = &get_crumb_text();
     my @actions = &Apache::loncommon::get_env_multiple('form.actions');      my @actions = &Apache::loncommon::get_env_multiple('form.actions');
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
Line 242  sub display_settings { Line 254  sub display_settings {
                     } else {                      } else {
                         ($output{$item},$rowtotal{$item}) =                          ($output{$item},$rowtotal{$item}) =
                             &Apache::courseprefs::print_config_box($r,$dom,$phase,                              &Apache::courseprefs::print_config_box($r,$dom,$phase,
                                 $item,$prefs->{$item},$values,$allitems);                                  $item,$prefs->{$item},$values,$allitems,$crstype);
                     }                      }
                     $rowsum += $rowtotal{$item};                      $rowsum += $rowtotal{$item};
                 }                  }

Removed from v.1.6  
changed lines
  Added in v.1.7


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