Bug 22318: Extend Koha news feature to include other content areas
authorOwen Leonard <oleonard@myacpl.org>
Thu, 14 Feb 2019 15:46:24 +0000 (15:46 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 18 Apr 2019 10:47:03 +0000 (10:47 +0000)
commitcb83128f62f258ad4bf97896b44fbf0ca65f7b35
tree40a1f13cc8c597e607edf199c028a19618875ced
parent0c95e22afe13349b60d134217fce6718bfa9727f
Bug 22318: Extend Koha news feature to include other content areas

This patch lays the groundwork for using the Koha news tool to replace
OPAC system preferences which embed HTML content in the Koha interface.
This will allow multiple translations of these content blocks to be
created.

This adds a new template plugin, KohaNews. It has a single subroutine,
get(), which takes three parameters:

 - "location" -- the area of the template where the content will appear.
   This will correspond to the system preference it replaces:
   OpacMainUserBlock, OpacNavRight, etc.
 - "lang" -- the user's currently-selected language.
 - "library" -- the user's home library (if they are logged in)

A new "koha_news_block" block is added to the OPAC templates'
html_helpers include. The content area is activated in the template
using this syntax:

[% PROCESS koha_news_block news => KohaNews.get( location =>
"OpacNavRight", lang => news_lang, library => branchcode ) %]

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/Template/Plugin/KohaNews.pm [new file with mode: 0644]
koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc