--- loncom/interface/lonconfigsettings.pm 2010/11/19 13:09:36 1.8.2.4 +++ loncom/interface/lonconfigsettings.pm 2011/03/31 15:35:54 1.18 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.8.2.4 2010/11/19 13:09:36 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.18 2011/03/31 15:35:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonparmset(); sub print_header { my ($r,$phase,$context,$jscript) = @_; @@ -119,6 +120,9 @@ $jscript } $r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem)); $r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle)); + if ($context eq 'course') { + &Apache::lonparmset::startSettingsScreen($r,'coursepref'); + } $r->print('
@@ -132,7 +136,7 @@ $jscript } sub print_footer { - my ($r,$phase,$newphase,$button_text,$actions) = @_; + my ($r,$context,$phase,$newphase,$button_text,$actions) = @_; $button_text = &mt($button_text); $r->print(''); if (defined($env{'form.origin'})) { @@ -159,7 +163,11 @@ sub print_footer { $button_text.'" onclick='.$onclick.' />

'); } if ($phase eq 'process') { - $r->print('
'.&Apache::loncommon::end_page()); + $r->print(''); + if ($context eq 'course') { + &Apache::lonparmset::endSettingsScreen($r); + } + $r->print(&Apache::loncommon::end_page()); } return; } @@ -229,7 +237,7 @@ sub make_changes { if ($context eq 'course') { $footer_text = 'Back to display/edit settings'; } - &print_footer($r,$phase,'display',$footer_text,\@actions); + &print_footer($r,$context,$phase,'display',$footer_text,\@actions); $r->print('

'); } @@ -251,6 +259,13 @@ sub display_settings { if (grep(/^\Q$item\E$/,@actions)) { push(@items,$item); if ($context eq 'domain') { + if ($item eq 'usersessions') { + $r->print(''."\n"); + } ($output{$item},$rowtotal{$item}) = &Apache::domainprefs::print_config_box($r,$dom,$confname, $phase,$item,$prefs->{$item},$values->{$item}); @@ -267,7 +282,7 @@ sub display_settings { $r->print($output{$items[$i]}); } $r->print(''); - $r->print(&print_footer($r,$phase,'process','Save',\@actions)); + $r->print(&print_footer($r,$context,$phase,'process','Save Changes',\@actions)); } else { $r->print(''. ''.&mt('No settings chosen'). @@ -275,6 +290,34 @@ sub display_settings { } $r->print(''); } + if ($context eq 'course') { + $r->print(' + +'); + } $r->print(&Apache::loncommon::end_page()); return; } @@ -291,14 +334,14 @@ sub display_choices { &Apache::loncommon::check_uncheck_jscript()."\n". '// ]]>'."\n". ''."\n"); - $r->print('

'.&mt('Settings to display/modify').'

'."\n". + $r->print('

'.&mt('Settings to display/modify').'

'. '
'.(' 'x2). ''. - '

'."\n". - '
'); + "\n". + '
'); my ($numitems,$maxincol,$firstthird,$secondthird,$seconddiv,$thirddiv,$count); if (ref($prefs_order) eq 'ARRAY') { $numitems = @{$prefs_order}; @@ -313,9 +356,10 @@ sub display_choices { $count = 0; if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH')) { foreach my $item (@{$prefs_order}) { - $r->print(&Apache::loncommon::help_open_topic($prefs->{$item}->{'help'}). + $r->print('

'. + &Apache::loncommon::help_open_topic($prefs->{$item}->{'help'}). '
'); + '" /> '.&mt($prefs->{$item}->{'text'}).'

'); $count ++; if ((!$seconddiv) && ($count >= $firstthird)) { $r->print('
'."\n".'
'."\n"); @@ -328,7 +372,7 @@ sub display_choices { } $r->print('

'); } - $r->print(&print_footer($r,$phase,'display','Display')); + $r->print(&print_footer($r,$context,$phase,'display','Display')); $r->print(''); $r->print(&Apache::loncommon::end_page()); return;