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

(-)a/Koha/AdditionalContents.pm (+1 lines)
Lines 63-68 location is one of this: Link Here
63
- OpacLoginInstructions
63
- OpacLoginInstructions
64
- OpacSuggestionInstructions
64
- OpacSuggestionInstructions
65
- ArticleRequestsDisclaimerText
65
- ArticleRequestsDisclaimerText
66
- CustomPage
66
67
67
=cut
68
=cut
68
69
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 424-430 Link Here
424
            <option value="slip">Slip</option>
424
            <option value="slip">Slip</option>
425
        [% END %]
425
        [% END %]
426
    [% ELSE %]
426
    [% ELSE %]
427
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText' ] %]
427
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'CustomPage' ] %]
428
            [% IF l == location %]
428
            [% IF l == location %]
429
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
429
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
430
            [% ELSE %]
430
            [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+10 lines)
Lines 352-357 Link Here
352
                            [% END %]
352
                            [% END %]
353
                        </a>
353
                        </a>
354
                    </li>
354
                    </li>
355
                    [% SET pages = AdditionalContents.get( category => 'html_customizations', location => 'CustomPage', lang => lang, library => branchcode ) %]
356
                    [% FOREACH page IN pages %]
357
                    [% USE Dumper %]
358
                    [% Dumper.dump_html(page) %]
359
                        <li class="nav-item">
360
                            <a href="/cgi-bin/koha/opac-custompage.pl?code=[% page.code | uri %]">
361
                                [% page.title | html %]
362
                            </a>
363
                        </li>
364
                    [% END %]
355
                    [% Koha.Preference('OpacMoreSearches') | $raw %]
365
                    [% Koha.Preference('OpacMoreSearches') | $raw %]
356
                </ul> <!-- /.nav#moresearches -->
366
                </ul> <!-- /.nav#moresearches -->
357
            </div> <!-- /.row -->
367
            </div> <!-- /.row -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-custompage.tt (+45 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE AdditionalContents %]
3
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
4
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Authority search &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% BLOCK cssinclude %][% END %]
9
</head>
10
[% INCLUDE 'bodytag.inc' bodyid='opac-custompage' bodyclass='scrollto' %]
11
[% INCLUDE 'masthead.inc' %]
12
13
    <div class="main">
14
        <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
15
            <ol class="breadcrumb">
16
                <li class="breadcrumb-item">
17
                    <a href="/cgi-bin/koha/opac-main.pl">Home</a>
18
                </li>
19
                <li class="breadcrumb-item active">
20
                    <a href="#" aria-current="page">Authority search</a>
21
                </li>
22
            </ol>
23
        </nav> <!-- /#breadcrumbs -->
24
25
        <div class="container-fluid">
26
            <div class="row">
27
                [% IF ( OpacNav || OpacNavBottom ) %]
28
                    <div class="col-lg-2">
29
                        <div id="navigation">
30
                            [% INCLUDE 'navigation.inc' %]
31
                        </div>
32
                    </div>
33
                    <div class="col-10 order-first order-md-first order-lg-2">
34
                [% ELSE %]
35
                    <div class="col order-first order-md-first order-lg-2">
36
                [% END %]
37
                    <div id="userauthhome" class="maincontent">
38
                    </div> <!-- / #userauthhome -->
39
                </div> <!-- / .col-lg-10/12 -->
40
            </div> <!-- / .row -->
41
        </div> <!-- / .container-fluid -->
42
    </div> <!-- / .main -->
43
44
[% INCLUDE 'opac-bottom.inc' %]
45
[% BLOCK jsinclude %][% END %]
(-)a/opac/opac-custompage.pl (-1 / +81 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Copyright 2021 Aleisha Amohia <aleisha@catalyst.net.nz>
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
use CGI qw ( -utf8 );
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
use Koha::AdditionalContents;
25
26
my $input = CGI->new;
27
my $dbh   = C4::Context->dbh;
28
29
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
30
    {
31
        template_name   => "opac-custompages.tt",
32
        type            => "opac",
33
        query           => $input,
34
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
35
    }
36
);
37
38
my $casAuthentication = C4::Context->preference('casAuthentication');
39
$template->param(
40
    casAuthentication   => $casAuthentication,
41
);
42
43
my $homebranch;
44
if (C4::Context->userenv) {
45
    $homebranch = C4::Context->userenv->{'branch'};
46
}
47
if (defined $input->param('branch') and length $input->param('branch')) {
48
    $homebranch = $input->param('branch');
49
}
50
elsif (C4::Context->userenv and defined $input->param('branch') and length $input->param('branch') == 0 ){
51
   $homebranch = "";
52
}
53
54
my $news_id = $input->param('news_id');
55
my $koha_news;
56
57
if (defined $news_id){
58
    $koha_news = Koha::AdditionalContents->search({ idnew => $news_id, location => ['opac_only', 'staff_and_opac'] }); # get news that is not staff-only news
59
    if ( $koha_news->count > 0){
60
        $template->param( news_item => $koha_news->next );
61
    } else {
62
        $template->param( single_news_error => 1 );
63
    }
64
} else {
65
    $koha_news = Koha::AdditionalContents->search_for_display(
66
        {
67
            category   => 'news',
68
            location   => ['opac_only', 'staff_and_opac'],
69
            lang       => $template->lang,
70
            library_id => $homebranch,
71
        }
72
    );
73
}
74
75
$template->param(
76
    koha_news           => $koha_news,
77
    branchcode          => $homebranch,
78
    daily_quote         => Koha::Quotes->get_daily_quote(),
79
);
80
81
output_html_with_http_headers $input, $cookie, $template->output;

Return to bug 15326