| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/HTML/ScrollingRecordList.pm,v 1.2 2004/03/04 21:05:04 sh002i Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/Template.pm,v 1.1 2004/03/10 02:31:05 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 98 | |
98 | |
| 99 | =cut |
99 | =cut |
| 100 | |
100 | |
| 101 | use strict; |
101 | use strict; |
| 102 | use warnings; |
102 | use warnings; |
|
|
103 | use WeBWorK::Utils qw(readFile); |
| 103 | |
104 | |
| 104 | our @EXPORT = (); |
105 | our @EXPORT = (); |
| 105 | our @EXPORT_OK = qw( |
106 | our @EXPORT_OK = qw( |
| 106 | template |
107 | template |
| 107 | ); |
108 | ); |
| … | |
… | |
| 146 | $ifstack[-1] = not $ifstack[-1]; |
147 | $ifstack[-1] = not $ifstack[-1]; |
| 147 | } elsif ($function eq "endif" and @ifstack > 1) { |
148 | } elsif ($function eq "endif" and @ifstack > 1) { |
| 148 | pop @ifstack; |
149 | pop @ifstack; |
| 149 | } elsif ($ifstack[-1]) { |
150 | } elsif ($ifstack[-1]) { |
| 150 | if ($cg->can($function)) { |
151 | if ($cg->can($function)) { |
| 151 | my @result = $cg->$function(@_, {@args}); |
152 | my @result = $cg->$function({@args}); |
| 152 | if (@result) { |
153 | if (@result) { |
| 153 | print @result; |
154 | print @result; |
| 154 | } else { |
155 | } else { |
| 155 | warn "Template escape $function returned an empty list."; |
156 | warn "Template escape $function returned an empty list."; |
| 156 | } |
157 | } |