version 1.111, 2005/07/12 16:03:12
|
version 1.114, 2005/09/28 19:02:02
|
Line 1188 sub render {
|
Line 1188 sub render {
|
|
|
if ($self->{'multichoice'}) { |
if ($self->{'multichoice'}) { |
$result .= <<SCRIPT; |
$result .= <<SCRIPT; |
<script> |
<script type="text/javascript"> |
|
// <!-- |
function checkall(value, checkName) { |
function checkall(value, checkName) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
ele = document.forms.helpform.elements[i]; |
ele = document.forms.helpform.elements[i]; |
Line 1197 sub render {
|
Line 1198 sub render {
|
} |
} |
} |
} |
} |
} |
|
// --> |
</script> |
</script> |
SCRIPT |
SCRIPT |
} |
} |
Line 1436 sub render {
|
Line 1438 sub render {
|
$choiceLabel = eval($choiceLabel); |
$choiceLabel = eval($choiceLabel); |
$choiceLabel = &$choiceLabel($helper, $self); |
$choiceLabel = &$choiceLabel($helper, $self); |
} |
} |
$result .= ">" . &mtn($choiceLabel) . "\n"; |
$result .= ">" . &mtn($choiceLabel) . "</option>\n"; |
} |
} |
$result .= "</select>\n"; |
$result .= "</select>\n"; |
|
|
Line 1930 sub render {
|
Line 1932 sub render {
|
|
|
if ($self->{'multichoice'}) { |
if ($self->{'multichoice'}) { |
$result = <<SCRIPT; |
$result = <<SCRIPT; |
<script> |
<script type="text/javascript"> |
|
// <!-- |
function checkall(value, checkName) { |
function checkall(value, checkName) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
ele = document.forms.helpform.elements[i]; |
ele = document.forms.helpform.elements[i]; |
Line 1939 sub render {
|
Line 1942 sub render {
|
} |
} |
} |
} |
} |
} |
|
// --> |
</script> |
</script> |
SCRIPT |
SCRIPT |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
Line 2057 BUTTONS
|
Line 2061 BUTTONS
|
}; |
}; |
$result.=(<<RADIO); |
$result.=(<<RADIO); |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <!-- |
function updateRadio(form,name,value) { |
function updateRadio(form,name,value) { |
var radiobutton=form[name]; |
var radiobutton=form[name]; |
for (var i=0; i<radiobutton.length; i++) { |
for (var i=0; i<radiobutton.length; i++) { |
Line 2072 BUTTONS
|
Line 2077 BUTTONS
|
var which=select.selectedIndex; |
var which=select.selectedIndex; |
hidden.value=select.options[which].value; |
hidden.value=select.options[which].value; |
} |
} |
|
// --> |
</script> |
</script> |
<input type="hidden" name="${var}_part.forminput" /> |
<input type="hidden" name="${var}_part.forminput" /> |
|
|
Line 2203 sub render {
|
Line 2209 sub render {
|
|
|
if ($self->{'multichoice'}) { |
if ($self->{'multichoice'}) { |
$result = <<SCRIPT; |
$result = <<SCRIPT; |
<script> |
<script type="text/javascript"> |
|
// <!-- |
function checkall(value, checkName) { |
function checkall(value, checkName) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
ele = document.forms.helpform.elements[i]; |
ele = document.forms.helpform.elements[i]; |
Line 2236 sub render {
|
Line 2243 sub render {
|
} |
} |
} |
} |
} |
} |
|
function getDesiredState() { // Return desired person state radio value. |
|
numRadio = document.forms.helpform.personstate.length; |
|
for (i =0; i < numRadio; i++) { |
|
if (document.forms.helpform.personstate[i].checked) { |
|
return document.forms.helpform.personstate[i].value; |
|
} |
|
} |
|
return ""; |
|
} |
|
|
|
function checksections(value) { // Check selected sections. |
|
numSections = document.forms.helpform.chosensections.length; |
|
desiredState = getDesiredState(); |
|
|
|
for (option = 0; option , numSections; option++) { |
|
if(document.forms.helpform.chosensections.options[option].selected) { |
|
section = document.forms.helpform.chosensections.options[option].text; |
|
if (section == "Staff") { // Staff are indicated by an empty section. |
|
section =""; |
|
} |
|
for (i = 0; i < document.forms.helpform.elements.length; i++ ) { |
|
if (document.forms.helpform.elements[i].value.indexOf(':') != -1) { |
|
info = document.forms.helpform.elements[i].value.split(':'); |
|
hisSection = info[2]; |
|
hisState = info[4]; |
|
if((hisSection == section) && ((desiredState ==hisState) || (section =="") || (desiredState == "All"))) { |
|
document.forms.helpform.elements[i].checked = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
// --> |
</script> |
</script> |
SCRIPT |
SCRIPT |
|
|
Line 2250 SCRIPT
|
Line 2291 SCRIPT
|
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<table> |
<table> |
<tr> |
|
|
|
<td><input type="button" onclick="checkactive()" value="$lt{'ocs'}" /></td> |
|
<td><input type="button" onclick="uncheckexpired()" value="$lt{'ues'}" /><br /></td> |
|
</tr> |
|
<tr> |
<tr> |
<td><input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /></td> |
<td><input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /></td> |
<td> <input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /><br /></td> |
<td> <input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /><br /></td> |
</tr> |
</tr> |
<tr> |
|
<td><input type="button" onclick="checksec(true)" value="$lt{'sfsg'}"></td> |
|
<td><input type="text" size="5" name="chksec"> </td> |
|
</tr> |
|
<tr> |
|
<td><input type="button" onclick="checksec(false)" value="$lt{'ufsg'}"></td> |
|
<td></td> |
|
</tr> |
|
</table> |
</table> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
Line 2364 BUTTONS
|
Line 2394 BUTTONS
|
} |
} |
|
|
$result .= "</table>\n\n"; |
$result .= "</table>\n\n"; |
$result .= $buttons; |
$result .= $buttons; |
|
# |
|
# now add the fancy section choice... first enumerate the sections: |
|
|
|
my %sections; |
|
for my $key (@keys) { |
|
my $section_name = $classlist->{$key}->[$section]; |
|
if ($section_name ne "") { |
|
$sections{$section_name} = 1; |
|
} |
|
} |
|
# The variable $choice_widget will have the html to make the choice |
|
# selector. |
|
|
|
my $choice_widget = '<select multiple name="chosensections" size="5">'."\n"; |
|
foreach my $sec (sort (keys %sections)) { |
|
$choice_widget .= "<option name=\"$sec\">$sec</option>\n"; |
|
} |
|
$choice_widget .= "<option>Staff</option></select>\n"; |
|
|
|
# Build a table without any borders to contain the section based |
|
# selection: |
|
|
|
my $section_selectors = '<table border="0">'."\n"; |
|
$section_selectors .= "<tr valign=\"top\">\n<td>For Sections:</td><td>$choice_widget</td>\n"; |
|
$section_selectors .= ' <td><input type="radio" name="personstate" value="Active" checked />'; |
|
$section_selectors .= " Current Students</td>\n"; |
|
$section_selectors .= ' <td><input type="radio" name="personstate" value="All" />'; |
|
$section_selectors .= " All students</td>\n"; |
|
$section_selectors .= ' <td><input type="radio" name="personstate" value="Expired" />'; |
|
$section_selectors .= " Expired Students</td>\n"; |
|
$section_selectors .= "</tr>\n"; |
|
$section_selectors .= "<tr>\n"; |
|
$section_selectors .= ' <td><input type="button" value="Select" onclick="checksections(true);" /></td>'."\n"; |
|
$section_selectors .= ' <td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr>'."\n</table>\n"; |
|
$section_selectors .= "<br />"; |
|
|
|
$result .= $section_selectors; |
return $result; |
return $result; |
} |
} |
|
|
Line 2547 sub render {
|
Line 2613 sub render {
|
|
|
if ($self->{'multichoice'}) { |
if ($self->{'multichoice'}) { |
$result = <<SCRIPT; |
$result = <<SCRIPT; |
<script> |
<script type="text/javascript"> |
|
// <!-- |
function checkall(value, checkName) { |
function checkall(value, checkName) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
ele = document.forms.helpform.elements[i]; |
ele = document.forms.helpform.elements[i]; |
Line 2565 sub render {
|
Line 2632 sub render {
|
} |
} |
} |
} |
} |
} |
|
// --> |
</script> |
</script> |
SCRIPT |
SCRIPT |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |