Bugzilla – Attachment 39724 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]
(Fixup) Fixes multiple issues in comment #40
Fixup-Fixes-multiple-issues-in-comment-40.patch (text/plain), 13.96 KB, created by
Indranil Das Gupta
on 2015-05-31 22:37:54 UTC
(
hide
)
Description:
(Fixup) Fixes multiple issues in comment #40
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-05-31 22:37:54 UTC
Size:
13.96 KB
patch
obsolete
>From 8c5eec6e079941b1c5259afd84cd0298470a03f5 Mon Sep 17 00:00:00 2001 >From: Indranil Das Gupta <indradg@gmail.com> >Date: Mon, 1 Jun 2015 03:00:38 +0530 >Subject: [PATCH] (Fixup) Fixes multiple issues in comment #40 > >Small fix - addresses the concerns pointed to by Mark Tompsett in >comment #40 (code review) > >http://bugs.koha-community.org/show_bug.cgi?id=14252 >--- > .../bug_14252-OpacLangSelectorMode_syspref.sql | 2 +- > installer/data/mysql/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/opac.pref | 2 +- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 74 +++++++++++----------- > .../bootstrap/en/includes/opac-bottom.inc | 2 +- > 5 files changed, 40 insertions(+), 42 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql b/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql >index edaed6c..229a7a5 100644 >--- a/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql >+++ b/installer/data/mysql/atomicupdate/bug_14252-OpacLangSelectorMode_syspref.sql >@@ -1,4 +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'); >+INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLangSelectorMode','both','both|mast|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 5f1de08..cfa9616 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -270,7 +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'), >+('OpacLangSelectorMode','both','both|mast|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 02c11ff..f15a3e8 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 >@@ -322,7 +322,7 @@ OPAC: > - pref: OpacLangSelectorMode > choices: > both: "both masthead and footer" >- head: "only header" >+ mast: "only masthead" > foot: "only footer" > Features: > - >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index c8dff49..45f5fad 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] > <div id="wrap"> > <div id="header-region" class="noprint"> > <div class="navbar navbar-inverse navbar-static-top"> >@@ -9,9 +10,6 @@ > [% IF ( LibraryNameTitle ) %] > [% LibraryNameTitle %] > [% ELSE %] >- Koha online >- [% END %] >- </a> > </h1> > [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] > <div id="cartDetails" class="cart-message">Your cart is empty.</div> >@@ -71,41 +69,41 @@ > <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 ) %] >- <li class="dropdown"> >- <a href="#" title="Switch languages" class="dropdown-toggle" id="langmenu" data-toggle="dropdown" role="button"><i class="icon-flag icon-white"></i> <span class="langlabel">Languages</span> <b class="caret"></b></a> >- <ul aria-labelledby="langmenu" role="menu" class="dropdown-menu"> >- [% FOREACH languages_loo IN languages_loop.sort('rfc4646_subtag') %] >- [% IF ( languages_loo.group_enabled ) %] >- [% IF ( languages_loo.plural ) %] >- [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >- [% IF ( sublanguages_loo.enabled ) %] >- [% IF ( sublanguages_loo.sublanguage_current ) %] >- <li role="presentation"> <a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] <i class="icon-ok"></i></a></li> >- [% ELSE %] >- <li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]</a></li> >- [% END %] >- [% END # / IF sublanguages_loo.enabled %] >- [% END # / FOREACH sublanguages_loo %] >- [% ELSE %] >- [% IF ( languages_loo.group_enabled ) %] >- [% IF ( languages_loo.current ) %] >- <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <i class="icon-ok"></i></a></li> >- [% ELSE %] >- <li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink">[% 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> <!-- /# .dropdown-menu --> >- </li> <!-- / .dropdown --> >- [% END # / UNLESS ( one_language_enabled ) %] >- [% END # / IF ( languages_loop && opaclanguagesdisplay ) %] >- [% END # / IF opaclanguagesdisplay %] >+ [% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'mast' %] >+ [% IF ( opaclanguagesdisplay ) %] >+ [% IF ( languages_loop && opaclanguagesdisplay ) %] >+ [% UNLESS ( one_language_enabled ) %] >+ <li class="dropdown"> >+ <a href="#" title="Switch languages" class="dropdown-toggle" id="langmenu" data-toggle="dropdown" role="button"><i class="icon-flag icon-white"></i> <span class="langlabel">Languages</span> <b class="caret"></b></a> >+ <ul aria-labelledby="langmenu" role="menu" class="dropdown-menu"> >+ [% FOREACH languages_loo IN languages_loop.sort('rfc4646_subtag') %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.plural ) %] >+ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >+ [% IF ( sublanguages_loo.enabled ) %] >+ [% IF ( sublanguages_loo.sublanguage_current ) %] >+ <li role="presentation"> <a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] <i class="icon-ok"></i></a></li> >+ [% ELSE %] >+ <li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]</a></li> >+ [% END %] >+ [% END # / IF sublanguages_loo.enabled %] >+ [% END # / FOREACH sublanguages_loo %] >+ [% ELSE %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.current ) %] >+ <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <i class="icon-ok"></i></a></li> >+ [% ELSE %] >+ <li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink">[% 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> <!-- /# .dropdown-menu --> >+ </li> <!-- / .dropdown --> >+ [% END # / UNLESS ( one_language_enabled ) %] >+ [% END # / IF ( languages_loop && opaclanguagesdisplay ) %] >+ [% END # / IF opaclanguagesdisplay %] > [% END # / IF OpacLangSelectorMode %] > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] > [% UNLESS ( loggedinusername ) %] >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 0497621..157eff2 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,7 @@ > [% END # / OpacKohaUrl %] > > </div> <!-- / #wrap in masthead.inc --> >-[% IF ( Koha.Preference( 'OpacLangSelectorMode' ) == 'both' ) || ( Koha.Preference( 'OpacLangSelectorMode' ) == 'foot' ) %] >+[% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'foot' %] > [% IF ( opaclanguagesdisplay ) %] > [% IF ( languages_loop && opaclanguagesdisplay ) %] > [% UNLESS ( one_language_enabled ) %] >-- >1.9.1
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