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

(-)a/C4/Auth.pm (-24 / +6 lines)
Lines 386-401 sub get_template_and_user { Link Here
386
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
386
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
387
            $opac_name = C4::Context->userenv->{'branch'};
387
            $opac_name = C4::Context->userenv->{'branch'};
388
        }
388
        }
389
	my $checkstyle = C4::Context->preference("opaccolorstylesheet");
390
	if ($checkstyle =~ /http/)
391
	{
392
            	$template->param( opacexternalsheet => $checkstyle);
393
	} else
394
	{
395
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
396
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
397
	}
398
        $template->param(
389
        $template->param(
390
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
399
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
391
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
400
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
392
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
401
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
393
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
Lines 438-444 sub get_template_and_user { Link Here
438
            hidelostitems             => C4::Context->preference("hidelostitems"),
430
            hidelostitems             => C4::Context->preference("hidelostitems"),
439
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
431
            mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
440
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
432
            opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
441
            opacstylesheet            => "" . C4::Context->preference("opacstylesheet"),
442
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
433
            opacbookbag               => "" . C4::Context->preference("opacbookbag"),
443
            opaccredits               => "" . C4::Context->preference("opaccredits"),
434
            opaccredits               => "" . C4::Context->preference("opaccredits"),
444
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
435
            OpacFavicon               => C4::Context->preference("OpacFavicon"),
Lines 943-961 sub checkauth { Link Here
943
    }
934
    }
944
935
945
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
936
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
946
    my $template = C4::Templates::gettemplate( $template_name, $type, $query );
937
    my $template = C4::Templates::gettemplate($template_name, $type, $query );
947
    $template->param(branchloop => \@branch_loop,);
948
    my $checkstyle = C4::Context->preference("opaccolorstylesheet");
949
    if ($checkstyle =~ /\//)
950
	{
951
            	$template->param( opacexternalsheet => $checkstyle);
952
	} else
953
	{
954
		my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
955
            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
956
	}
957
    $template->param(
938
    $template->param(
958
    login        => 1,
939
        branchloop           => \@branch_loop,
940
        opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
941
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
942
        login                => 1,
959
        INPUTS               => \@inputs,
943
        INPUTS               => \@inputs,
960
        casAuthentication    => C4::Context->preference("casAuthentication"),
944
        casAuthentication    => C4::Context->preference("casAuthentication"),
961
        suggestion           => C4::Context->preference("suggestion"),
945
        suggestion           => C4::Context->preference("suggestion"),
Lines 968-974 sub checkauth { Link Here
968
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
952
        OpacFavicon          => C4::Context->preference("OpacFavicon"),
969
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
953
        opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
970
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
954
        opacsmallimage       => C4::Context->preference("opacsmallimage"),
971
        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
972
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
955
        opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
973
        opacuserjs           => C4::Context->preference("opacuserjs"),
956
        opacuserjs           => C4::Context->preference("opacuserjs"),
974
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
957
        opacbookbag          => "" . C4::Context->preference("opacbookbag"),
Lines 979-985 sub checkauth { Link Here
979
        opacheader           => C4::Context->preference("opacheader"),
962
        opacheader           => C4::Context->preference("opacheader"),
980
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
963
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
981
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
964
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
982
        opacstylesheet       => C4::Context->preference("opacstylesheet"),
983
        intranetcolorstylesheet =>
965
        intranetcolorstylesheet =>
984
								C4::Context->preference("intranetcolorstylesheet"),
966
								C4::Context->preference("intranetcolorstylesheet"),
985
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
967
        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 (-6 / +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 %]" />
(-)a/opac/opac-authoritiesdetail.pl (-3 lines)
Lines 190-197 $template->param( Link Here
190
    OpacNav              => C4::Context->preference("OpacNav"),
190
    OpacNav              => C4::Context->preference("OpacNav"),
191
    opaccredits          => C4::Context->preference("opaccredits"),
191
    opaccredits          => C4::Context->preference("opaccredits"),
192
    opacsmallimage       => C4::Context->preference("opacsmallimage"),
192
    opacsmallimage       => C4::Context->preference("opacsmallimage"),
193
    opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
194
    opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
195
);
193
);
196
output_html_with_http_headers $query, $cookie, $template->output;
194
output_html_with_http_headers $query, $cookie, $template->output;
197
195
198
- 

Return to bug 8263