--- loncom/interface/courseprefs.pm 2011/01/15 03:10:54 1.44 +++ loncom/interface/courseprefs.pm 2012/05/27 01:36:09 1.49.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.44 2011/01/15 03:10:54 www Exp $ +# $Id: courseprefs.pm,v 1.49.2.1 2012/05/27 01:36:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -463,7 +463,7 @@ sub handler { help => 'Course_Prefs_Printouts', ordered => ['problem_stream_switch','suppress_tries', 'default_paper_size','print_header_format', - 'disableexampointprint','canuse_pdfforms'], + 'disableexampointprint'], itemtext => { problem_stream_switch => 'Allow problems to be split over pages', suppress_tries => 'Suppress number of tries in printing', @@ -509,15 +509,15 @@ sub handler { my @allitems = &get_allitems(%prefs); &Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context, \@prefs_order,\%prefs,\%values, - $cnum,undef,\@allitems); + $cnum,undef,\@allitems,'coursepref'); } elsif ($phase eq 'display') { my $jscript = &get_jscript($cid,$cdom,$phase,$crstype); my @allitems = &get_allitems(%prefs); &Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context, - \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype); + \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref'); } else { &Apache::lonconfigsettings::display_choices($r,$phase,$context, - \@prefs_order,\%prefs); + \@prefs_order,\%prefs,'coursepref'); } return OK; } @@ -544,11 +544,16 @@ sub print_config_box { my $itemtext = $item->{'itemtext'}; my $rowtotal = 0; my $output = - '

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

-
 '. - &Apache::loncommon::help_open_topic($item->{'help'}).''; + ' + + '."\n". + ''; if (($action eq 'feedback') || ($action eq 'classlists')) { $output .= ' + + + + + + + + '); - &releases_by_map($r,$bymap,$url,$scopeorder); + &releases_by_map($r,$bymap,$url,$scopeorder,$lt); $r->print(&Apache::loncommon::end_data_table_row()); } else { my $rowspan;
'. + &mt($item->{text}).' '. + &Apache::loncommon::help_open_topic($item->{'help'}).'
'; if (exists $item->{'header'}->[0]->{'col1'} || exists $item->{'header'}->[0]->{'col2'}) { @@ -566,6 +571,10 @@ sub print_config_box { } $output .= '
+
'; @@ -576,6 +585,10 @@ sub print_config_box { $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). '
'.&mt($item->{'header'}->[1]->{'col1'}).'
+
'; if (exists $item->{'header'}->[2]->{'col1'} || exists $item->{'header'}->[2]->{'col2'}) { @@ -588,6 +601,8 @@ sub print_config_box { } } else { $output .= ' + + + +
'; if (exists $item->{'header'}->[0]->{'col1'} || exists $item->{'header'}->[0]->{'col2'}) { @@ -624,7 +639,9 @@ sub print_config_box { } $output .= '
-'; +

'; return ($output,$rowtotal); } @@ -648,7 +665,21 @@ sub process_changes { } } } elsif (ref($item->{'ordered'}) eq 'ARRAY') { - @ordered = @{$item->{'ordered'}}; + if ($action eq 'courseinfo') { + my ($can_toggle_cat,$can_categorize) = + &can_modify_catsettings($cdom,$crstype); + foreach my $entry (@{$item->{'ordered'}}) { + next if (($entry eq 'hidefromcat') && + (!$can_toggle_cat)); + next if (($entry eq 'categories') && + (!$can_categorize)); + next if (($entry eq 'loncaparev') || + ($entry eq 'owner')); + push(@ordered,$entry); + } + } else { + @ordered = @{$item->{'ordered'}}; + } } if (@ordered > 0) { if ($action eq 'feedback') { @@ -690,7 +721,6 @@ sub process_changes { } } else { foreach my $entry (@ordered) { - next if (($entry eq 'loncaparev') || ($entry eq 'owner')); if ($entry eq 'cloners') { if ($env{'form.cloners_all'}) { $newvalues{$entry} = '*'; @@ -1346,9 +1376,9 @@ sub store_changes { $output .= ''; } else { if ($crstype eq 'Community') { - $output = &mt('No changes made to community settings.'); + $output .= &mt('No changes made to community settings.'); } else { - $output = &mt('No changes made to course settings.'); + $output .= &mt('No changes made to course settings.'); } } } @@ -2375,7 +2405,7 @@ sub show_contents_view { } $r->print(&Apache::loncommon::start_data_table_row(). '
'.$indent.$icon.' '.$title.'