--- loncom/interface/lonparmset.pm 2008/06/20 17:38:51 1.401 +++ loncom/interface/lonparmset.pm 2008/06/27 00:02:55 1.402 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.401 2008/06/20 17:38:51 bisitz Exp $ +# $Id: lonparmset.pm,v 1.402 2008/06/27 00:02:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2134,7 +2134,8 @@ sub crsenv { &change_clone($value,\@oldcloner); } # Update environment and nohist_courseids.db - if ($name eq 'description' || $name eq 'cloners') { + if (($name eq 'description') || ($name eq 'cloners') || + ($name eq 'hidefromcat')) { if ($chome eq '') { %crsinfo = &Apache::lonnet::courseiddump($dom,'.',1,'.','.', @@ -2159,6 +2160,14 @@ sub crsenv { $chome,'notime'); } } + if ($name eq 'hidefromcat') { + if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { + $crsinfo{$env{'request.course.id'}}{'hidefromcat'} = $value; + my $putresult = + &Apache::lonnet::courseidput($dom,\%crsinfo, + $chome,'notime'); + } + } } else { $setoutput.=&mt('Unable to set').' '.$name.' '.&mt('to'). ' '.$value.' '.&mt('due to').' '.$put_result.'.
'; @@ -2345,12 +2354,20 @@ sub crsenv { 'suppress_embed_prompt' => ''.&mt('Suppress prompt to upload items referenced in a web page being uploaded to portfolio, when current role is student.').'
'. - ' ('.&mt('[_1] to suppress, anything else to not suppress','"yes"').')', - ); - my @Display_Order = ('url','description','courseid','cloners','grading', + ' ('.&mt('[_1] to suppress, anything else to not suppress','"yes"').')', + 'hidefromcat' + => ''.&mt('Exclude from course catalog').'
'. + ' ('.&mt('[_1] to exclude, anything else to include - included if assigned an institutional code, or manually catagorized','"yes"').')', + ); + my @Display_Order = ('url','description','courseid','cloners'); + if (&can_toggle_cat($dom)) { + push(@Display_Order,'hidefromcat'); + } + push (@Display_Order,('grading', 'externalsyllabus', 'default_xml_style','pageseparators', - 'question.email','question.email.text','comment.email','comment.email.text','policy.email','policy.email.text', + 'question.email','question.email.text','comment.email', + 'comment.email.text','policy.email','policy.email.text', 'student_classlist_view', 'student_classlist_opt_in', 'student_classlist_portfiles', @@ -2379,8 +2396,7 @@ sub crsenv { 'texengine', 'disablesigfigs', 'disableexampointprint', - 'task_messages','task_grading', - ); + 'task_messages','task_grading')); foreach my $parameter (sort(keys(%values))) { unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { if (! $descriptions{$parameter}) { @@ -2473,6 +2489,19 @@ $end_table $end_page ENDENV } + +sub can_toggle_cat { + my ($dom) = @_; + my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); + my $can_toggle_cat = ''; + if (ref($domconf{'coursecategories'}) eq 'HASH') { + if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') { + $can_toggle_cat = 1; + } + } + return $can_toggle_cat; +} + ################################################## # Overview mode ##################################################