--- loncom/interface/lonmodifycourse.pm 2010/03/31 20:09:07 1.53 +++ loncom/interface/lonmodifycourse.pm 2010/05/18 16:13:31 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.53 2010/03/31 20:09:07 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.54 2010/05/18 16:13:31 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -208,53 +208,81 @@ sub print_course_selection_page { sub print_modification_menu { my ($r,$cdesc,$domdesc,$dom,$type) = @_; &print_header($r,$type); - my ($ccrole,$setquota_text,$setparams_text,$cat_text); + my ($ccrole,$categorytitle,$setquota_text,$setparams_text,$cat_text); if ($type eq 'Community') { $ccrole = 'co'; } else { $ccrole = 'cc'; } - my $action = '/adm/modifycourse'; if ($type eq 'Community') { + $categorytitle = 'View/Modify Community Settings'; $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.'); $setparams_text = 'View/Modify community owner'; $cat_text = 'View/Modify catalog settings for community'; } else { + $categorytitle = 'View/Modify Course Settings'; $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.'); $setparams_text = 'View/Modify course owner, institutional code, and default authentication'; $cat_text = 'View/Modify catalog settings for course'; } - my @menu = - ( - { text => $setparams_text, - phase => 'setparms', - }, - { text => 'View/Modify quota for group portfolio files', - phase => 'setquota', - } - ); + my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); my @additional_params = &catalog_settable($domconf{'coursecategories'},$type); - if (@additional_params > 0) { - push (@menu, { text => $cat_text, - phase => 'catsettings', - }); - } - unless ($type eq 'Community') { - push(@menu, - { text => 'Display current settings for automated enrollment', - phase => 'viewparms', - } - ); + + sub phaseurl { + my $phase = shift; + return "javascript:changePage(document.menu,'$phase')" } - my $menu_html = '

'.&mt('View/Modify settings for: '). - ' '.$cdesc.'

'."\n"; + my @menu = + ({ categorytitle => $categorytitle, + items => [ + { + linktext => $setparams_text, + url => &phaseurl('setparms'), + permission => 1, + #help => '', + icon => 'mcrs.png', + linktitle => '' + }, + { + linktext => 'View/Modify quota for group portfolio files', + url => &phaseurl('setquota'), + permission => 1, + #help => '', + icon => 'mcrs.png', + linktitle => '' + }, + { + linktext => $cat_text, + url => &phaseurl('catsettings'), + permission => (@additional_params > 0), + #help => '', + icon => 'mcrs.png', + linktitle => '' + }, + { + linktext => 'Display current settings for automated enrollment', + url => &phaseurl('viewparms'), + permission => ($type ne 'Community'), + #help => '', + icon => 'mcrs.png', + linktitle => '' + }, + ] + }, + ); + + my $menu_html = + '

' + .&mt('View/Modify settings for: [_1]', + ''.$cdesc.'') + .'

'."\n".'

'; if ($type eq 'Community') { $menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:'); } else { $menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:'); } - $menu_html .= '

' + .'' + ."\n" + .&hidden_form_elements(); $r->print($menu_html); + $r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); + $r->print(''); return; }