version 1.127, 2005/10/17 21:17:59
|
version 1.129, 2006/01/17 18:39:50
|
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 2980 sub end_section {
|
Line 2984 sub end_section {
|
} |
} |
1; |
1; |
|
|
|
package Apache::lonhelper::group; |
|
|
|
=pod |
|
|
|
=head2 Element: groupX<group, helper element> |
|
|
|
<section> allows the user to choose one or more groups from the current course. |
|
|
|
It takes the standard attributes "variable", "multichoice", and "nextstate", meaning what they do for most other elements. |
|
|
|
=cut |
|
|
|
no strict; |
|
@ISA = ("Apache::lonhelper::choices"); |
|
use strict; |
|
|
|
BEGIN { |
|
&Apache::lonhelper::register('Apache::lonhelper::group', |
|
('group')); |
|
} |
|
|
|
sub new { |
|
my $ref = Apache::lonhelper::choices->new(); |
|
bless($ref); |
|
} |
|
|
|
sub start_group { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
|
|
if ($target ne 'helper') { |
|
return ''; |
|
} |
|
|
|
$paramHash->{CHOICES} = []; |
|
|
|
$paramHash->{'variable'} = $token->[2]{'variable'}; |
|
$helper->declareVar($paramHash->{'variable'}); |
|
$paramHash->{'multichoice'} = $token->[2]{'multichoice'}; |
|
if (defined($token->[2]{'nextstate'})) { |
|
$paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; |
|
} |
|
|
|
# Populate the CHOICES element |
|
my %choices; |
|
|
|
my $numgroups; |
|
my %curr_groups; |
|
if (&Apache::loncommon::coursegroups(\%curr_groups)) { |
|
foreach my $group_name (keys %curr_groups) { |
|
$choices{$group_name} = $group_name; |
|
} |
|
} |
|
foreach my $group_name (sort(keys(%choices))) { |
|
push @{$paramHash->{CHOICES}}, [$group_name, $group_name]; |
|
} |
|
} |
|
|
|
sub end_group { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
|
|
if ($target ne 'helper') { |
|
return ''; |
|
} |
|
Apache::lonhelper::group->new(); |
|
} |
|
1; |
|
|
package Apache::lonhelper::string; |
package Apache::lonhelper::string; |
|
|
=pod |
=pod |
Line 3566 sub render {
|
Line 3637 sub render {
|
$result .= '<li>'.&mt('for section [_1]',"<b>$section</b>").'</li>'; |
$result .= '<li>'.&mt('for section [_1]',"<b>$section</b>").'</li>'; |
$result .= "<input type='hidden' name='csec' value='" . |
$result .= "<input type='hidden' name='csec' value='" . |
HTML::Entities::encode($section,"'<>&\"") . "' />\n"; |
HTML::Entities::encode($section,"'<>&\"") . "' />\n"; |
|
} elsif ($vars->{TARGETS} eq 'group') { |
|
my $group = $vars->{GROUP_NAME}; |
|
$result .= '<li>'.&mt('for group [_1]',"<b>$group</b>").'</li>'; |
|
$result .= "<input type='hidden' name='cgroup' value='" . |
|
HTML::Entities::encode($group,"'<>&\"") . "' />\n"; |
} else { |
} else { |
# FIXME: This is probably wasteful! Store the name! |
# FIXME: This is probably wasteful! Store the name! |
my $classlist = Apache::loncoursedata::get_classlist(); |
my $classlist = Apache::loncoursedata::get_classlist(); |