Bug 23042: Correct shib param escaping
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE Categories %]
5 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
6 <div id="wrap">
7     <div id="header-region" class="noprint">
8         <div class="navbar navbar-inverse navbar-static-top">
9             <div class="navbar-inner">
10                 <div class="container-fluid">
11                     <h1 id="logo">
12                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
13                             [% IF ( LibraryNameTitle ) %]
14                                 [% LibraryNameTitle | html %]
15                             [% ELSE %]
16                                 Koha online
17                             [% END %]
18                         </a>
19                     </h1>
20                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
21                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
22                     [% END %]
23                     <ul class="nav">
24                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
25                             <li>
26                                 <a href="#" title="Collect items you are interested in" id="cartmenulink" role="button">
27                                     <i id="carticon" class="fa fa-shopping-cart fa-icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
28                                 </a>
29                             </li>
30                         [% END %]
31                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
32                             <li class="divider-vertical"></li>
33                         [% END %]
34                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
35                             <li class="dropdown">
36                                 <a href="#" title="Show lists" class="dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button"><i class="fa fa-list fa-icon-white"></i> <span class="listslabel">Lists</span> <b class="caret"></b></a>
37                                 <ul aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
38                                 [% IF some_public_shelves.count %]
39                                     <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem"><strong>Public lists</strong></a></li>
40                                     [% SET number_of_public_shelves = 0 %]
41                                     [% FOREACH s IN some_public_shelves %]
42                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]&amp;sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a></li>
43                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
44                                         [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
45                                     [% END %]
46                                     [% IF some_public_shelves > 10 %]
47                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem" class="listmenulink">View All</a></li>
48                                     [% END %]
49                                 [% ELSE %]
50                                     <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No public lists</a></li>
51                                 [% END %]
52                                 <li class="divider" role="presentation"></li>
53                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
54                                     <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem"><strong>Your lists</strong></a></li>
55                                     [% IF loggedinusername %]
56                                         [% IF some_private_shelves.count %]
57                                             [% SET number_of_private_shelves = 0 %]
58                                             [% FOREACH s IN some_private_shelves %]
59                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]&amp;sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a></li>
60                                                 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
61                                                 [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
62                                             [% END %]
63                                             [% IF some_private_shelves > 10 %]
64                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem" class="listmenulink">View All</a></li>
65                                             [% END %]
66                                         [% ELSE %]
67                                             <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
68                                         [% END %]
69                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
70                                     [% ELSE %]
71                                         [% IF Koha.Preference('casAuthentication') %]
72                                             [%# CAS authentication is too complicated for modal window %]
73                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive" role="menuitem">Log in to create your own lists</a></li>
74                                         [% ELSE %]
75                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive loginModal-trigger" role="menuitem">Log in to create your own lists</a></li>
76                                         [% END %]
77                                     [% END # / IF loggedinusername %]
78                                 [% END # / IF opacuserlogin %]
79                                 </ul> <!-- / .dropdown-menu -->
80                             </li> <!-- / .dropdown -->
81                         [% END # / IF virtualshelves %]
82                     </ul> <!-- / .nav -->
83
84                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 ||  Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %]
85
86                         <div id="members" class="pull-right">
87                             [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %]
88                                 [% INCLUDE 'masthead-langmenu.inc' %]
89                             [% END %]
90                             <ul class="nav">
91                                 <li class="dropdown">
92                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
93                                         [% IF ( loggedinusername ) %]
94                                             <a href="#" class="dropdown-toggle" id="user-menu" data-toggle="dropdown" role="button">
95                                                 <i class="fa fa-user fa-icon-white fa-fw"></i>
96                                                 <span class="userlabel">Welcome, [% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span>
97                                                 <b class="caret"></b>
98                                             </a>
99                                         [% ELSE %]
100                                             [% IF Koha.Preference('casAuthentication') %]
101                                                 [%# CAS authentication is too complicated for modal window %]
102                                                     <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><i class="fa fa-user fa-icon-white fa-fw"></i> <span class="userlabel">Log in to your account</span></a>
103                                             [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
104                                                 <a class="login-link" href="/cgi-bin/koha/svc/auth/googleopenidconnect" role="button" data-toggle="modal"><i class="fa fa-user fa-icon-white fa-fw"></i> <span class="userlabel">Log in to your account</span></a>
105                                             [% ELSE %]
106                                                 <a href="/cgi-bin/koha/opac-user.pl" class="login-link loginModal-trigger" role="button" data-toggle="modal"><i class="fa fa-user fa-icon-white fa-fw"></i> <span class="userlabel">Log in to your account</span></a>
107                                             [% END %]
108                                         [% END %]
109                                     [% END %]
110
111                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 && loggedinusername ) %]
112                                         <ul aria-labelledby="user-menu" role="menu" class="dropdown-menu dropdown-menu-right">
113                                             <li role="presentation">
114                                                 <div id="loggedinuser-menu">
115                                                     <p>
116                                                         <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% logged_in_user.borrowernumber | html %]" data-branchcode="[% logged_in_user.branchcode | html %]" >Your account</span></a>
117                                                     </p>
118                                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
119                                                         <p class="search_history">
120                                                             <a tabindex="-1" role="menuitem" class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
121                                                             <span class="divider-vertical"></span>
122                                                             <a class="logout clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history"><i class="fa fa-trash"></i> Clear</a>
123                                                         </p>
124                                                     [% END %]
125                                                     <p>
126                                                         <a tabindex="-1" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
127                                                         Log out</a>
128                                                     </p>
129                                                 </div>
130                                             </li>
131                                         </ul>
132                                     [% END %]
133                                 </li>
134                                 [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %]
135                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
136                                         <li class="search_history">
137                                             <a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
138                                             <span class="divider-vertical"></span>
139                                             <a class="logout clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history"><i class="fa fa-trash"></i> Clear</a>
140                                         </li>
141                                     [% END %]
142                                 [% END %]
143                             </ul>
144                         </div> <!-- /members -->
145                     [% END # IF opacuserlogin || EnableOpacSearchHistory || opaclanguagesdisplay %]
146
147                 </div> <!-- /container-fluid -->
148             </div> <!-- /navbar-inner -->
149         </div> <!-- /navbar -->
150
151         [% IF ( opacheader ) %]
152             <div class="container-fluid">
153                 <div class="row-fluid">
154                     <div id="opacheader">
155                         [% opacheader | $raw %]
156                     </div>
157                 </div>
158             </div>
159         [% END %]
160     </div> <!-- / header-region -->
161
162     <div class="container-fluid">
163         <div class="row-fluid">
164             <div id="opac-main-search">
165             <div class="span12">
166                 [% IF ( OpacPublic ) %]
167                     [% UNLESS ( advsearch ) %]
168                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
169                             <div class="mastheadsearch librarypulldown">
170                         [% ELSE %]
171                             <div class="mastheadsearch">
172                         [% END %]
173                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
174                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
175                                 <label for="masthead_search"> Search
176                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
177                                         [% IF ( mylibraryfirst ) %]
178                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
179                                         [% END %]
180                                     [% END %]
181                                 </label>
182
183                                 <select name="idx" id="masthead_search">
184                                 [% IF ( ms_kw ) %]
185                                     <option selected="selected" value="">Library catalog</option>
186                                 [% ELSE %]
187                                     <option value="">Library catalog</option>
188                                 [% END # /ms_kw %]
189                                 [% IF ( ms_ti ) %]
190                                     <option selected="selected" value="ti">Title</option>
191                                 [% ELSE %]
192                                     <option value="ti">Title</option>
193                                 [% END # /ms_ti %]
194                                 [% IF ( ms_au ) %]
195                                     <option selected="selected" value="au">Author</option>
196                                 [% ELSE %]
197                                     <option value="au">Author</option>
198                                 [% END # /ms_au%]
199                                 [% IF ( ms_su ) %]
200                                     <option selected="selected" value="su">Subject</option>
201                                 [% ELSE %]
202                                     <option value="su">Subject</option>
203                                 [% END # /ms_su %]
204                                 [% IF ( ms_nb ) %]
205                                     <option selected="selected" value="nb">ISBN</option>
206                                 [% ELSE %]
207                                     <option value="nb">ISBN</option>
208                                 [% END # /ms_nb%]
209                                 [% IF ( ms_ns ) %]
210                                     <option selected="selected" value="ns">ISSN</option>
211                                 [% ELSE %]
212                                     <option value="ns">ISSN</option>
213                                 [% END # /ms_ns%]
214                                 [% IF ( ms_se ) %]
215                                     <option selected="selected" value="se">Series</option>
216                                 [% ELSE %]
217                                     <option value="se">Series</option>
218                                 [% END # /ms_se %]
219                                 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
220                                     [% IF ( ms_callnumcommaphr ) %]
221                                         <option selected="selected" value="callnum,phr">Call number</option>
222                                     [% ELSE %]
223                                         <option value="callnum,phr">Call number</option>
224                                     [% END #/ms_callnumcommaphr %]
225                                 [% ELSE %]
226                                     [% IF ( ms_callnum ) %]
227                                         <option selected="selected" value="callnum">Call number</option>
228                                     [% ELSE %]
229                                         <option value="callnum">Call number</option>
230                                     [% END # /ms_callnum %]
231                                 [% END # /IF OPACNumbersPreferPhrase %]
232                                 </select>
233
234                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
235                                     <div class="input-append nolibrarypulldown">
236                                 [% END %]
237                                 [% IF ( ms_value ) %]
238                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value | html %]" /><span id="translControl"></span>
239                                 [% ELSE %]
240                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
241                                 [% END # /ms_value %]
242
243                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
244                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
245                                     </div>
246                                 [% END %]
247
248                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
249                                     <div class="input-append">
250                                         <select name="branch_group_limit" id="select_library">
251                                             <option value="">All libraries</option>
252
253                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
254
255                                             [% FOREACH library IN Branches.all( selected => opac_name ) %]
256                                                 [% IF library.selected %]
257                                                     <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
258                                                 [% ELSE %]
259                                                     <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
260                                                 [% END %]
261                                             [% END %]
262
263                                             [% IF LibrarySearchGroups %]
264                                                 </optgroup>
265                                                 <optgroup label="Groups">
266                                                     [% FOREACH lsg IN LibrarySearchGroups %]
267                                                         [% IF lsg.id == opac_name %]
268                                                             <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
269                                                         [% ELSE %]
270                                                             <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
271                                                         [% END # / bc.selected %]
272                                                     [% END %]
273                                                 </optgroup>
274                                             [% END # / BranchCategoriesLoop %]
275                                         </select>
276                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
277                                     </div>
278                                 [% ELSE %]
279                                     [% IF ( opac_limit_override ) %]
280                                         [% IF ( opac_search_limit ) %]
281                                             [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
282                                                 <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
283                                             [% ELSE %]
284                                                 <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
285                                             [% END %]
286                                         [% END %]
287                                     [% ELSE %]
288                                         [% IF ( mylibraryfirst ) %]
289                                             <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
290                                         [% END %]
291                                     [% END # / opac_limit_override %]
292                                 [% END # / OpacAddMastheadLibraryPulldown %]
293
294                             </form>
295                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
296                             [% Koha.Preference('OpacCustomSearch') | $raw %]
297                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
298                         </div> <!-- / .mastheadsearch -->
299                     [% END # / UNLESS advsearch %]
300
301                     <div class="row-fluid">
302                             <div id="moresearches">
303                                 <ul>
304                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
305                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
306                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
307                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
308                                     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<li><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a></li>[% END %]
309                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
310                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
311                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
312                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
313                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
314                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
315                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
316                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
317                                         [% END %]
318                                     [% END %]
319                                     [% Koha.Preference('OpacMoreSearches') | $raw %]
320                                 </ul>
321                             </div> <!-- /#moresearches -->
322                     </div> <!-- /.row-fluid -->
323
324                 [% END # / OpacPublic %]
325             </div> <!-- /.span10 -->
326             </div> <!-- /.opac-main-search -->
327         </div> <!-- / .row-fluid -->
328     </div> <!-- /.container-fluid -->
329
330     <!-- Login form hidden by default, used for modal window -->
331     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
332         <div class="modal-header">
333             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
334             <h3 id="modalLoginLabel">Log in to your account</h3>
335         </div>
336         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
337             <input type="hidden" name="has-search-query" id="has-search-query" value="" />
338             <div class="modal-body">
339                 [% IF ( shibbolethAuthentication ) %]
340                     [% IF ( invalidShibLogin ) %]
341                         <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
342                         <div class="alert alert-info">
343                             <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
344                         </div>
345                     [% ELSE %]
346                         <h4>Shibboleth login</h4>
347                         <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | $raw %]">click here to login</a>.</p>
348                         <h4>Local Login</h4>
349                     [% END %]
350                 [% END %]
351                 <input type="hidden" name="koha_login_context" value="opac" />
352                 <fieldset class="brief">
353                     <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
354                     <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
355                     [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
356                         <div id="nologininstructions-modal" class="nologininstructions">
357                             [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
358                         </div>
359                     [% END %]
360                     [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
361                         <div id="forgotpassword-modal" class="forgotpassword">
362                             <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
363                         </div>
364                     [% END %]
365                     [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
366                         <div id="patronregistration-modal" class="patronregistration">
367                             <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
368                         </div>
369                     [% END %]
370                 </fieldset>
371             </div>
372             <div class="modal-footer">
373                 <input type="submit" class="btn btn-primary" value="Log in" />
374             </div>
375         </form> <!-- /#auth -->
376     </div>  <!-- /#modalAuth  -->