--- loncom/interface/domainprefs.pm 2016/04/02 04:30:19 1.271
+++ loncom/interface/domainprefs.pm 2016/04/04 01:09:47 1.272
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.271 2016/04/02 04:30:19 raeburn Exp $
+# $Id: domainprefs.pm,v 1.272 2016/04/04 01:09:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5552,6 +5552,10 @@ sub print_coursecategories {
my $toggle_catscomm_dom = ' checked="checked" ';
my $can_catcomm_comm = ' ';
my $can_catcomm_dom = ' checked="checked" ';
+ my $toggle_catsplace_place = ' ';
+ my $toggle_catsplace_dom = ' checked="checked" ';
+ my $can_catplace_place = ' ';
+ my $can_catplace_dom = ' checked="checked" ';
if (ref($settings) eq 'HASH') {
if ($settings->{'togglecats'} eq 'crs') {
@@ -5570,17 +5574,28 @@ sub print_coursecategories {
$can_catcomm_comm = $can_catcomm_dom;
$can_catcomm_dom = ' ';
}
+ if ($settings->{'togglecatsplace'} eq 'place') {
+ $toggle_catsplace_place = $toggle_catsplace_dom;
+ $toggle_catsplace_dom = ' ';
+ }
+ if ($settings->{'categorizeplace'} eq 'place') {
+ $can_catplace_place = $can_catplace_dom;
+ $can_catplace_dom = ' ';
+ }
}
my %title = &Apache::lonlocal::texthash (
- togglecats => 'Show/Hide a course in catalog',
- togglecatscomm => 'Show/Hide a community in catalog',
- categorize => 'Assign a category to a course',
- categorizecomm => 'Assign a category to a community',
+ togglecats => 'Show/Hide a course in catalog',
+ togglecatscomm => 'Show/Hide a community in catalog',
+ togglecatsplace => 'Show/Hide a placement test in catalog',
+ categorize => 'Assign a category to a course',
+ categorizecomm => 'Assign a category to a community',
+ categorizeplace => 'Assign a category to a placement test',
);
my %level = &Apache::lonlocal::texthash (
- dom => 'Set in Domain',
- crs => 'Set in Course',
- comm => 'Set in Community',
+ dom => 'Set in Domain',
+ crs => 'Set in Course',
+ comm => 'Set in Community',
+ place => 'Set in Placement Test',
);
$datatable = '
'.
''.$title{'togglecats'}.' '.
@@ -5610,8 +5625,22 @@ sub print_coursecategories {
$can_catcomm_dom.' value="dom" />'.$level{'dom'}.' '.
' '.$level{'comm'}.' '.
+ ' '.
+ ''.$title{'togglecatsplace'}.' '.
+ ''.
+ ' '.$level{'dom'}.' '.
+ ' '.$level{'place'}.' '.
+ ' '.
+ ''.$title{'categorizeplace'}.' '.
+ ''.
+ ' '.$level{'dom'}.' '.
+ ' '.$level{'place'}.' '.
' ';
- $$rowtotal += 4;
+ $$rowtotal += 6;
} else {
my $css_class;
my $itemcount = 1;
@@ -5636,12 +5665,15 @@ sub print_coursecategories {
my %default_names = (
instcode => &mt('Official courses'),
communities => &mt('Communities'),
+ placement => &mt('Placement Tests'),
);
if ((!grep(/^instcode$/,@{$cats[0]})) ||
($cathash->{'instcode::0'} eq '') ||
(!grep(/^communities$/,@{$cats[0]})) ||
- ($cathash->{'communities::0'} eq '')) {
+ ($cathash->{'communities::0'} eq '') ||
+ (!grep(/^placement$/,@{$cats[0]})) ||
+ ($cathash->{'placement::0'} eq '')) {
$maxnum ++;
}
my $lastidx;
@@ -5662,7 +5694,7 @@ sub print_coursecategories {
$datatable .= ''.$vpos.' ';
}
$datatable .= '';
- if ($parent eq 'instcode' || $parent eq 'communities') {
+ if ($parent eq 'instcode' || $parent eq 'communities' || $parent eq 'placement') {
$datatable .= ''
.$default_names{$parent}.' ';
if ($parent eq 'instcode') {
@@ -5685,7 +5717,7 @@ sub print_coursecategories {
$datatable .= ' '
.&mt('Do not display').' ';
- if ($parent eq 'communities') {
+ if (($parent eq 'communities') || ($parent eq 'placement')) {
$datatable .= ' ';
}
$datatable .= '';
@@ -5717,7 +5749,7 @@ sub print_coursecategories {
.' '
.''."\n";
$itemcount ++;
- foreach my $default ('instcode','communities') {
+ foreach my $default ('instcode','communities','placement') {
if ((!grep(/^\Q$default\E$/,@{$cats[0]})) || ($cathash->{$default.'::0'} eq '')) {
$css_class = $itemcount%2?' class="LC_odd_row"':'';
my $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','$lastidx'".');"';
@@ -5898,9 +5930,11 @@ sub coursecategories_javascript {
}
my $instcode_reserved = &mt('The name: [_1] is a reserved category.','"instcode"');
my $communities_reserved = &mt('The name: [_1] is a reserved category.','"communities"');
+ my $placement_reserved = &mt('The name: [_1] is a reserved category.','"placement"');
my $choose_again = "\n".&mt('Please use a different name for the new top level category.');
&js_escape(\$instcode_reserved);
&js_escape(\$communities_reserved);
+ &js_escape(\$placement_reserved);
&js_escape(\$choose_again);
$output = <<"ENDSCRIPT";