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

(-)a/C4/Auth.pm (-24 / +6 lines)
Lines 387-402 sub get_template_and_user { Link Here
387
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
387
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
388
            $opac_name = C4::Context->userenv->{'branch'};
388
            $opac_name = C4::Context->userenv->{'branch'};
389
        }
389
        }
390
	my $checkstyle = C4::Context->preference("opaccolorstylesheet");
391
	if ($checkstyle =~ /http/)
392
	{
393
            	$template->param( opacexternalsheet => $checkstyle);
394
	} else
395
	{
396
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
397
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
398
	}
399
        $template->param(
390
        $template->param(
391
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
400
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
392
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
401
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
393
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
402
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
394
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
Lines 439-445 sub get_template_and_user { Link Here
439
            hidelostitems             => C4::Context->preference("hidelostitems"),
431
            hidelostitems             => C4::Context->preference("hidelostitems"),
440
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
432
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
441
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
433
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
442
            opacstylesheet            => "" . C4::Context->preference("opacstylesheet"),
443
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
434
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
444
            opaccredits               => "" . C4::Context->preference("opaccredits"),
435
            opaccredits               => "" . C4::Context->preference("opaccredits"),
445
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
436
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
Lines 944-962 sub checkauth { Link Here
944
    }
935
    }
945
936
946
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
937
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
947
    my $template = C4::Templates::gettemplate( $template_name, $type, $query );
938
    my $template = C4::Templates::gettemplate($template_name, $type, $query );
948
    $template->param(branchloop => \@branch_loop,);
949
    my $checkstyle = C4::Context->preference("opaccolorstylesheet");
950
    if ($checkstyle =~ /\//)
951
	{
952
            	$template->param( opacexternalsheet => $checkstyle);
953
	} else
954
	{
955
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
956
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
957
	}
958
    $template->param(
939
    $template->param(
959
    login        => 1,
940
        branchloop           => \@branch_loop,
941
        opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
942
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
943
        login                => 1,
960
        INPUTS               => \@inputs,
944
        INPUTS               => \@inputs,
961
        casAuthentication    => C4::Context->preference("casAuthentication"),
945
        casAuthentication    => C4::Context->preference("casAuthentication"),
962
        suggestion           => C4::Context->preference("suggestion"),
946
        suggestion           => C4::Context->preference("suggestion"),
Lines 969-975 sub checkauth { Link Here
969
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
953
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
970
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
954
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
971
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
955
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
972
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
973
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
956
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
974
        opacuserjs           => C4::Context->preference("opacuserjs"),
957
        opacuserjs           => C4::Context->preference("opacuserjs"),
975
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
958
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
Lines 980-986 sub checkauth { Link Here
980
        opacheader           => C4::Context->preference("opacheader"),
963
        opacheader           => C4::Context->preference("opacheader"),
981
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
964
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
982
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
965
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
983
        opacstylesheet       => C4::Context->preference("opacstylesheet"),
984
        intranetcolorstylesheet =>
966
        intranetcolorstylesheet =>
985
								C4::Context->preference("intranetcolorstylesheet"),
967
								C4::Context->preference("intranetcolorstylesheet"),
986
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
968
        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 89-95 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
89
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
89
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('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea');
90
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('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
91
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('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
93
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
92
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
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');
93
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');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
94
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 138-154 OPAC: Link Here
138
            - Include the additional CSS stylesheet
138
            - Include the additional CSS stylesheet
139
            - pref: opaccolorstylesheet
139
            - pref: opaccolorstylesheet
140
              class: file
140
              class: file
141
            - 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.
141
            - 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.
142
        -
142
        -
143
            - Use the CSS stylesheet
143
            - Use the CSS stylesheet
144
            - pref: opaclayoutstylesheet
144
            - pref: opaclayoutstylesheet
145
              class: file
145
              class: file
146
            - 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.
146
            - 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.
147
        -
148
            - Use the remote CSS stylesheet
149
            - pref: opacstylesheet
150
              class: file
151
            - on all pages in the OPAC, instead of the default. (This should be a complete URL, starting with <code>http://</code>.)
152
        -
147
        -
153
            - "Include the following CSS on all pages in the OPAC:"
148
            - "Include the following CSS on all pages in the OPAC:"
154
            - pref: OPACUserCSS
149
            - 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('^http:|^\/')) %]
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('^http:|^\/')) %]
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