version 1.18, 2011/03/31 15:35:54
|
version 1.19, 2011/06/05 12:59:47
|
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) = @_; |
my ($r,$phase,$context,$jscript) = @_; |
Line 120 $jscript
|
Line 119 $jscript
|
} |
} |
$r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem)); |
$r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle)); |
if ($context eq 'course') { |
|
&Apache::lonparmset::startSettingsScreen($r,'coursepref'); |
|
} |
|
$r->print(' |
$r->print(' |
<form name="parmform" action=""> |
<form name="parmform" action=""> |
<input type="hidden" name="pres_marker" /> |
<input type="hidden" name="pres_marker" /> |
Line 136 $jscript
|
Line 132 $jscript
|
} |
} |
|
|
sub print_footer { |
sub print_footer { |
my ($r,$context,$phase,$newphase,$button_text,$actions) = @_; |
my ($r,$phase,$newphase,$button_text,$actions) = @_; |
$button_text = &mt($button_text); |
$button_text = &mt($button_text); |
$r->print('<input type="hidden" name="phase" value="" />'); |
$r->print('<input type="hidden" name="phase" value="" />'); |
if (defined($env{'form.origin'})) { |
if (defined($env{'form.origin'})) { |
Line 163 sub print_footer {
|
Line 159 sub print_footer {
|
$button_text.'" onclick='.$onclick.' /></p>'); |
$button_text.'" onclick='.$onclick.' /></p>'); |
} |
} |
if ($phase eq 'process') { |
if ($phase eq 'process') { |
$r->print('</form>'); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
if ($context eq 'course') { |
|
&Apache::lonparmset::endSettingsScreen($r); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
} |
} |
return; |
return; |
} |
} |
Line 237 sub make_changes {
|
Line 229 sub make_changes {
|
if ($context eq 'course') { |
if ($context eq 'course') { |
$footer_text = 'Back to display/edit settings'; |
$footer_text = 'Back to display/edit settings'; |
} |
} |
&print_footer($r,$context,$phase,'display',$footer_text,\@actions); |
&print_footer($r,$phase,'display',$footer_text,\@actions); |
$r->print('</p>'); |
$r->print('</p>'); |
} |
} |
|
|
Line 282 sub display_settings {
|
Line 274 sub display_settings {
|
$r->print($output{$items[$i]}); |
$r->print($output{$items[$i]}); |
} |
} |
$r->print('</div>'); |
$r->print('</div>'); |
$r->print(&print_footer($r,$context,$phase,'process','Save Changes',\@actions)); |
$r->print(&print_footer($r,$phase,'process','Save Changes',\@actions)); |
} else { |
} else { |
$r->print('<input type="hidden" name="phase" value="" />'. |
$r->print('<input type="hidden" name="phase" value="" />'. |
'<span class="LC_error">'.&mt('No settings chosen'). |
'<span class="LC_error">'.&mt('No settings chosen'). |
Line 290 sub display_settings {
|
Line 282 sub display_settings {
|
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
if ($context eq 'course') { |
|
$r->print(' |
|
<script type="text/javascript"> |
|
$(document).ready(function(){ |
|
$("#prefs").accordion({ |
|
autoHeight: false |
|
}); |
|
if ($(".LC_nested tr.advanced").get(0)) { |
|
$(".LC_nested tr.advanced").each(function() { |
|
$(this).hide(); |
|
p = $(this).parents("div.ui-accordion-content") |
|
if (p.find(".LC_advanced_toggle").length) { |
|
return; |
|
} |
|
p.prepend("<span class=\'LC_advanced_toggle\'><input type=\"checkbox\"/>Show advanced options</span>"); |
|
}); |
|
$(".LC_advanced_toggle input").change(function() { |
|
if($(this).is(":checked")) { |
|
$(this).parents("div.ui-accordion-content").find("tr.advanced").fadeIn("normal"); |
|
} else { |
|
$(this).parents("div.ui-accordion-content").find("tr.advanced").fadeOut("normal"); |
|
} |
|
}); |
|
} |
|
}); |
|
</script> |
|
'); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
Line 372 sub display_choices {
|
Line 336 sub display_choices {
|
} |
} |
$r->print('</div><br clear="all" />'); |
$r->print('</div><br clear="all" />'); |
} |
} |
$r->print(&print_footer($r,$context,$phase,'display','Display')); |
$r->print(&print_footer($r,$phase,'display','Display')); |
$r->print('</form>'); |
$r->print('</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |