--- loncom/interface/lonconfigsettings.pm 2010/08/14 13:38:33 1.15.2.1 +++ loncom/interface/lonconfigsettings.pm 2014/02/15 17:14:53 1.21.4.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.15.2.1 2010/08/14 13:38:33 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.21.4.5 2014/02/15 17:14:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,8 +37,8 @@ use Apache::lonhtmlcommon(); use Apache::lonlocal; sub print_header { - my ($r,$phase,$context,$jscript) = @_; - my ($pagetitle,$brcrumtitle,$action,$call_category_check); + my ($r,$phase,$context,$jscript,$container) = @_; + my ($pagetitle,$brcrumtitle,$action,$call_category_check,$crstype); if ($context eq 'domain') { ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings'); $action = '/adm/domainprefs'; @@ -55,7 +55,8 @@ sub print_header { } } } else { - if (&Apache::loncommon::course_type() eq 'Community') { + $crstype = &Apache::loncommon::course_type(); + if ($crstype eq 'Community') { ($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); } else { ($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration'); @@ -93,9 +94,11 @@ function changePage(formname,newphase) { formname.submit(); }'."\n"; if ($phase eq 'pickactions') { + $js .= &Apache::lonhtmlcommon::color_picker(); $js .= &Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n"; } elsif ($phase eq 'display') { + $js .= &Apache::lonhtmlcommon::color_picker(); $js .= &color_pick_js()."\n"; } $js .= &Apache::loncommon::viewport_size_js().' @@ -132,7 +135,7 @@ $jscript } 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,13 +144,15 @@ 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"); } } } my $dest='"javascript:changePage(document.'.$phase.','."'$newphase'".')"'; if ($phase eq 'process') { - $r->print('
'); + $r->print( + &Apache::lonhtmlcommon::actionbox( + [''.$button_text.''])); } else { my $onclick; if ($phase eq 'display') { @@ -159,13 +164,14 @@ sub print_footer { $button_text.'" onclick='.$onclick.' />'); } if ($phase eq 'process') { - $r->print(''.&Apache::loncommon::end_page()); + $r->print(''); + $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,8 +180,8 @@ sub make_changes { text=>$brcrumtext{$context}}, {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); - &print_header($r,$phase,$context); - my $crstype; + &print_header($r,$phase,$context,undef,$container); + my ($crstype,%lastact); if ($context eq 'course') { $crstype = &Apache::loncommon::course_type(); } @@ -186,7 +192,7 @@ sub make_changes { if ($context eq 'domain') { $r->print('