version 1.7, 2009/10/29 14:57:18
|
version 1.10, 2010/01/08 00:52:06
|
Line 38 use Apache::lonlocal;
|
Line 38 use Apache::lonlocal;
|
|
|
sub print_header { |
sub print_header { |
my ($r,$phase,$context,$jscript) = @_; |
my ($r,$phase,$context,$jscript) = @_; |
my ($pagetitle,$brcrumtitle,$action); |
my ($pagetitle,$brcrumtitle,$action,$call_category_check); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','Domain Settings'); |
($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','Domain Settings'); |
$action = '/adm/domainprefs'; |
$action = '/adm/domainprefs'; |
|
if ($phase eq 'display') { |
|
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
|
if (grep(/^coursecategories$/,@actions)) { |
|
$call_category_check = qq| |
|
if (formname == document.display) { |
|
if (!categoryCheck(formname)) { |
|
return; |
|
} |
|
} |
|
|; |
|
} |
|
} |
} else { |
} else { |
if (&Apache::loncommon::course_type() eq 'Community') { |
if (&Apache::loncommon::course_type() eq 'Community') { |
($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); |
($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); |
Line 77 function changePage(formname,newphase) {
|
Line 89 function changePage(formname,newphase) {
|
return; |
return; |
} |
} |
} |
} |
|
'.$call_category_check.' |
formname.submit(); |
formname.submit(); |
}'."\n"; |
}'."\n"; |
if ($phase eq 'pickactions') { |
if ($phase eq 'pickactions') { |
Line 288 sub display_settings {
|
Line 301 sub display_settings {
|
} else { |
} else { |
$colend = @items; |
$colend = @items; |
} |
} |
$r->print('<p><table class="LC_double_column"><tr><td class="LC_left_col">'); for (my $i=0; $i<$colend; $i++) { |
if ($context ne 'course') { |
|
$r->print('<p><table class="LC_double_column"><tr><td class="LC_left_col">'); |
|
} |
|
else { |
|
$r->print('<div id="prefs" style="max-width:900px;margin: 10px auto 10px auto;">'); |
|
} |
|
for (my $i=0; $i<$colend; $i++) { |
$r->print($output{$items[$i]}); |
$r->print($output{$items[$i]}); |
} |
} |
$r->print('</td><td></td><td class="LC_right_col">'); |
if ($context ne 'course') { |
|
$r->print('</td><td></td><td class="LC_right_col">'); |
|
} |
if ($colend < @items) { |
if ($colend < @items) { |
for (my $i=$colend; $i<@items; $i++) { |
for (my $i=$colend; $i<@items; $i++) { |
$r->print($output{$items[$i]}); |
$r->print($output{$items[$i]}); |
} |
} |
} |
} |
$r->print('</td></tr></table></p>'); |
if ($context ne 'course') { |
$r->print(&print_footer($r,$phase,'process','Save',\@actions)); |
$r->print('</td></tr></table></p>'); |
|
} |
|
else { |
|
$r->print('</div>'); |
|
} |
|
$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="" />'. |
'<input type="hidden" name="numcols" value="'. |
'<input type="hidden" name="numcols" value="'. |
Line 308 sub display_settings {
|
Line 334 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; |
} |
} |