--- loncom/interface/lonmodifycourse.pm 2007/12/30 23:22:41 1.37
+++ loncom/interface/lonmodifycourse.pm 2008/06/30 04:14:40 1.39
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.37 2007/12/30 23:22:41 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.39 2008/06/30 04:14:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,6 +43,22 @@ sub get_dc_settable {
return ('courseowner','coursecode','authtype','autharg');
}
+sub catalog_settable {
+ my ($confhash) = @_;
+ my @settable;
+ if (ref($confhash) eq 'HASH') {
+ if ($confhash->{'togglecats'} ne 'crs') {
+ push(@settable,'togglecats');
+ }
+ if ($confhash->{'categorize'} ne 'crs') {
+ push(@settable,'categorize');
+ }
+ } else {
+ push(@settable,('togglecats','categorize'));
+ }
+ return @settable;
+}
+
sub get_enrollment_settings {
my ($cdom,$cnum) = @_;
my %settings = &Apache::lonnet::dump('environment',$cdom,$cnum);
@@ -110,7 +126,7 @@ sub print_course_search_page {
my $dctitle = &Apache::lonnet::plaintext('dc');
$r->print(
'
'.&mt('Search for a course in the [_1] domain',$domdesc).'
'.
- &mt('Actions available after selecting a course:').'
'.
+ &mt('Actions available after searching for a course:').'
'.
'
'.&mt('Enter the course with the role of [_1]',$cctitle).'
'."\n".
'
'.&mt('View or modify course settings which only a [_1] may modify.'
,$dctitle).'
'."\n".'
');
@@ -145,7 +161,7 @@ sub print_course_selection_page {
}
sub print_modification_menu {
- my ($r,$cdesc,$domdesc) = @_;
+ my ($r,$cdesc,$domdesc,$dom) = @_;
&print_header($r,$cdesc);
my $type = 'Course';
my $action = '/adm/modifycourse';
@@ -165,14 +181,29 @@ sub print_modification_menu {
},
{ text => 'Modify institutional code, course owner and/or default authentication',
phase => 'setparms',
- }
+ },
);
+ my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
+ my @additional_params = &catalog_settable($domconf{'coursecategories'});
+ if (@additional_params > 0) {
+ push (@menu, { text => 'Modify course catalog settings for course',
+ phase => 'catsettings',
+ });
+ }
my $menu_html = '
'.&mt('View/Modify settings for: ').$cdesc.'
'."\n".
&mt('Although almost all course settings can be modified by a [_1], a number of settings exist which only a [_2] may change:',$cctitle,$dctitle).'
'.$lt{'some'}.'
-
'.$lt{'crqo'}.'
-
+
'.$lt{'crqo'}.'
'."\n";
+ foreach my $item (@additional_params) {
+ if ($item eq 'togglecats') {
+ $menu_html .= '
'.&mt('Hiding a course from the course catalog (can be [_1]configured[_2] to be modifiable in course context)','','').'