version 1.20, 2004/11/27 17:23:09
|
version 1.23, 2004/12/28 05:55:11
|
Line 90 ENDDOCUMENT
|
Line 90 ENDDOCUMENT
|
# if called from loncreateuser, report sections, then close |
# if called from loncreateuser, report sections, then close |
my ($loaditem,$seclist); |
my ($loaditem,$seclist); |
my $num_sections = 0; |
my $num_sections = 0; |
my @sections = (); |
|
if ($ENV{'form.form'} eq 'cu' && $ENV{'form.pickedcourse'}) { |
if ($ENV{'form.form'} eq 'cu' && $ENV{'form.pickedcourse'}) { |
$loaditem = 'onLoad="setSections()"'; |
$loaditem = 'onLoad="setSections()"'; |
my ($cdom,$cnum) = split/_/,$ENV{'form.pickedcourse'}; |
my ($cdom,$cnum) = split/_/,$ENV{'form.pickedcourse'}; |
Line 154 function setSections() {
|
Line 153 function setSections() {
|
var sectionsArray = new Array("$seclist") |
var sectionsArray = new Array("$seclist") |
opener.document.$ENV{"form.form"}.currsec.length = 0 |
opener.document.$ENV{"form.form"}.currsec.length = 0 |
if (numSections == 0) { |
if (numSections == 0) { |
opener.document.$ENV{"form.form"}.currsec.options[0] = new Option('No existing sections','-1',false,false) |
opener.document.$ENV{"form.form"}.currsec.multiple=false |
|
opener.document.$ENV{"form.form"}.currsec.size=1; |
|
opener.document.$ENV{"form.form"}.currsec.options[0] = new Option('No existing sections','',false,false) |
} |
} |
else { |
else { |
for (var i=0; i<numSections; i++) { |
if (numSections == 1) { |
opener.document.$ENV{"form.form"}.currsec.options[i] = new Option(sectionsArray[i],sectionsArray[i],false,false) |
opener.document.$ENV{"form.form"}.currsec.multiple=false; |
} |
opener.document.$ENV{"form.form"}.currsec.size=1; |
opener.document.$ENV{"form.form"}.currsec.multiple=true |
opener.document.$ENV{"form.form"}.currsec.options[0] = new Option('Select','',true,true); |
if (numSections < 3) { |
opener.document.$ENV{"form.form"}.currsec.options[1] = new Option('No section','',false,false) |
opener.document.$ENV{"form.form"}.currsec.size=numSections; |
opener.document.$ENV{"form.form"}.currsec.options[2] = new Option(sectionsArray[0],sectionsArray[0],false,false); |
} |
} |
else { |
else { |
opener.document.$ENV{"form.form"}.currsec.size=3; |
for (var i=0; i<numSections; i++) { |
|
opener.document.$ENV{"form.form"}.currsec.options[i] = new Option(sectionsArray[i],sectionsArray[i],false,false) |
|
} |
|
opener.document.$ENV{"form.form"}.currsec.multiple=true |
|
if (numSections < 3) { |
|
opener.document.$ENV{"form.form"}.currsec.size=numSections; |
|
} |
|
else { |
|
opener.document.$ENV{"form.form"}.currsec.size=3; |
|
} |
|
opener.document.$ENV{"form.form"}.currsec.options[0].selected = false |
} |
} |
opener.document.$ENV{"form.form"}.currsec.options[0].selected = false |
|
} |
} |
self.close() |
self.close() |
} |
} |