--- loncom/interface/lonmodifycourse.pm 2007/12/14 00:24:11 1.36
+++ loncom/interface/lonmodifycourse.pm 2009/01/12 01:37:57 1.41
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.36 2007/12/14 00:24:11 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.41 2009/01/12 01:37:57 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);
@@ -108,22 +124,12 @@ sub print_course_search_page {
my $action = '/adm/modifycourse';
my $cctitle = &Apache::lonnet::plaintext('cc',$type);
my $dctitle = &Apache::lonnet::plaintext('dc');
- my %lt=&Apache::lonlocal::texthash(
- 'some' => "Certain settings which control auto-enrollment of students from your institution's student information system.",
- 'crqo' => 'The total disk space allocated for storage of portfolio files in all groups in a course.',
- 'tmod' => 'To view or modify these settings use the criteria below to select a course from this domain.',
- );
- $r->print('
'.
- &mt('Course settings which only a [_1] may modify.'
- ,$dctitle).'
'.
- &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{'tmod'}.' ('.$domdesc.')
-
- ');
+ $r->print(
+ '
'.&mt('Search for a course in the [_1] domain',$domdesc).'
'.
+ &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".'
');
$r->print(&Apache::lonpickcourse::build_filters($filterlist,$type,
undef,undef,$filter,$action,'modifycourse'));
}
@@ -149,18 +155,22 @@ sub print_course_selection_page {
$filter{'domainfilter'} = $dom;
my %courses = &Apache::lonpickcourse::search_courses($r,$type,0,
\%filter);
- if (keys(%courses) > 0) {
- $r->print(&mt("Click a 'Select' button to view or modify settings for a [_1] which may only be modified by a [_2] in this domain.",lc($type),$dctitle).'
');
- }
-
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,
%courses);
return;
}
sub print_modification_menu {
- my ($r,$cdesc) = @_;
+ my ($r,$cdesc,$domdesc,$dom) = @_;
&print_header($r,$cdesc);
+ my $type = 'Course';
+ my $action = '/adm/modifycourse';
+ my $cctitle = &Apache::lonnet::plaintext('cc',$type);
+ my $dctitle = &Apache::lonnet::plaintext('dc');
+ my %lt=&Apache::lonlocal::texthash(
+ 'some' => "Certain settings which control auto-enrollment of students from your institution's student information system.",
+ 'crqo' => 'The total disk space allocated for storage of portfolio files in all groups in a course.',
+ );
my @menu =
(
{ text => 'Modify quota for group portfolio files',
@@ -171,11 +181,32 @@ 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".
- ''."\n".
- &hidden_form_elements();
+ &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'}.'
'."\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)','','').'