| … | |
… | |
| 14 | use strict; |
14 | use strict; |
| 15 | use warnings; |
15 | use warnings; |
| 16 | use Apache::Constants qw(:common); |
16 | use Apache::Constants qw(:common); |
| 17 | use CGI qw(); |
17 | use CGI qw(); |
| 18 | use URI::Escape; |
18 | use URI::Escape; |
|
|
19 | use WeBWorK::Authz; |
| 19 | use WeBWorK::DB; |
20 | use WeBWorK::DB; |
| 20 | use WeBWorK::Utils qw(readFile); |
21 | use WeBWorK::Utils qw(readFile); |
| 21 | use WeBWorK::Authz; |
|
|
| 22 | |
22 | |
| 23 | ################################################################################ |
23 | ################################################################################ |
| 24 | # This is a very unruly file, so I'm going to use very large comments to divide |
24 | # This is a very unruly file, so I'm going to use very large comments to divide |
| 25 | # it into logical sections. |
25 | # it into logical sections. |
| 26 | ################################################################################ |
26 | ################################################################################ |
| … | |
… | |
| 65 | # * any "template escapes" defined in the system template and supported by |
65 | # * any "template escapes" defined in the system template and supported by |
| 66 | # the subclass. Generic implementations of &title and &body are provided. |
66 | # the subclass. Generic implementations of &title and &body are provided. |
| 67 | # |
67 | # |
| 68 | sub go { |
68 | sub go { |
| 69 | my $self = shift; |
69 | my $self = shift; |
|
|
70 | |
| 70 | my $r = $self->{r}; |
71 | my $r = $self->{r}; |
| 71 | my $courseEnvironment = $self->{ce}; |
72 | my $courseEnvironment = $self->{ce}; |
| 72 | |
73 | |
| 73 | $self->pre_header_initialize(@_) if $self->can("pre_header_initialize"); |
74 | $self->pre_header_initialize(@_) if $self->can("pre_header_initialize"); |
| 74 | $self->header(@_); |
75 | $self->header(@_); |
| 75 | return OK if $r->header_only; |
76 | return OK if $r->header_only; |
| 76 | |
77 | |
| 77 | $self->initialize(@_) if $self->can("initialize"); |
78 | $self->initialize(@_) if $self->can("initialize"); |
| 78 | $self->template($courseEnvironment->{templates}->{system}, @_); |
79 | $self->template($courseEnvironment->{templates}->{system}, @_); |
| 79 | |
80 | |
| 80 | return OK; |
81 | return OK; |
| 81 | } |
82 | } |
| 82 | |
83 | |
| 83 | # template(STRING, @otherArguments) - parse a template, looking for escapes of |
84 | # template(STRING, @otherArguments) - parse a template, looking for escapes of |
| 84 | # the form <!--#NAME ARG1="FOO" ARG2="BAR"--> and calling a member function NAME |
85 | # the form <!--#NAME ARG1="FOO" ARG2="BAR"--> and calling a member function NAME |