From 9360ce0ebb93668bacb2a9bc3cb7e51d832e0787 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 20 Sep 2019 20:37:28 +0000 Subject: [PATCH] Revert "Bug 23237: Plugin allow [% INCLUDE %] from template" This reverts commit 99ea979bd68663824d6962be0703bdbd09ae323e. Signed-off-by: Lucas Gass --- Koha/Plugins/Base.pm | 48 +------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index cca748837b..1a3aae6c22 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -117,32 +117,6 @@ sub retrieve_data { get_template returns a Template object. Eventually this will probably be calling C4:Template, but at the moment, it does not. -The returned template contains 3 variables that can be used in the plugin -templates: - -=over 8 - -=item B - -The name of the plugin class. - -=item B - -Then name of the plugin method used. For example 'tool' or 'report'. - -=item B - -The URL path to the plugin. It can be used in templates in order to localize -ressources like images in html tags, or other templates. - -=item B - -The absolute pathname to the plugin directory. Necessary to include other -templates from a template with the [% INCLUDE %] directive. - -=over - - =cut sub get_template { @@ -166,7 +140,6 @@ sub get_template { CLASS => $self->{'class'}, METHOD => scalar $self->{'cgi'}->param('method'), PLUGIN_PATH => $self->get_plugin_http_path(), - PLUGIN_DIR => $self->get_plugin_dir(), ); return $template; @@ -175,10 +148,7 @@ sub get_template { sub get_metadata { my ( $self, $args ) = @_; - #FIXME: Why another encoding issue? For metadata containg non latin characters. - my $metadata = $self->{metadata}; - utf8::decode($metadata->{$_}) for keys %$metadata; - return $metadata; + return $self->{'metadata'}; } =head2 get_qualified_table_name @@ -213,22 +183,6 @@ sub get_plugin_http_path { return "/plugin/" . join( '/', split( '::', $self->{'class'} ) ); } -=head2 get_plugin_dir - -To [% INCLUDE %] another TT template from a template, an absolute path to the -template is required. This method returns that absolute file system path. - -usage: my $path = $self->get_plugin_dir(); - -=cut - -sub get_plugin_dir { - my ($self) = @_; - - my $base = C4::Context->config('pluginsdir'); - return "$base/" . join( '/', split( '::', $self->{'class'} ) ); -} - =head2 go_home go_home is a quick redirect to the Koha plugins home page -- 2.39.5