version 1.21, 2011/12/08 22:10:18
|
version 1.21.4.3, 2013/09/10 01:23:45
|
Line 35 use Apache::lonnet;
|
Line 35 use Apache::lonnet;
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonparmset(); |
|
|
|
sub print_header { |
sub print_header { |
my ($r,$phase,$context,$jscript,$container) = @_; |
my ($r,$phase,$context,$jscript,$container) = @_; |
my ($pagetitle,$brcrumtitle,$action,$call_category_check); |
my ($pagetitle,$brcrumtitle,$action,$call_category_check,$crstype); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings'); |
($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings'); |
$action = '/adm/domainprefs'; |
$action = '/adm/domainprefs'; |
Line 56 sub print_header {
|
Line 55 sub print_header {
|
} |
} |
} |
} |
} else { |
} else { |
if (&Apache::loncommon::course_type() eq 'Community') { |
$crstype = &Apache::loncommon::course_type(); |
|
if ($crstype eq 'Community') { |
($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); |
($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); |
} else { |
} else { |
($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration'); |
($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration'); |
Line 94 function changePage(formname,newphase) {
|
Line 94 function changePage(formname,newphase) {
|
formname.submit(); |
formname.submit(); |
}'."\n"; |
}'."\n"; |
if ($phase eq 'pickactions') { |
if ($phase eq 'pickactions') { |
|
$js .= &Apache::lonhtmlcommon::color_picker(); |
$js .= |
$js .= |
&Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n"; |
&Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n"; |
} elsif ($phase eq 'display') { |
} elsif ($phase eq 'display') { |
|
$js .= &Apache::lonhtmlcommon::color_picker(); |
$js .= &color_pick_js()."\n"; |
$js .= &color_pick_js()."\n"; |
} |
} |
$js .= &Apache::loncommon::viewport_size_js().' |
$js .= &Apache::loncommon::viewport_size_js().' |
Line 127 $jscript
|
Line 129 $jscript
|
<input type="hidden" name="pres_value" /> |
<input type="hidden" name="pres_value" /> |
</form> |
</form> |
'); |
'); |
if ($container) { |
|
&Apache::lonparmset::startSettingsScreen($r,$container); |
|
} |
|
$r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'. |
$r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'. |
' enctype="multipart/form-data">'); |
' enctype="multipart/form-data">'); |
return; |
return; |
Line 151 sub print_footer {
|
Line 150 sub print_footer {
|
} |
} |
my $dest='"javascript:changePage(document.'.$phase.','."'$newphase'".')"'; |
my $dest='"javascript:changePage(document.'.$phase.','."'$newphase'".')"'; |
if ($phase eq 'process') { |
if ($phase eq 'process') { |
$r->print('<p><a href='.$dest.'>'.$button_text.'</a></p>'); |
$r->print( |
|
&Apache::lonhtmlcommon::actionbox( |
|
['<a href='.$dest.'>'.$button_text.'</a>'])); |
} else { |
} else { |
my $onclick; |
my $onclick; |
if ($phase eq 'display') { |
if ($phase eq 'display') { |
Line 164 sub print_footer {
|
Line 165 sub print_footer {
|
} |
} |
if ($phase eq 'process') { |
if ($phase eq 'process') { |
$r->print('</form>'); |
$r->print('</form>'); |
if ($container) { |
|
&Apache::lonparmset::endSettingsScreen($r); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
return; |
return; |
Line 183 sub make_changes {
|
Line 181 sub make_changes {
|
{href=>"javascript:changePage(document.$phase,'$phase')", |
{href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Updated"}); |
text=>"Updated"}); |
&print_header($r,$phase,$context,undef,$container); |
&print_header($r,$phase,$context,undef,$container); |
my $crstype; |
my ($crstype,$lastact); |
if ($context eq 'course') { |
if ($context eq 'course') { |
$crstype = &Apache::loncommon::course_type(); |
$crstype = &Apache::loncommon::course_type(); |
} |
} |
Line 194 sub make_changes {
|
Line 192 sub make_changes {
|
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'. |
$r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'. |
&Apache::domainprefs::process_changes($r,$dom, |
&Apache::domainprefs::process_changes($r,$dom, |
$confname,$item,$roles,$values)); |
$confname,$item,$roles,$values,\$lastact)); |
} else { |
} else { |
$changes{$item} = {}; |
$changes{$item} = {}; |
&Apache::courseprefs::process_changes($dom,$item,$values, |
&Apache::courseprefs::process_changes($dom,$item,$values, |
Line 239 sub make_changes {
|
Line 237 sub make_changes {
|
} |
} |
&print_footer($r,$phase,'display',$footer_text,\@actions,$container); |
&print_footer($r,$phase,'display',$footer_text,\@actions,$container); |
$r->print('</p>'); |
$r->print('</p>'); |
|
return $lastact; |
} |
} |
|
|
sub display_settings { |
sub display_settings { |