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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/pages.tt (+90 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% BLOCK cssinclude %][% END %]
6
</head>
7
<body id="opac-main">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div class="main">
11
    <ul class="breadcrumb">
12
        <li><a href="#">Home</a></li>
13
    </ul>
14
15
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
16
        [% IF ( loggedinusername ) %]
17
            <div id="loggedin" class="container-fluid">
18
        [% ELSE %]
19
            <div id="notloggedin" class="container-fluid">
20
        [% END %]
21
    [% ELSE %]
22
        <div id="notloggedin" class="container-fluid">
23
    [% END %]
24
25
    <div class="row-fluid">
26
    [% IF ( OpacNav ||  OpacNavBottom ) %]
27
        <div class="span2">
28
            <div id="navigation">
29
                [% INCLUDE 'navigation.inc' %]
30
            </div>
31
        </div>
32
    [% END %]
33
34
    [% IF ( OpacNav ||  OpacNavBottom  ) %]
35
        <div class="span7">
36
    [% ELSE %]
37
        <div class="span9">
38
    [% END %]
39
40
        [% IF ( display_daily_quote && daily_quote ) %]
41
            <div id="daily-quote">
42
                <h3>Quote of the Day</h3>
43
                <div>
44
                    <span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span>
45
                </div>
46
            </div>
47
        [% END %]
48
49
        [% IF ( page_test ) %]<div id="opacmainuserblock">[% page_test %]</div>[% END %]
50
        </div> <!-- / .span 7/9 -->
51
52
        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
53
            <div class="span3">
54
                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
55
                    [% UNLESS ( loggedinusername ) %]
56
                        [% UNLESS ( casAuthentication ) %]
57
                            <div id="login">
58
                                <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
59
                                    <input type="hidden" name="koha_login_context" value="opac" />
60
                                    <fieldset class="brief">
61
                                        <legend>Log in to your account:</legend>
62
                                        <label for="userid">Login:</label><input type="text" id="userid" name="userid" />
63
                                        <label for="password">Password:</label><input type="password" id="password" name="password" />
64
                                    <fieldset class="action">
65
                                        <input type="submit" value="Log in" class="btn" />
66
                                    </fieldset>
67
                                    [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="patronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %]
68
                                    </fieldset>
69
                                </form>
70
                            </div> <!-- /#login -->
71
                        [% END # /casAuthentication %]
72
                        [% IF persona %]
73
                            <a href="#" class="persona-button" id="browserid" ><span>Sign in with your email</span></a>
74
                        [% END # /persona %]
75
                    [% END # / loggedinusername %]
76
                [% END # /opacuserlogin %]
77
                [% IF ( OpacNavRight ) %]
78
                    <div id="opacnavright">
79
                        [% OpacNavRight %]
80
                    </div>
81
                [% END # /OpacNavRight %]
82
            </div> <!-- / .span3 -->
83
        [% END # /opacuserlogin || OpacNavRight %]
84
85
        </div> <!-- /.container-fluid -->
86
    </div> <!-- /.row-fluid -->
87
</div> <!-- /.main -->
88
89
[% INCLUDE 'opac-bottom.inc' %]
90
[% BLOCK jsinclude %][% END %]
(-)a/opac/pages.pl (-1 / +76 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
19
use strict;
20
use warnings;
21
use CGI;
22
use C4::Auth;    # get_template_and_user
23
use C4::Output;
24
use C4::NewsChannels;    # get_opac_news
25
use C4::Languages qw(getTranslatedLanguages accept_language);
26
use C4::Koha qw( GetDailyQuote );
27
28
my $input = new CGI;
29
my $dbh   = C4::Context->dbh;
30
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
    {
33
        template_name   => "pages.tt",
34
        type            => "opac",
35
        query           => $input,
36
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
37
        flagsrequired   => { borrow => 1 },
38
    }
39
);
40
41
my $casAuthentication = C4::Context->preference('casAuthentication');
42
$template->param(
43
    casAuthentication   => $casAuthentication,
44
);
45
46
47
# display news
48
# use cookie setting for language, bug default to syspref if it's not set
49
my ($theme, $news_lang, $availablethemes) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input);
50
51
my $all_koha_news   = &GetNewsToDisplay($news_lang);
52
my $koha_news_count = scalar @$all_koha_news;
53
54
my $quote = GetDailyQuote();   # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
55
56
$template->param(
57
    koha_news           => $all_koha_news,
58
    koha_news_count     => $koha_news_count,
59
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
60
    daily_quote         => $quote,
61
);
62
63
my $page = "page_" . $input->param('p');            # go for "p" value in URL and do the concatenation
64
my $preference = C4::Context->preference($page);    # Go for preference
65
$template->{VARS}->{'page_test'} = $preference;     # pass variable to template pages.tt
66
67
# If GoogleIndicTransliteration system preference is On Set paramter to load Google's javascript in OPAC search screens
68
if (C4::Context->preference('GoogleIndicTransliteration')) {
69
        $template->param('GoogleIndicTransliteration' => 1);
70
}
71
72
if (C4::Context->preference('OPACNumbersPreferPhrase')) {
73
        $template->param('numbersphr' => 1);
74
}
75
76
output_html_with_http_headers $input, $cookie, $template->output;

Return to bug 12806