| … | |
… | |
| 128 | |
128 | |
| 129 | # Perform substitution in a template file and print it. This should be called |
129 | # Perform substitution in a template file and print it. This should be called |
| 130 | # for all content generators that are creating HTML output, and is called by |
130 | # for all content generators that are creating HTML output, and is called by |
| 131 | # default by the &go method. |
131 | # default by the &go method. |
| 132 | sub template { |
132 | sub template { |
| 133 | my ($self, $templateFile) = @_; |
133 | my ($self, $templateFile) = (shift, shift); |
| 134 | my $r = $self->{r}; |
134 | my $r = $self->{r}; |
| 135 | my $courseEnvironment = $self->{courseEnvironment}; |
135 | my $courseEnvironment = $self->{courseEnvironment}; |
| 136 | |
136 | |
| 137 | open(TEMPLATE, $templateFile) or die "Couldn't open template $templateFile"; |
137 | open(TEMPLATE, $templateFile) or die "Couldn't open template $templateFile"; |
| 138 | my @template = <TEMPLATE>; |
138 | my @template = <TEMPLATE>; |
| … | |
… | |
| 162 | |
162 | |
| 163 | $self->pre_header_initialize(@_); |
163 | $self->pre_header_initialize(@_); |
| 164 | $self->header(@_); return OK if $r->header_only; |
164 | $self->header(@_); return OK if $r->header_only; |
| 165 | $self->initialize(@_); |
165 | $self->initialize(@_); |
| 166 | |
166 | |
| 167 | $self->template($courseEnvironment->{templates}->{system}); |
167 | $self->template($courseEnvironment->{templates}->{system}, @_); |
| 168 | |
168 | |
| 169 | return OK; |
169 | return OK; |
| 170 | } |
170 | } |
| 171 | |
171 | |
| 172 | 1; |
172 | 1; |