Lines 25-30
use Cwd qw(abs_path);
Link Here
|
25 |
use base qw{Module::Bundled::Files}; |
25 |
use base qw{Module::Bundled::Files}; |
26 |
|
26 |
|
27 |
use C4::Context; |
27 |
use C4::Context; |
|
|
28 |
use C4::Output qw(output_with_http_headers output_html_with_http_headers); |
28 |
|
29 |
|
29 |
=head1 NAME |
30 |
=head1 NAME |
30 |
|
31 |
|
Lines 38-44
sub new {
Link Here
|
38 |
return unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} ); |
39 |
return unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} ); |
39 |
|
40 |
|
40 |
$args->{'class'} = $class; |
41 |
$args->{'class'} = $class; |
41 |
$args->{'template'} = Template->new( { ABSOLUTE => 1 } ); |
42 |
$args->{'template'} = Template->new( { ABSOLUTE => 1, ENCODING => 'UTF-8' } ); |
42 |
|
43 |
|
43 |
my $self = bless( $args, $class ); |
44 |
my $self = bless( $args, $class ); |
44 |
|
45 |
|
Lines 177-182
sub go_home {
Link Here
|
177 |
print $self->{'cgi'}->redirect("/cgi-bin/koha/plugins/plugins-home.pl"); |
178 |
print $self->{'cgi'}->redirect("/cgi-bin/koha/plugins/plugins-home.pl"); |
178 |
} |
179 |
} |
179 |
|
180 |
|
|
|
181 |
=head2 output_html |
182 |
|
183 |
$self->output_html( $data, $status, $extra_options ); |
184 |
|
185 |
Outputs $data setting the right headers for HTML content. |
186 |
|
187 |
Note: this is a wrapper function for C4::Output::output_with_http_headers |
188 |
|
189 |
=cut |
190 |
|
191 |
sub output_html { |
192 |
my ( $self, $data, $status, $extra_options ) = @_; |
193 |
output_with_http_headers( $self->{cgi}, undef, $data, 'html', $status, $extra_options ); |
194 |
} |
195 |
|
196 |
=head2 output |
197 |
|
198 |
$self->output( $data, $content_type[, $status[, $extra_options]]); |
199 |
|
200 |
Outputs $data with the appropriate HTTP headers, |
201 |
the authentication cookie and a Content-Type specified in |
202 |
$content_type. |
203 |
|
204 |
$content_type is one of the following: 'html', 'js', 'json', 'xml', 'rss', or 'atom'. |
205 |
|
206 |
$status is an HTTP status message, like '403 Authentication Required'. It defaults to '200 OK'. |
207 |
|
208 |
$extra_options is hashref. If the key 'force_no_caching' is present and has |
209 |
a true value, the HTTP headers include directives to force there to be no |
210 |
caching whatsoever. |
211 |
|
212 |
Note: this is a wrapper function for C4::Output::output_with_http_headers |
213 |
|
214 |
=cut |
215 |
|
216 |
sub output { |
217 |
my ( $self, $data, $content_type, $status, $extra_options ) = @_; |
218 |
output_with_http_headers( $self->{cgi}, undef, $data, $content_type, $status, $extra_options ); |
219 |
} |
220 |
|
180 |
1; |
221 |
1; |
181 |
__END__ |
222 |
__END__ |
182 |
|
223 |
|
183 |
- |
|
|