version 1.128, 2005/11/22 12:49:50
|
version 1.131, 2006/03/02 23:56:55
|
Line 576 sub display {
|
Line 576 sub display {
|
my $html=&Apache::lonxml::xmlbegin(); |
my $html=&Apache::lonxml::xmlbegin(); |
my $stateTitle=&mt($state->title()); |
my $stateTitle=&mt($state->title()); |
my $helperTitle = &mt($self->{TITLE}); |
my $helperTitle = &mt($self->{TITLE}); |
|
my $browser_searcher_js = &Apache::loncommon::browser_and_searcher_javascript(); |
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'',''); |
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'',''); |
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); |
Line 586 sub display {
|
Line 587 sub display {
|
$html |
$html |
<head> |
<head> |
<title>$loncapaHelper: $helperTitle</title> |
<title>$loncapaHelper: $helperTitle</title> |
|
<script type="text/javascript"> |
|
$browser_searcher_js |
|
</script> |
</head> |
</head> |
$bodytag |
$bodytag |
HEADER |
HEADER |
Line 1557 sub render {
|
Line 1561 sub render {
|
my $date; |
my $date; |
|
|
my $time=time; |
my $time=time; |
|
$date = localtime($time); |
|
$date->min(0); |
my ($anytime,$onclick); |
my ($anytime,$onclick); |
|
|
if (defined($self->{DEFAULT_VALUE})) { |
if (defined($self->{DEFAULT_VALUE})) { |
Line 1564 sub render {
|
Line 1570 sub render {
|
die('Error in default value code for variable ' . |
die('Error in default value code for variable ' . |
$self->{'variable'} . ', Perl said: ' . $@) if $@; |
$self->{'variable'} . ', Perl said: ' . $@) if $@; |
$time = &$valueFunc($helper, $self); |
$time = &$valueFunc($helper, $self); |
if (lc($time) eq 'anytime') { $time=time; $anytime=1; } |
if (lc($time) eq 'anytime') { |
|
$anytime=1; |
|
} else { |
|
$date = localtime($time); |
|
} |
|
} else { |
|
|
} |
} |
if ($anytime) { |
if ($anytime) { |
$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\""; |
$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\""; |
} |
} |
# Default date: The current hour. |
# Default date: The current hour. |
$date = localtime($time); |
|
$date->min(0); |
|
|
|
if (defined $self->{ERROR_MSG}) { |
if (defined $self->{ERROR_MSG}) { |
$result .= '<font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br /><br />'; |
$result .= '<font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br /><br />'; |
Line 2364 SCRIPT
|
Line 2374 SCRIPT
|
</table> |
</table> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
|
$result .= $buttons; |
|
|
} |
} |
|
|
if (defined $self->{ERROR_MSG}) { |
if (defined $self->{ERROR_MSG}) { |
Line 2420 BUTTONS
|
Line 2432 BUTTONS
|
} |
} |
return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname]; |
return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname]; |
} @keys; |
} @keys; |
|
# |
|
# now add the fancy section choice... first enumerate the sections: |
|
if ($self->{'multichoice'}) { |
|
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 $size=5; |
|
if (scalar(keys(%sections)) < 5) { |
|
$size=scalar(keys(%sections)); |
|
} |
|
my $choice_widget = '<select multiple name="chosensections" size="'.$size.'">'."\n"; |
|
foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { |
|
$choice_widget .= "<option name=\"$sec\">$sec</option>\n"; |
|
} |
|
$choice_widget .= "<option>none</option></select>\n"; |
|
|
|
# Build a table without any borders to contain the section based |
|
# selection: |
|
|
|
my $section_selectors =<<SECTIONSELECT; |
|
<table border="0"> |
|
<tr valign="top"> |
|
<td>For Sections:</td><td>$choice_widget</td> |
|
<td><label><input type="radio" name="personstate" value="Active" checked /> |
|
Current Students</label></td> |
|
<td><label><input type="radio" name="personstate" value="All" /> |
|
All students</label></td> |
|
<td><label><input type="radio" name="personstate" value="Expired" /> |
|
Expired Students</label></td> |
|
</tr> |
|
<tr> |
|
<td><input type="button" value="Select" onclick="checksections(true);" /></td> |
|
<td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr> |
|
</table> |
|
<br /> |
|
SECTIONSELECT |
|
$result .= $section_selectors; |
|
} |
|
|
# username, fullname, section, type |
# username, fullname, section, type |
for (@keys) { |
for (@keys) { |
Line 2476 BUTTONS
|
Line 2532 BUTTONS
|
} |
} |
|
|
$result .= "</table>\n\n"; |
$result .= "</table>\n\n"; |
$result .= $buttons; |
|
# |
|
# now add the fancy section choice... first enumerate the sections: |
|
if ($self->{'multichoice'}) { |
|
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 $size=5; |
|
if (scalar(keys(%sections)) < 5) { |
|
$size=scalar(keys(%sections)); |
|
} |
|
my $choice_widget = '<select multiple name="chosensections" size="'.$size.'">'."\n"; |
|
foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { |
|
$choice_widget .= "<option name=\"$sec\">$sec</option>\n"; |
|
} |
|
$choice_widget .= "<option>none</option></select>\n"; |
|
|
|
# Build a table without any borders to contain the section based |
|
# selection: |
|
|
|
my $section_selectors =<<SECTIONSELECT; |
|
<table border="0"> |
|
<tr valign="top"> |
|
<td>For Sections:</td><td>$choice_widget</td> |
|
<td><label><input type="radio" name="personstate" value="Active" checked /> |
|
Current Students</label></td> |
|
<td><label><input type="radio" name="personstate" value="All" /> |
|
All students</label></td> |
|
<td><label><input type="radio" name="personstate" value="Expired" /> |
|
Expired Students</label></td> |
|
</tr> |
|
<tr> |
|
<td><input type="button" value="Select" onclick="checksections(true);" /></td> |
|
<td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr> |
|
</table> |
|
<br /> |
|
SECTIONSELECT |
|
$result .= $section_selectors; |
|
} |
|
return $result; |
return $result; |
} |
} |
|
|