From 18d34956e3104f391d2560064bb5fcd984edfe7d Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 13 Jul 2018 01:20:30 +0200 Subject: [PATCH] Bug 20988: Add template macros to ease template rewriting --- .../intranet-tmpl/prog/en/includes/i18n.inc | 66 +++++++++++++++++++ .../opac-tmpl/bootstrap/en/includes/i18n.inc | 66 +++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc index 4b5da9231b..b9fdf1b03c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc @@ -37,3 +37,69 @@ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars); END; %] + +[% + MACRO html(s) BLOCK; + FILTER html; + s; + END; + END; + + MACRO html_entity(s) BLOCK; + FILTER html_entity; + s; + END; + END; + + MACRO html_line_break(s) BLOCK; + FILTER html_line_break; + s; + END; + END; + + MACRO url(s) BLOCK; + FILTER url; + s; + END; + END; + + MACRO collapse(s) BLOCK; + FILTER collapse; + s; + END; + END; + + MACRO format(s, fmt) BLOCK; + FILTER format(fmt); + s; + END; + END; + + MACRO HtmlTags(s) BLOCK; + USE HtmlTags; + FILTER $HtmlTags tag=tag attributes=attributes; + s; + END; + END; + + MACRO Price(s) BLOCK; + USE Price; + FILTER $Price; + s; + END; + END; + + MACRO KohaDates(s) BLOCK; + USE KohaDates; + FILTER $KohaDates with_hours=with_hours as_due_date=as_due_date; + s; + END; + END; + + MACRO KohaSpan(s) BLOCK; + USE KohaSpan; + FILTER $KohaSpan class=class; + s; + END; + END; +%] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc index 4b5da9231b..b9fdf1b03c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc @@ -37,3 +37,69 @@ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars); END; %] + +[% + MACRO html(s) BLOCK; + FILTER html; + s; + END; + END; + + MACRO html_entity(s) BLOCK; + FILTER html_entity; + s; + END; + END; + + MACRO html_line_break(s) BLOCK; + FILTER html_line_break; + s; + END; + END; + + MACRO url(s) BLOCK; + FILTER url; + s; + END; + END; + + MACRO collapse(s) BLOCK; + FILTER collapse; + s; + END; + END; + + MACRO format(s, fmt) BLOCK; + FILTER format(fmt); + s; + END; + END; + + MACRO HtmlTags(s) BLOCK; + USE HtmlTags; + FILTER $HtmlTags tag=tag attributes=attributes; + s; + END; + END; + + MACRO Price(s) BLOCK; + USE Price; + FILTER $Price; + s; + END; + END; + + MACRO KohaDates(s) BLOCK; + USE KohaDates; + FILTER $KohaDates with_hours=with_hours as_due_date=as_due_date; + s; + END; + END; + + MACRO KohaSpan(s) BLOCK; + USE KohaSpan; + FILTER $KohaSpan class=class; + s; + END; + END; +%] -- 2.17.1