Bug 15039 - Move top language menu to include and streamline logic
Summary: Move top language menu to include and streamline logic
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 14776
  Show dependency treegraph
 
Reported: 2015-10-20 15:01 UTC by Marc Véron
Modified: 2016-06-21 21:40 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15039 - Move top language menu to include and streamline logic (10.18 KB, patch)
2015-10-20 15:14 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15039 - Move top language menu to include and streamline logic (10.15 KB, patch)
2015-10-20 16:00 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15039 - Move top language menu to include and streamline logic (10.28 KB, patch)
2015-10-22 08:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-10-20 15:01:42 UTC
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).
Comment 1 Marc Véron 2015-10-20 15:14:06 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-10-20 16:00:52 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-10-21 14:03:46 UTC
Marc, why didn't you use the include into includes/opac-bottom.inc? (I didn't check line by line if it was the same piece of code)
Comment 4 Marc Véron 2015-10-21 14:16:51 UTC
(In reply to Jonathan Druart from comment #3)
> Marc, why didn't you use the include into includes/opac-bottom.inc? (I
> didn't check line by line if it was the same piece of code)

Jonathan, because the language switcher in the bottomline is different to the language switcher in the header.
Comment 5 Chris Kirby 2015-10-21 16:09:39 UTC
Comment on attachment 43653 [details] [review]
Bug 15039 - Move top language menu to include and streamline logic

Signed off on patch.

Applied patch 

- Verified, that the language menu displays / does not display with combinations of:
  - opaclanguagedisplay (Allow)
  - opaclanguages ( > 1 language selected)
  - OpacLangSelectorMode (top or both)
- Verified that sysprefs opacuserlogin and EnableOpacSearchHistory did not interfere: 
  with the lenguage menu (before, at least one of them had to be on to display the menu)
- Verified that language switching works as before.
Comment 6 Jonathan Druart 2015-10-22 08:21:22 UTC
Created attachment 43742 [details] [review]
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 <christopherlawrencekirby@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Tomás Cohen Arazi 2015-10-22 15:03:04 UTC
Patch pushed to master.

Thanks Marc!