Bugzilla – Attachment 39859 Details for
Bug 14252
Make the OPAC language switcher available in the masthead navbar, footer, or both.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14252: (followup) Adds OpacLangSelectorMode syspref
Bug-14252-followup-Adds-OpacLangSelectorMode-syspr.patch (text/plain), 10.36 KB, created by
Jonathan Druart
on 2015-06-04 14:06:59 UTC
(
hide
)
Description:
Bug 14252: (followup) Adds OpacLangSelectorMode syspref
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-06-04 14:06:59 UTC
Size:
10.36 KB
patch
obsolete
>From a755133099acbcc9218cd73a048ebed25a76fcc8 Mon Sep 17 00:00:00 2001 >From: Indranil Das Gupta <indradg@gmail.com> >Date: Thu, 28 May 2015 04:18:44 +0530 >Subject: [PATCH] Bug 14252: (followup) Adds OpacLangSelectorMode syspref >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Based on discussion, this followup does the following: > >1/ brings back the switcher on opac-bottom.inc >2/ adds a syspref OpacLangSelectorMode to toggle between the three > modes: > (a) show switcher both on masthead and footer (default) > (b) footer only > (b) masthead only > >Test plan >========= > >1/ apply earlier patches attached to this bug in their correct order >2/ apply this followup patch >3/ run updatedatabase.pl to add in the atomic update >4/ goto admin/preferences.pl?tab=opac >5/ look up OpacLangSelectorMode, it should be set with default value > "both masthead and footer" >6/ check OPAC to see if both locations show the selectors >7/ change OpacLangSelectorMode to 'only header' and 'only footer' at > each iteration, and check if the selection has correctly toggled > the selectors. It should > >Note: make sure you do not have the patch 11057 applied on the branch > from before, otherwise merge conflict might happen. > >http://bugs.koha-community.org/show_bug.cgi?id=14252 > >Followed test plan. Works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > .../bug_14252-OpacLangSelectorMode_syspref.sql | 4 ++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/opac.pref | 7 ++++ > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 2 + > .../bootstrap/en/includes/opac-bottom.inc | 44 +++++++++++++++++++++- > 5 files changed, 57 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql b/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql >new file mode 100644 >index 0000000..edaed6c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql >@@ -0,0 +1,4 @@ >+-- >+-- Adds OpacLangSelectorMode syspref for bug 14252 >+-- >+INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLangSelectorMode','both','both|head|foot','Select the location to display the language selector','Choice'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 9620d67..5f1de08 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -270,6 +270,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'), > ('OPACItemsResultsDisplay','0','','If OFF : show only the status of items in result list.If ON : show full location of items (branch+location+callnumber) as in staff interface','YesNo'), > ('OpacKohaUrl','1',NULL,'Show \'Powered by Koha\' text on OPAC footer.',NULL), >+('OpacLangSelectorMode','both','both|head|foot','Select the location to display the language selector','Choice'), > ('opaclanguages','en',NULL,'Set the default language in the OPAC.','Languages'), > ('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'), > ('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 9a4309c..42abbe0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -317,6 +317,13 @@ OPAC: > - pref: OpacCustomSearch > type: textarea > class: code >+ - >+ - "Display language selector on " >+ - pref: OpacLangSelectorMode >+ choices: >+ both: "both masthead and footer" >+ head: "only header" >+ foot: "only footer" > Features: > - > - pref: opacuserlogin >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index a434304..c8dff49 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -71,6 +71,7 @@ > <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a> > <div id="members"> > <ul class="nav pull-right"> >+ [% IF ( Koha.Preference( 'OpacLangSelectorMode' ) == 'both' ) || ( Koha.Preference( 'OpacLangSelectorMode' ) == 'head' ) %] > [% IF ( opaclanguagesdisplay ) %] > [% IF ( languages_loop && opaclanguagesdisplay ) %] > [% UNLESS ( one_language_enabled ) %] >@@ -105,6 +106,7 @@ > [% END # / UNLESS ( one_language_enabled ) %] > [% END # / IF ( languages_loop && opaclanguagesdisplay ) %] > [% END # / IF opaclanguagesdisplay %] >+ [% END # / IF OpacLangSelectorMode %] > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] > [% UNLESS ( loggedinusername ) %] > [% IF Koha.Preference('casAuthentication') %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index b79c78b..0497621 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -29,7 +29,49 @@ > [% END # / OpacKohaUrl %] > > </div> <!-- / #wrap in masthead.inc --> >- >+[% IF ( Koha.Preference( 'OpacLangSelectorMode' ) == 'both' ) || ( Koha.Preference( 'OpacLangSelectorMode' ) == 'foot' ) %] >+ [% IF ( opaclanguagesdisplay ) %] >+ [% IF ( languages_loop && opaclanguagesdisplay ) %] >+ [% UNLESS ( one_language_enabled ) %] >+ <div id="changelanguage" class="navbar navbar-fixed-bottom navbar-static-bottom"> >+ <div class="navbar-inner"> >+ <ul id="i18nMenu" class="nav"> >+ <li><p class="lang navbar-text"><strong>Languages: </strong></p></li> >+ [% FOREACH languages_loo IN languages_loop %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.plural ) %] >+ <li class="dropdown"> >+ <a data-toggle="dropdown" class="dropdown-toggle sublangs" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <b class="caret"></b></a> >+ <ul id="sub[% languages_loo.rfc4646_subtag %]" class="dropdown-menu"> >+ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >+ [% IF ( sublanguages_loo.enabled ) %] >+ [% IF ( sublanguages_loo.sublanguage_current ) %] >+ <li> <p>[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</p></li> >+ [% ELSE %] >+ <li><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li> >+ [% END %] >+ [% END # / IF sublanguages_loo.enabled %] >+ [% END # / FOREACH sublanguages_loo %] >+ </ul> >+ </li> <!-- / .more --> >+ [% ELSE %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.current ) %] >+ <li class="active"><p class="navbar-text">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</p></li> >+ [% ELSE %] >+ <li><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</a></li> >+ [% END %] >+ [% END # / IF languages_loo.current %] >+ [% END # / IF ( languages_loo.plural ) %] >+ [% END # / IF ( languages_loo.group_enabled ) %] >+ [% END # / FOREACH languages_loo IN languages_loop %] >+ </ul> <!-- / #i18menu --> >+ </div> <!-- / .navbar-inner --> >+ </div> <!-- / #changelanguage --> >+ [% END # / UNLESS ( one_language_enabled ) %] >+ [% END # / IF ( languages_loop && opaclanguagesdisplay ) %] >+ [% END # / IF opaclanguagesdisplay %] >+[% END %] > [% END # / UNLESS is_popup %] > > >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14252
:
39369
|
39433
|
39434
|
39436
|
39443
|
39444
|
39445
|
39446
|
39447
|
39448
|
39449
|
39622
|
39650
|
39706
|
39707
|
39724
|
39725
|
39726
|
39727
|
39728
|
39729
|
39730
|
39731
|
39732
|
39733
|
39734
|
39746
|
39749
|
39857
|
39858
| 39859 |
39860
|
39861
|
39862
|
39863
|
39864