Bug 10206 - Add Koha TT Plugin - Koha.Preference
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 6 May 2013 18:25:23 +0000 (14:25 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 15 Aug 2013 18:08:20 +0000 (15:08 -0300)
commitb08e95bd5071876731951c51f1194887895cde8d
treea0f91c92df90e2d863601cfcd9e307d2d1297511
parentd7e697b711eb04f7d13007be161d3ae64d31c7eb
Bug 10206 - Add Koha TT Plugin - Koha.Preference

This plugin is meant to be a place to put general purpose TT functions
directly related to Koha. If a plugin is not a filter, and does not
have more than one subroutine, that subroutine most likely belongs
in this TT plugin.

This first and only function the plugin currently has is Preference,
which allows a template to get the value of a system preference without,
it needing to be passed in from a perl script.

For example, to use, first include the line '[% USE Koha %]' at the top
of the template to enable the plugin, then do something like this
to check the value of a system prefence in the template:

[% IF Koha.Preference( 'MyPreference ) == 'SettingA' %] ...

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7e10f6fb78ae7fa2dfc4f52a3791ac35082237ac)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/Template/Plugin/Koha.pm [new file with mode: 0644]