version 1.154, 2006/05/30 21:54:22
|
version 1.155, 2006/06/25 21:50:25
|
Line 1023 sub postprocess {
|
Line 1023 sub postprocess {
|
} |
} |
1; |
1; |
|
|
|
package Apache::lonhelper::skip; |
|
|
|
=pod |
|
|
|
=head1 Elements |
|
|
|
=head2 Element: skipX<skip> |
|
|
|
The <skip> tag allows you define conditions under which the current state |
|
should be skipped over and define what state to skip to. |
|
|
|
<state name="SKIP"> |
|
<skip> |
|
<clause> |
|
#some code that decides whether to skip the state or not |
|
</clause> |
|
<nextstate>FINISH</nextstate> |
|
</skip> |
|
<message nextstate="FINISH">A possibly skipped state</message> |
|
</state> |
|
|
|
=cut |
|
|
|
no strict; |
|
@ISA = ("Apache::lonhelper::element"); |
|
use strict; |
|
|
|
BEGIN { |
|
&Apache::lonhelper::register('Apache::lonhelper::skip', |
|
('skip')); |
|
} |
|
|
|
sub new { |
|
my $ref = Apache::lonhelper::element->new(); |
|
bless($ref); |
|
} |
|
|
|
sub start_skip { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
|
|
if ($target ne 'helper') { |
|
return ''; |
|
} |
|
# let <cluase> know what text to skip to |
|
$paramHash->{SKIPTAG}='/skip'; |
|
return ''; |
|
} |
|
|
|
sub end_skip { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
|
|
if ($target ne 'helper') { |
|
return ''; |
|
} |
|
Apache::lonhelper::skip->new(); |
|
return ''; |
|
} |
|
|
|
sub render { |
|
my $self = shift; |
|
return ''; |
|
} |
|
# If a NEXTSTATE is set, switch to it |
|
sub preprocess { |
|
my ($self) = @_; |
|
|
|
if (defined($self->{NEXTSTATE})) { |
|
$helper->changeState($self->{NEXTSTATE}); |
|
} |
|
|
|
return 1; |
|
} |
|
|
|
1; |
|
|
package Apache::lonhelper::choices; |
package Apache::lonhelper::choices; |
|
|
=pod |
=pod |
Line 1610 sub render {
|
Line 1685 sub render {
|
$date->min(0); |
$date->min(0); |
} |
} |
|
|
&Apache::lonnet::logthis("date mode "); |
|
|
|
if ($anytime) { |
if ($anytime) { |
$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\""; |
$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\""; |
} |
} |
Line 3130 sub start_clause {
|
Line 3203 sub start_clause {
|
die 'Error in clause of condition, Perl said: ' . $@ if $@; |
die 'Error in clause of condition, Perl said: ' . $@ if $@; |
if (!&$clause($helper, $paramHash)) { |
if (!&$clause($helper, $paramHash)) { |
# Discard all text until the /condition. |
# Discard all text until the /condition. |
&Apache::lonxml::get_all_text('/condition', $parser); |
my $end_tag = $paramHash->{SKIPTAG} || '/condition'; |
|
&Apache::lonxml::get_all_text($end_tag, $parser); |
} |
} |
} |
} |
|
|