version 1.17, 2014/03/16 22:27:06
|
version 1.18, 2014/03/17 02:33:32
|
Line 489 sub instcode_selectors_data {
|
Line 489 sub instcode_selectors_data {
|
if ($officialjs) { |
if ($officialjs) { |
$jscript .= ' |
$jscript .= ' |
|
|
function toggleOfficial() {'; |
function toggleOfficial() { |
|
var choice; |
|
for (var i=0; i<document.'.$formname.'.official.length; i++) { |
|
if (document.'.$formname.'.official[i].checked) { |
|
choice = document.'.$formname.'.official[i].value; |
|
} |
|
} |
|
if (choice == "off") { |
|
if (document.getElementById("instcodes")) { |
|
document.getElementById("instcodes").style.display = "none"; |
|
}'; |
for (my $i=0; $i<@{$codetitles}-1; $i++) { |
for (my $i=0; $i<@{$codetitles}-1; $i++) { |
$jscript .= ' |
$jscript .= ' |
document.'.$formname.'.'.$codetitles->[$i].'.selectedIndex = 0;'; |
document.'.$formname.'.'.$codetitles->[$i].'.selectedIndex = 0;'; |
} |
} |
$jscript .= ' |
$jscript .= ' |
|
} else { |
|
if (document.getElementById("instcodes")) { |
|
document.getElementById("instcodes").style.display = "block"; |
|
} |
|
} |
} |
} |
|
|
function setOfficial(caller) { |
function setOfficial(caller) { |
Line 564 sub build_instcode_selectors {
|
Line 579 sub build_instcode_selectors {
|
my $output; |
my $output; |
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
if ($numtitles > 0) { |
if ($numtitles > 0) { |
$output .= '<table><tr>'; |
my $style; |
|
if ($env{'form.official'} eq 'off') { |
|
$style = ' style="display: none"'; |
|
} |
|
$output .= '<div id="instcodes"'.$style.'><table><tr>'; |
for (my $k=0; $k<$lasttitle-1; $k++) { |
for (my $k=0; $k<$lasttitle-1; $k++) { |
my (@items,@unsorted); |
my (@items,@unsorted); |
if (ref($cat_items->{$codetitles->[$k]}) eq 'ARRAY') { |
if (ref($cat_items->{$codetitles->[$k]}) eq 'ARRAY') { |
Line 600 sub build_instcode_selectors {
|
Line 619 sub build_instcode_selectors {
|
'<input type="text" name="'.$standardnames[$numtitles-1]. |
'<input type="text" name="'.$standardnames[$numtitles-1]. |
'" /><br />'."\n"; |
'" /><br />'."\n"; |
} |
} |
$output .= '<br />'; |
$output .= '</div>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 614 sub instcode_selectors {
|
Line 633 sub instcode_selectors {
|
if ($numtitles > 0) { |
if ($numtitles > 0) { |
my $official = ' checked="checked" '; |
my $official = ' checked="checked" '; |
my $unofficial = ''; |
my $unofficial = ''; |
if ($env{'form.official'} eq 'off') { |
if (($formname eq 'filterpicker') && ($env{'form.official'} eq 'off')) { |
$unofficial = $official; |
$unofficial = $official; |
$official = ''; |
$official = ''; |
} |
} |
$output .= '<span class="LC_nobreak">'.&mt('Official course:').' <label>'. |
$output .= '<span class="LC_nobreak">'.&mt('Official course:').' <label>'. |
'<input type="radio" name="official" value="on"'.$official.' />'. |
'<input type="radio" name="official" value="on"'.$official. |
&mt('Yes').'</label>'.(' 'x3).'<label>'. |
' onclick="toggleOfficial();" />'.&mt('Yes').'</label>'. |
|
(' 'x3).'<label>'. |
'<input type="radio" name="official" value="off"'.$unofficial. |
'<input type="radio" name="official" value="off"'.$unofficial. |
' onclick="toggleOfficial();" />'.&mt('No').'</label></span><br />'. |
' onclick="toggleOfficial();" />'.&mt('No').'</label></span><br />'. |
&build_instcode_selectors($numtitles,$lasttitle,\%cat_items,$codetitles, |
&build_instcode_selectors($numtitles,$lasttitle,\%cat_items,$codetitles, |