From 17b3e3c9ebb4ce437a56cee817ee1781ebfce697 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Tue, 20 Oct 2015 17:03:16 +0200 Subject: [PATCH] Bug 15039: Move top language menu to include and streamline logic The language menu in koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc is used at other places as well (see Bug 14776). This patch moves it to a file masthead-langmenu.inc to make it re-usable. Additionally it streamlines the logic (not all combinations of Opac sysprefs that should display the menu did so). To test: - Apply patch - Verify, that the language menu displays / does not display with combinations of: - opaclanguagedisplay (Allow) - opaclanguages ( > 1 language selected) - OpacLangSelectorMode (top or both) - Verify that sysprefs opacuserlogin and EnableOpacSearchHistory do not interfere with the lenguage menu (before, at least one of them had to be on to display the menu) - Verify that language switching works as before. Signed-off-by: Chris Kirby Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../en/includes/masthead-langmenu.inc | 35 ++++++++++++++++ .../bootstrap/en/includes/masthead.inc | 41 ++----------------- 2 files changed, 39 insertions(+), 37 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc new file mode 100644 index 0000000000..9c87eae30d --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc @@ -0,0 +1,35 @@ + +[% IF ( ( opaclanguagesdisplay ) && + ( ! one_language_enabled ) && + ( languages_loop ) && + ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'top') ) +%] + +[% END # / IF opaclanguagedisplay %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 1ccd2be1f3..e034009480 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -68,46 +68,13 @@ [% END # / IF virtualshelves %] [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
[% END %] - [% IF Koha.Preference( 'opacuserlogin' ) == 1 || EnableOpacSearchHistory %] + [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]