--- loncom/interface/lonconfigsettings.pm 2009/08/23 17:21:22 1.6 +++ loncom/interface/lonconfigsettings.pm 2009/10/29 14:57:18 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.6 2009/08/23 17:21:22 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.7 2009/10/29 14:57:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,7 +43,11 @@ sub print_header { ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','Domain Settings'); $action = '/adm/domainprefs'; } 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'; } my $alert = &mt('You must select at least one functionality type to display.'); @@ -169,6 +173,10 @@ sub make_changes { {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); &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') && (ref($prefs) eq 'HASH')) { foreach my $item (@{$prefs_order}) { @@ -176,12 +184,12 @@ sub make_changes { if ($context eq 'domain') { $r->print('

'.&mt($prefs->{$item}{'text'}).'

'. &Apache::domainprefs::process_changes($r,$dom, - $confname,$item,$roles,$values,)); + $confname,$item,$roles,$values)); } else { $changes{$item} = {}; &Apache::courseprefs::process_changes($dom,$item,$values, $prefs->{$item},$changes{$item}, - $allitems,\%disallowed); + $allitems,\%disallowed,$crstype); if (keys(%{$changes{$item}}) > 0) { $numchanged ++; } @@ -192,9 +200,13 @@ sub make_changes { if ($context eq 'course') { if ($numchanged) { $r->print(&Apache::courseprefs::store_changes($dom,$confname,$prefs_order,\@actions, - $prefs,$values,\%changes)); + $prefs,$values,\%changes,$crstype)); } 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) { $r->print('

'); @@ -202,7 +214,7 @@ sub make_changes { if (ref($disallowed{$item}) eq 'HASH') { if (keys(%{$disallowed{$item}}) > 0) { $r->print(&Apache::courseprefs::display_disallowed($item,$disallowed{$item}, - $prefs)); + $prefs,$crstype)); } } } @@ -220,7 +232,7 @@ sub make_changes { sub display_settings { my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$jscript, - $allitems) = @_; + $allitems,$crstype) = @_; my %brcrumtext = &get_crumb_text(); my @actions = &Apache::loncommon::get_env_multiple('form.actions'); &Apache::lonhtmlcommon::add_breadcrumb @@ -242,7 +254,7 @@ sub display_settings { } else { ($output{$item},$rowtotal{$item}) = &Apache::courseprefs::print_config_box($r,$dom,$phase, - $item,$prefs->{$item},$values,$allitems); + $item,$prefs->{$item},$values,$allitems,$crstype); } $rowsum += $rowtotal{$item}; }