View | Details | Raw Unified | Return to bug 8263
Collapse All | Expand All

(-)a/C4/Auth.pm (-24 / +6 lines)
Lines 388-403 sub get_template_and_user { Link Here
388
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
388
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
389
            $opac_name = C4::Context->userenv->{'branch'};
389
            $opac_name = C4::Context->userenv->{'branch'};
390
        }
390
        }
391
	my $checkstyle = C4::Context->preference("opaccolorstylesheet");
392
	if ($checkstyle =~ /http/)
393
	{
394
            	$template->param( opacexternalsheet => $checkstyle);
395
	} else
396
	{
397
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
398
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
399
	}
400
        $template->param(
391
        $template->param(
392
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
401
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
393
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
402
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
394
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
403
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
395
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
Lines 441-447 sub get_template_and_user { Link Here
441
            hidelostitems             => C4::Context->preference("hidelostitems"),
433
            hidelostitems             => C4::Context->preference("hidelostitems"),
442
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
434
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
443
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
435
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
444
            opacstylesheet            => "" . C4::Context->preference("opacstylesheet"),
445
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
436
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
446
            opaccredits               => "" . C4::Context->preference("opaccredits"),
437
            opaccredits               => "" . C4::Context->preference("opaccredits"),
447
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
438
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
Lines 946-964 sub checkauth { Link Here
946
    }
937
    }
947
938
948
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
939
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
949
    my $template = C4::Templates::gettemplate( $template_name, $type, $query );
940
    my $template = C4::Templates::gettemplate($template_name, $type, $query );
950
    $template->param(branchloop => \@branch_loop,);
951
    my $checkstyle = C4::Context->preference("opaccolorstylesheet");
952
    if ($checkstyle =~ /\//)
953
	{
954
            	$template->param( opacexternalsheet => $checkstyle);
955
	} else
956
	{
957
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
958
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
959
	}
960
    $template->param(
941
    $template->param(
961
    login        => 1,
942
        branchloop           => \@branch_loop,
943
        opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
944
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
945
        login                => 1,
962
        INPUTS               => \@inputs,
946
        INPUTS               => \@inputs,
963
        casAuthentication    => C4::Context->preference("casAuthentication"),
947
        casAuthentication    => C4::Context->preference("casAuthentication"),
964
        suggestion           => C4::Context->preference("suggestion"),
948
        suggestion           => C4::Context->preference("suggestion"),
Lines 972-978 sub checkauth { Link Here
972
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
956
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
973
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
957
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
974
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
958
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
975
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
976
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
959
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
977
        opacuserjs           => C4::Context->preference("opacuserjs"),
960
        opacuserjs           => C4::Context->preference("opacuserjs"),
978
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
961
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
Lines 983-989 sub checkauth { Link Here
983
        opacheader           => C4::Context->preference("opacheader"),
966
        opacheader           => C4::Context->preference("opacheader"),
984
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
967
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
985
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
968
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
986
        opacstylesheet       => C4::Context->preference("opacstylesheet"),
987
        intranetcolorstylesheet =>
969
        intranetcolorstylesheet =>
988
								C4::Context->preference("intranetcolorstylesheet"),
970
								C4::Context->preference("intranetcolorstylesheet"),
989
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
971
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
(-)a/C4/Templates.pm (-4 / +3 lines)
Lines 104-112 sub output { Link Here
104
      ( $self->{interface} ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' );
104
      ( $self->{interface} ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' );
105
    $vars->{theme} = $self->theme;
105
    $vars->{theme} = $self->theme;
106
    $vars->{opaccolorstylesheet} =
106
    $vars->{opaccolorstylesheet} =
107
      C4::Context->preference('opaccolorstylesheet');
107
        C4::Context->preference('opaccolorstylesheet');
108
    $vars->{opacsmallimage} = C4::Context->preference('opacsmallimage');
108
    $vars->{opacsmallimage} = C4::Context->preference('opacsmallimage');
109
    $vars->{opacstylesheet} = C4::Context->preference('opacstylesheet');
109
    $vars->{opaclayoutstylesheet} =
110
        C4::Context->preference('opaclayoutstylesheet');
110
111
111
    # add variables set via param to $vars for processing
112
    # add variables set via param to $vars for processing
112
    # and clean any utf8 mess
113
    # and clean any utf8 mess
Lines 211-217 sub _get_template_file { Link Here
211
    my $is_intranet = $interface eq 'intranet';
212
    my $is_intranet = $interface eq 'intranet';
212
    my $htdocs = C4::Context->config($is_intranet ? 'intrahtdocs' : 'opachtdocs');
213
    my $htdocs = C4::Context->config($is_intranet ? 'intrahtdocs' : 'opachtdocs');
213
    my ($theme, $lang) = themelanguage($htdocs, $tmplbase, $interface, $query);
214
    my ($theme, $lang) = themelanguage($htdocs, $tmplbase, $interface, $query);
214
    my $opacstylesheet = C4::Context->preference('opacstylesheet');
215
215
216
    # if the template doesn't exist, load the English one as a last resort
216
    # if the template doesn't exist, load the English one as a last resort
217
    my $filename = "$htdocs/$theme/$lang/modules/$tmplbase";
217
    my $filename = "$htdocs/$theme/$lang/modules/$tmplbase";
Lines 227-233 sub gettemplate { Link Here
227
    my ( $tmplbase, $interface, $query ) = @_;
227
    my ( $tmplbase, $interface, $query ) = @_;
228
    ($query) or warn "no query in gettemplate";
228
    ($query) or warn "no query in gettemplate";
229
    my $path = C4::Context->preference('intranet_includes') || 'includes';
229
    my $path = C4::Context->preference('intranet_includes') || 'includes';
230
    my $opacstylesheet = C4::Context->preference('opacstylesheet');
231
    $tmplbase =~ s/\.tmpl$/.tt/;
230
    $tmplbase =~ s/\.tmpl$/.tt/;
232
    my ($htdocs, $theme, $lang, $filename)
231
    my ($htdocs, $theme, $lang, $filename)
233
       =  _get_template_file($tmplbase, $interface, $query);
232
       =  _get_template_file($tmplbase, $interface, $query);
(-)a/admin/systempreferences.pl (-1 lines)
Lines 335-341 $tabsysprefs{opaccredits} = "OPAC"; Link Here
335
$tabsysprefs{opaclayoutstylesheet}       = "OPAC";
335
$tabsysprefs{opaclayoutstylesheet}       = "OPAC";
336
$tabsysprefs{OpacNav}                    = "OPAC";
336
$tabsysprefs{OpacNav}                    = "OPAC";
337
$tabsysprefs{opacsmallimage}             = "OPAC";
337
$tabsysprefs{opacsmallimage}             = "OPAC";
338
$tabsysprefs{opacstylesheet}             = "OPAC";
339
$tabsysprefs{opacthemes}                 = "OPAC";
338
$tabsysprefs{opacthemes}                 = "OPAC";
340
$tabsysprefs{opacuserjs}                 = "OPAC";
339
$tabsysprefs{opacuserjs}                 = "OPAC";
341
$tabsysprefs{opacheader}                 = "OPAC";
340
$tabsysprefs{opacheader}                 = "OPAC";
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 90-96 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
90
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
90
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
91
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea');
91
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea');
92
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
92
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
93
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
94
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
93
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacTopissue',0,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server',NULL,'YesNo');
94
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacTopissue',0,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server',NULL,'YesNo');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-7 / +2 lines)
Lines 151-167 OPAC: Link Here
151
            - Include the additional CSS stylesheet
151
            - Include the additional CSS stylesheet
152
            - pref: opaccolorstylesheet
152
            - pref: opaccolorstylesheet
153
              class: file
153
              class: file
154
            - to override specified settings from the default stylesheet (leave blank to disable). Enter a filename or a complete URL beginning with <code>http://</code> (if the file lives on a remote server). Please note that if you enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory.
154
            - to override specified settings from the default stylesheet (leave blank to disable). Enter just a filename, a full local path or a complete URL starting with <code>http://</code> (if the file lives on a remote server). Please note that if you just enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory. A full local path is expected to start from your HTTP document root.
155
        -
155
        -
156
            - Use the CSS stylesheet
156
            - Use the CSS stylesheet
157
            - pref: opaclayoutstylesheet
157
            - pref: opaclayoutstylesheet
158
              class: file
158
              class: file
159
            - on all pages in the OPAC, instead of the default (leave blank to disable). Please enter filename only. The file should be in the css subdirectory for each active theme and language within the Koha templates directory.
159
            - on all pages in the OPAC, instead of the default css (used when leaving this field blank). Enter just a filename, a full local path or a complete URL starting with <code>http://</code> (if the file lives on a remote server). Please note that if you just enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory. A full local path is expected to start from your HTTP document root.
160
        -
161
            - Use the remote CSS stylesheet
162
            - pref: opacstylesheet
163
              class: file
164
            - on all pages in the OPAC, instead of the default. (This should be a complete URL, starting with <code>http://</code>.)
165
        -
160
        -
166
            - "Include the following CSS on all pages in the OPAC:"
161
            - "Include the following CSS on all pages in the OPAC:"
167
            - pref: OPACUserCSS
162
            - pref: OPACUserCSS
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc (-7 / +11 lines)
Lines 3-15 Link Here
3
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
3
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
4
<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
4
<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
6
[% IF ( opacstylesheet ) %]<link rel="stylesheet" type="text/css" href="[% opacstylesheet %]" />[% ELSE %]
6
[% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
7
[% IF ( opaclayoutstylesheet ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaclayoutstylesheet %]" />[% ELSE %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/opac.css" />[% END %][% END %]
7
[% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
8
[% IF ( opaccolorstylesheet ) %]
8
    <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
9
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaccolorstylesheet %]" />
9
[% ELSE %]
10
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaclayoutstylesheet %]" />
10
[% END %]
11
[% END %]
11
[% IF ( opacexternalsheet ) %]
12
[% IF ( opaccolorstylesheet ) %]
12
    <link rel="stylesheet" type="text/css" href="[% opacexternalsheet %]" />
13
    [% IF (opaccolorstylesheet.match('^https?:|^\/')) %]
14
        <link rel="stylesheet" type="text/css" href="[% opaccolorstylesheet %]" />
15
    [% ELSE %]
16
        <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaccolorstylesheet %]" />
17
    [% END %]
13
[% END %]
18
[% END %]
14
[% IF ( opac_css_override ) %]
19
[% IF ( opac_css_override ) %]
15
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" />
20
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" />
16
- 

Return to bug 8263