Bugzilla – Attachment 91654 Details for
Bug 23078
Use Koha.Preference in OPAC global header include
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23078: Use Koha.Preference in OPAC global header include
Bug-23078-Use-KohaPreference-in-OPAC-global-header.patch (text/plain), 6.34 KB, created by
Nick Clemens (kidclamp)
on 2019-07-19 13:41:19 UTC
(
hide
)
Description:
Bug 23078: Use Koha.Preference in OPAC global header include
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-07-19 13:41:19 UTC
Size:
6.34 KB
patch
obsolete
>From 8938116a625dad8d127ce7185c9a16af04ec22bb Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 7 Jun 2019 12:52:45 +0000 >Subject: [PATCH] Bug 23078: Use Koha.Preference in OPAC global header include > >This patch updates the OPAC's doc-head-close.inc so that it uses >'Koha.Preference' syntax to output system preference data. The patch >removes handling of two preferences from Auth.pm which which are covered >by this template change. > >This patch also makes some minor changes to consolidate multiple >template checks for "bidi" > >To test, apply the patch and test the affected OPAC system preferences: > > - OpacFavicon > - opaclayoutstylesheet > - OPACUserCSS > - OPACBaseURL > >Confirm that changes made to these preferences are reflected in the >OPAC. > >Signed-off-by: frederik <frederik@inlibro.com> >Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Auth.pm | 2 -- > .../bootstrap/en/includes/doc-head-close.inc | 31 ++++++++++++---------- > 2 files changed, 17 insertions(+), 16 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index d79ce466e0..ba3c00b5e7 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -549,7 +549,6 @@ sub get_template_and_user { > > my @search_groups = Koha::Library::Groups->get_search_groups({ interface => 'opac' }); > $template->param( >- OpacAdditionalStylesheet => C4::Context->preference("OpacAdditionalStylesheet"), > AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), > LibrarySearchGroups => \@search_groups, > opac_name => $opac_name, >@@ -582,7 +581,6 @@ sub get_template_and_user { > 'Version' => C4::Context->preference('Version'), > hidelostitems => C4::Context->preference("hidelostitems"), > mylibraryfirst => ( C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv ) ? C4::Context->userenv->{'branch'} : '', >- opaclayoutstylesheet => "" . C4::Context->preference("opaclayoutstylesheet"), > opacbookbag => "" . C4::Context->preference("opacbookbag"), > opaccredits => "" . C4::Context->preference("opaccredits"), > OpacFavicon => C4::Context->preference("OpacFavicon"), >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >index ad2217e500..9d4e0f532f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >@@ -1,50 +1,53 @@ > [% USE raw %] >+[% USE Koha %] > [%- USE KohaPlugins -%] > [% USE Asset %] > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats --> > <meta name="viewport" content="width=device-width, initial-scale=1" /> >-<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon | html %][% ELSE %][% interface | html %]/[% theme | html %]/images/favicon.ico[% END %]" type="image/x-icon" /> >+<link rel="shortcut icon" href="[% IF ( Koha.Preference('OpacFavicon') ) %][% Koha.Preference('OpacFavicon') | url %][% ELSE %][% interface | url %]/[% theme | url %]/images/favicon.ico[% END %]" type="image/x-icon" /> > [% IF ( bidi ) %] > [% Asset.css("lib/bootstrap/css/bootstrap-rtl.min.css") | $raw %] >+ [% Asset.css("lib/jquery/jquery-ui-rtl.css") | $raw %] >+ [% Asset.css("css/right-to-left.css") | $raw %] > [% ELSE %] > [% Asset.css("lib/bootstrap/css/bootstrap.min.css") | $raw %] >+ [% Asset.css("lib/jquery/jquery-ui.css") | $raw %] > [% END %] >- >-[% IF ( bidi ) %] >- [% Asset.css("lib/jquery/jquery-ui-rtl.css") | $raw %] >+[% IF ( Koha.Preference('opaclayoutstylesheet') ) %] >+ [% SET opaclayoutstylesheet = Koha.Preference('opaclayoutstylesheet') %] > [% ELSE %] >- [% Asset.css("lib/jquery/jquery-ui.css") | $raw %] >+ [% SET opaclayoutstylesheet = 'opac.css' %] > [% END %] >- >-[% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %] > [% IF (opaclayoutstylesheet.match('^https?:|^\/')) %] > <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet | url %]" /> > [% ELSE %] > [% Asset.css("css/" _ opaclayoutstylesheet) | $raw %] > [% END %] >-[% IF ( OpacAdditionalStylesheet ) %] >+[% IF ( Koha.Preference('OpacAdditionalStylesheet') ) %] >+ [% SET OpacAdditionalStylesheet = Koha.Preference('OpacAdditionalStylesheet') %] > [% IF (OpacAdditionalStylesheet.match('^https?:|^\/')) %] > <link rel="stylesheet" type="text/css" href="[% OpacAdditionalStylesheet | url %]" /> > [% ELSE %] >- <link rel="stylesheet" type="text/css" href="[% interface | html %]/[% theme | html %]/css/[% OpacAdditionalStylesheet | html %]" /> >+ <link rel="stylesheet" type="text/css" href="[% interface | url %]/[% theme | url %]/css/[% OpacAdditionalStylesheet | url %]" /> > [% END %] > [% END %] > [% IF ( opac_css_override ) %] >- <link rel="stylesheet" type="text/css" href="[% interface | html %]/[% theme | html %]/css/[% opac_css_override | html %]" /> >+ <link rel="stylesheet" type="text/css" href="[% interface | url %]/[% theme | url %]/css/[% opac_css_override | url %]" /> > [% END %] > [% Asset.css("css/print.css", { media = "print" }) | $raw %] >-[% IF ( bidi ) %] >- [% Asset.css("css/right-to-left.css") | $raw %] >+[% IF ( Koha.Preference('OPACUserCSS') ) %] >+ <style>[% Koha.Preference('OPACUserCSS') | $raw %]</style> > [% END %] >-[% IF ( OPACUserCSS ) %]<style>[% OPACUserCSS | $raw %]</style>[% END %] > [% IF SCO_login %] > [% SET SCOUserCSS = Koha.Preference('SCOUserCSS') %] > [% IF SCOUserCSS %] > <style>[% SCOUserCSS | $raw %]</style> > [% END %] > [% END %] >-<link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL | url %]/cgi-bin/koha/unapi" /> >+[% IF ( Koha.Preference('OPACBaseURL') ) %] >+ <link rel="unapi-server" type="application/xml" title="unAPI" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/unapi" /> >+[% END %] > [% PROCESS cssinclude %] > <!-- Respond.js brings responsive layout behavior to IE < v.9 --> > <!--[if lt IE 9]> >-- >2.11.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 23078
:
90460
|
90481
|
90936
|
91349
|
91430
|
91431
|
91503
|
91626
|
91627
| 91654 |
91655