From fd4c6fe5a95ad43920eda43507934e1afb35ccdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?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. --- .../bootstrap/en/includes/masthead-langmenu.inc | 36 +++++++++++++++++ .../opac-tmpl/bootstrap/en/includes/masthead.inc | 41 ++------------------ 2 files changed, 40 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 0000000..d193d40 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc @@ -0,0 +1,36 @@ + +[% 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 1ccd2be..e034009 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 %]