version 1.21, 2004/11/30 00:21:24
|
version 1.24, 2005/01/27 19:20:55
|
Line 153 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.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) |
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() |
} |
} |
Line 214 ENDSCRIPT
|
Line 225 ENDSCRIPT
|
} else { |
} else { |
$descr = &Apache::lonnet::unescape($courses{$course}); |
$descr = &Apache::lonnet::unescape($courses{$course}); |
} |
} |
$by_descrip{lc($descr)}=$course; |
my $description = lc($descr); |
|
if (exists($by_descrip{$description})) { |
|
push @{$by_descrip{$description}}, ($course); |
|
} else { |
|
@{$by_descrip{$description}} = ($course); |
|
} |
} |
} |
foreach my $description (sort(keys(%by_descrip))) { |
foreach my $description (sort(keys(%by_descrip))) { |
my $course=$by_descrip{$description}; |
foreach my $course (@{$by_descrip{$description}}) { |
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
$cleandesc=~s/'/\\'/g; |
$cleandesc=~s/'/\\'/g; |
my ($cdom,$cnum)=split(/\_/,$course); |
my ($cdom,$cnum)=split(/\_/,$course); |
$r->print('<input type="button" value="Select" onClick="gochoose('. |
my ($descr,$instcode,$owner) = split/:/,$courses{$course}; |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" /> '.$description.' ('. |
$r->print('<input type="button" value="Select" onClick="gochoose('. |
($Apache::lonnet::domaindescription{$cdom}? |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" /> '.$description.' ('. |
$Apache::lonnet::domaindescription{$cdom}:$cdom). |
($Apache::lonnet::domaindescription{$cdom}? |
")<br />\n"); |
$Apache::lonnet::domaindescription{$cdom}:$cdom).")"); |
|
unless ($instcode eq '') { |
|
$r->print(" - ".&Apache::lonnet::unescape($instcode)); |
|
} |
|
unless ($owner eq '') { |
|
$r->print(", owner - ".&Apache::lonnet::unescape($owner)); |
|
} |
|
$r->print("<br />\n"); |
|
} |
} |
} |
if (!%courses) { $r->print(&mt('None found')); } |
if (!%courses) { $r->print(&mt('None found')); } |
$r->print('<input type="hidden" name="form" value="'.$ENV{'form.form'}.'" />'."\n". |
$r->print('<input type="hidden" name="form" value="'.$ENV{'form.form'}.'" />'."\n". |