--- loncom/interface/lonmodifycourse.pm 2009/11/09 03:50:27 1.48 +++ loncom/interface/lonmodifycourse.pm 2009/11/23 21:45:18 1.49 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.48 2009/11/09 03:50:27 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.49 2009/11/23 21:45:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,14 +55,23 @@ sub autoenroll_keys { } sub catalog_settable { - my ($confhash) = @_; + my ($confhash,$type) = @_; my @settable; if (ref($confhash) eq 'HASH') { - if ($confhash->{'togglecats'} ne 'crs') { - push(@settable,'togglecats'); - } - if ($confhash->{'categorize'} ne 'crs') { - push(@settable,'categorize'); + if ($type eq 'Community') { + if ($confhash->{'togglecatscomm'} ne 'comm') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorizecomm'} ne 'comm') { + push(@settable,'categorize'); + } + } else { + if ($confhash->{'togglecats'} ne 'crs') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorize'} ne 'crs') { + push(@settable,'categorize'); + } } } else { push(@settable,('togglecats','categorize')); @@ -224,7 +233,7 @@ sub print_modification_menu { } ); my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); - my @additional_params = &catalog_settable($domconf{'coursecategories'}); + my @additional_params = &catalog_settable($domconf{'coursecategories'},$type); if (@additional_params > 0) { push (@menu, { text => $cat_text, phase => 'catsettings', @@ -399,12 +408,12 @@ sub print_catsettings { $lt{'catset'} = &mt('Catalog Settings for Community'); $lt{'exclude'} = &mt('Exclude from course catalog'); $lt{'categ'} = &mt('Categorize Community'); - $lt{'assi'} = &mt('Assign one or more categories and/or subcategories to this community.'); + $lt{'assi'} = &mt('Assign one or more subcategories to this community.'); } $r->print('
'. '

'.$lt{'catset'}.' '.$cdesc.'

'); my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); - my @cat_params = &catalog_settable($domconf{'coursecategories'}); + my @cat_params = &catalog_settable($domconf{'coursecategories'},$type); if (@cat_params > 0) { my %currsettings = &Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); @@ -434,7 +443,7 @@ sub print_catsettings { if (ref($cathash) eq 'HASH') { $r->print($lt{'assi'}.'

'. &Apache::loncommon::assign_categories_table($cathash, - $currsettings{'categories'})); + $currsettings{'categories'},$type)); } else { $r->print(&mt('No categories defined for this domain')); } @@ -933,7 +942,7 @@ sub modify_catsettings {

'.&mt('Category settings').'

'); my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); - my @cat_params = &catalog_settable($domconf{'coursecategories'}); + my @cat_params = &catalog_settable($domconf{'coursecategories'},$type); if (@cat_params > 0) { my (%cenv,@changes,@nochanges); my %currsettings =