[Koha-patches] [PATCH] [SIGNED-OFF] Bug 9558 - Customize CSS for mobile

Srdjan srdjan at catalyst.net.nz
Tue Jun 4 08:09:27 CEST 2013


From: Zachary Spalding <spalding at senylrc.org>

It is possible to use an environment variable to specify a custom
stylesheet for different libraries in a multi-library system:
$ENV{'OPAC_CSS_OVERRIDE'}. This patch adds an additional option to
override the CCSR theme's mobile stylesheet.

The changes in this patch are courtesy Zachary Spalding as described in
Bug 9558. Patch and test plan created by Owen Leonard.

Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
 C4/Auth.pm                                              | 1 +
 koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index 9dba387..d68b41e 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -409,6 +409,7 @@ sub get_template_and_user {
             OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
                    ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
             opac_css_override         => $ENV{'OPAC_CSS_OVERRIDE'},
+            opac_css_override_mobile  => $ENV{'OPAC_CSS_OVERRIDE_MOBILE'},
             opac_search_limit         => $opac_search_limit,
             opac_limit_override       => $opac_limit_override,
             OpacBrowser               => C4::Context->preference("OpacBrowser"),
diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc
index fcbab2a..eb71770 100644
--- a/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc
+++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc
@@ -18,6 +18,9 @@
         <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaccolorstylesheet %]" />
     [% END %]
 [% END %]
+[% IF ( opac_css_override_mobile ) %]
+    <link rel="stylesheet" type="text/css" media="screen and (max-width:700px)" href="[% themelang %]/css/[% opac_css_override_mobile %]" />
+ [% END %]
 [% IF ( opac_css_override ) %]
     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" />
 [% END %]
-- 
1.8.1.2



More information about the Koha-patches mailing list