--- loncom/interface/lonconfigsettings.pm 2010/03/23 20:53:09 1.8.2.2 +++ loncom/interface/lonconfigsettings.pm 2011/10/19 21:15:53 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.8.2.2 2010/03/23 20:53:09 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.20 2011/10/19 21:15:53 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,9 +35,10 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonparmset(); sub print_header { - my ($r,$phase,$context,$jscript) = @_; + my ($r,$phase,$context,$jscript,$container) = @_; my ($pagetitle,$brcrumtitle,$action,$call_category_check); if ($context eq 'domain') { ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings'); @@ -126,13 +127,16 @@ $jscript '); + if ($container) { + &Apache::lonparmset::startSettingsScreen($r,$container); + } $r->print('
'); return; } sub print_footer { - my ($r,$phase,$newphase,$button_text,$actions) = @_; + my ($r,$phase,$newphase,$button_text,$actions,$container) = @_; $button_text = &mt($button_text); $r->print(''); if (defined($env{'form.origin'})) { @@ -141,7 +145,7 @@ sub print_footer { if (($phase eq 'display') || ($phase eq 'process')) { if (ref($actions) eq 'ARRAY') { foreach my $item (@{$actions}) { - $r->print('')."\n"; + $r->print(''."\n"); } } } @@ -159,13 +163,17 @@ sub print_footer { $button_text.'" onclick='.$onclick.' />

'); } if ($phase eq 'process') { - $r->print('
'.&Apache::loncommon::end_page()); + $r->print(''); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } + $r->print(&Apache::loncommon::end_page()); } return; } sub make_changes { - my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles,$allitems) = @_; + my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles,$allitems,$container) = @_; my %brcrumtext = &get_crumb_text(); my @actions = &Apache::loncommon::get_env_multiple('form.actions'); my ($numchanged,%changes,%disallowed); @@ -174,7 +182,7 @@ sub make_changes { text=>$brcrumtext{$context}}, {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); - &print_header($r,$phase,$context); + &print_header($r,$phase,$context,undef,$container); my $crstype; if ($context eq 'course') { $crstype = &Apache::loncommon::course_type(); @@ -229,19 +237,19 @@ 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,$phase,'display',$footer_text,\@actions,$container); $r->print('

'); } sub display_settings { my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$jscript, - $allitems,$crstype) = @_; + $allitems,$crstype,$container) = @_; my %brcrumtext = &get_crumb_text(); my @actions = &Apache::loncommon::get_env_multiple('form.actions'); &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:changePage(document.$phase,'display')", text=>"Display/Edit Settings"}); - &print_header($r,$phase,$context,$jscript); + &print_header($r,$phase,$context,$jscript,$container); my $divwidth = 900; if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { if (@actions > 0) { @@ -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,$phase,'process','Save Changes',\@actions,$container)); } else { $r->print(''. ''.&mt('No settings chosen'). @@ -280,25 +295,25 @@ sub display_settings { } sub display_choices { - my ($r,$phase,$context,$prefs_order,$prefs) = @_; + my ($r,$phase,$context,$prefs_order,$prefs,$container) = @_; if ($phase eq '') { $phase = 'pickactions'; } my %helphash; - &print_header($r,$phase,$context); + &print_header($r,$phase,$context,undef,$container); $r->print(''."\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}; @@ -308,14 +323,15 @@ sub display_choices { if ($numitems%$numcols) { $maxincol ++; } - my $firstthird = $maxincol; - my $secondthird = $firstthird + $maxincol; + $firstthird = $maxincol; + $secondthird = $firstthird + $maxincol; $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 +344,7 @@ sub display_choices { } $r->print('

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