Bugzilla – Attachment 119142 Details for
Bug 28080
Add system preference that allows users to insert HTML in the <head> on all OPAC pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28080: Add OPACHTMLHead system preference
Bug-28080-Add-OPACHTMLHead-system-preference.patch (text/plain), 4.18 KB, created by
Lucas Gass (lukeg)
on 2021-04-02 18:26:06 UTC
(
hide
)
Description:
Bug 28080: Add OPACHTMLHead system preference
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-04-02 18:26:06 UTC
Size:
4.18 KB
patch
obsolete
>From 76d85dfa4ab2ac4bf87533b0af701e9822c307b0 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 2 Apr 2021 18:22:55 +0000 >Subject: [PATCH] Bug 28080: Add OPACHTMLHead system preference > >To test: >-Apply patch >-Look for the syspref OPACHTMLHead >-If you insert HTML it should be present inside the <head> on all pages in the OPAC >-An easy way to test is to add something like this: <style>body{ background: red !important } </style> >-All OPAC pages should then have a red background >--- > installer/data/mysql/atomicupdate/bug_28080_atomicupdate.perl | 7 +++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 6 ++++++ > koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc | 1 + > 4 files changed, 15 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_28080_atomicupdate.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_28080_atomicupdate.perl b/installer/data/mysql/atomicupdate/bug_28080_atomicupdate.perl >new file mode 100644 >index 0000000000..aa3cecc43d >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28080_atomicupdate.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACHTMLHead','', 'Allow the insertion of HTML in the document <head>', NULL,'textarea')" ); >+ >+ # Always end with this (adjust the bug info) >+ NewVersion( $DBversion, 28080, "Allow the insertion of HTML in the document <head> via system preference"); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index b513bd37bd..d596c4b182 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -470,6 +470,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'), > ('OpacTopissue','0',NULL,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server','YesNo'), > ('OPACURLOpenInNewWindow','0',NULL,'If ON, URLs in the OPAC open in a new window','YesNo'), >+('OPACHTMLHead','',NULL,'Add HTML to be included in the OPAC in the document <head> tag.','free'), > ('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded <style> tag.','free'), > ('OPACUserJS','','70|10','Define custom javascript for inclusion in OPAC','Textarea'), > ('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'), >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 67ef50a828..c58a3fba96 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 >@@ -215,6 +215,12 @@ OPAC: > class: url > - for the OPAC's favicon. (This should be a complete URL, starting with <code>http://</code>.) > - >+ - "Include the following in the HTML head on all pages in the OPAC:" >+ - pref: OPACHTMLHead >+ type: textarea >+ syntax: html >+ class: code >+ - > - "Include the following JavaScript on all pages in the OPAC:" > - pref: OPACUserJS > type: textarea >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 e0963ca5d3..5faf4aab8a 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 >@@ -2,6 +2,7 @@ > [% USE Koha %] > [%- USE KohaPlugins -%] > [% USE Asset %] >+[% Koha.Preference( 'OPACHTMLHead' ) | $raw %] > <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" /> >-- >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 28080
:
119142
|
119171