version 1.404, 2008/07/09 11:10:06
|
version 1.406, 2008/08/28 03:04:41
|
Line 2126 sub crsenv {
|
Line 2126 sub crsenv {
|
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
|
} elsif ($name eq 'categories') { |
|
$setoutput .= $env{'form.categories_display'}; |
} else { |
} else { |
$setoutput .= $value; |
$setoutput .= $value; |
} |
} |
Line 2399 sub crsenv {
|
Line 2401 sub crsenv {
|
'disableexampointprint', |
'disableexampointprint', |
'task_messages','task_grading')); |
'task_messages','task_grading')); |
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) || |
|
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/) |
|
|| ($parameter eq 'type')) { |
if (! $descriptions{$parameter}) { |
if (! $descriptions{$parameter}) { |
$descriptions{$parameter}=$parameter; |
$descriptions{$parameter}=$parameter; |
push(@Display_Order,$parameter); |
push(@Display_Order,$parameter); |
Line 2429 sub crsenv {
|
Line 2433 sub crsenv {
|
&Apache::loncommon::select_timezone($parameter.'_value', |
&Apache::loncommon::select_timezone($parameter.'_value', |
$timezone, |
$timezone, |
$onchange,$includeempty).'</td>'; |
$onchange,$includeempty).'</td>'; |
|
} elsif ($parameter eq 'categories') { |
|
my $catdisplay; |
|
if ($values{'categories'} ne '') { |
|
my @curritems = split(/\&/,$values{'categories'}); |
|
foreach my $item (@curritems) { |
|
my ($name,$parent,$pos) = split(/:/,$item); |
|
$catdisplay .= &unescape($name).'&'; |
|
} |
|
$catdisplay =~ s/\&$//; |
|
} |
|
$output .= '<td>'. |
|
'<input type="hidden" name="categories_value" value="'. |
|
$values{'categories'}.'" />'. |
|
'<input type="textbox" name="categories_display" value="'. |
|
$catdisplay.'" readonly="readonly" size="40" /></td>'; |
} else { |
} else { |
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
Line 2539 sub assign_course_categories {
|
Line 2558 sub assign_course_categories {
|
|
|
function updateCategories() { |
function updateCategories() { |
var newcategories = ''; |
var newcategories = ''; |
|
var unescapedcats = ''; |
if (document.chgcats.usecategory.length) { |
if (document.chgcats.usecategory.length) { |
for (var i=0; i<document.chgcats.usecategory.length; i++) { |
for (var i=0; i<document.chgcats.usecategory.length; i++) { |
if (document.chgcats.usecategory[i].checked == true) { |
if (document.chgcats.usecategory[i].checked == true) { |
newcategories = newcategories + document.chgcats.usecategory[i].value + '&'; |
newcategories = newcategories + document.chgcats.usecategory[i].value + '&'; |
|
alert("i is "+i+" and catname is "+document.chgcats.catname[i].value); |
|
unescapedcats = unescapedcats + document.chgcats.catname[i].value + ' & '; |
} |
} |
} |
} |
if (newcategories.length > 0) { |
if (newcategories.length > 0) { |
newcategories = newcategories.slice(0,-1); |
newcategories = newcategories.slice(0,-1); |
} |
} |
|
if (unescapedcats.length > 0) { |
|
usescapedcats = unescapedcats.slice(0,-3); |
|
} |
} else { |
} else { |
if (document.chgcats.usecategory.checked == true) { |
if (document.chgcats.usecategory.checked == true) { |
newcategories = document.chgcats.usecategory.value; |
newcategories = document.chgcats.usecategory.value; |
|
unescapedcats = document.chgcats.catname.value; |
} |
} |
} |
} |
opener.document.envform.categories_value.value = newcategories; |
opener.document.envform.categories_value.value = newcategories; |
|
opener.document.envform.categories_display.value = unescapedcats; |
opener.document.envform.categories_setparmval.checked = true; |
opener.document.envform.categories_setparmval.checked = true; |
alert("$alert"); |
alert("$alert"); |
self.close(); |
self.close(); |