5 <div class="pluginlist">
6 [% FOREACH plugin IN plugins %]
8 <div class="pluginname">
9 [% IF plugin.enabled %]<input type="checkbox" checked="checked" id="checkbox_[% type | html %][% plugin.name | html %]">[% ELSE %]<input type="checkbox" id="checkbox_[% type | html %][% plugin.name | html %]">[% END %]
10 <label class='pluginlabel' for="checkbox_[% type | html %][% plugin.name | html %]">[% plugin.name | html %]</label></div>
11 <div class="plugindesc">
12 [% SWITCH plugin.name %]
13 [% CASE 'AuthorityFile' %]
14 Suggest authorities which are relevant to the term the user searched for.
15 [% CASE 'ExplodedTerms' %]
16 Suggest that patrons expand their searches to include
17 broader/narrower/related terms.
24 [% INCLUDE 'doc-head-open.inc' %]
25 <title>Koha › Administration › Did you mean?</title>
26 [% INCLUDE 'doc-head-close.inc' %]
29 <body id="admin_didyoumean" class="admin">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'prefs-admin-search.inc' %]
32 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Did you mean?</div>
34 <div class="main container-fluid">
36 <div class="col-sm-10 col-sm-push-2">
39 <h3>Did you mean?</h3>
40 <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
41 Configuring 'Did you mean?' plugins requires Javascript. If
42 you are unable to use Javascript, you may be able to enter the
43 configuration (which is stored in JSON in the OPACdidyoumean and
44 INTRAdidyoumean system preferences) in the Local Preferences tab in
45 the system preference editor, but this is unsupported, not
46 recommended, and likely will not work.</div></noscript>
47 <div id="didyoumeanlegend">
48 Please put the 'Did you mean?' plugins in order by significance, from
49 most significant to least significant, and check the box to enable those
50 plugins that you want to use. (NOTE: 'Did you mean?' functionality
51 is not yet enabled on the staff client)
53 <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
54 <fieldset id="didyoumeanopac">
56 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
58 <fieldset id="didyoumeanintranet">
59 <legend>Intranet</legend>
60 [% PROCESS pluginlist plugins=INTRApluginlist type='intranet' %]
62 <fieldset class="action"><button class="save-all submit" type="submit">Save configuration</button> <a href="/cgi-bin/koha/admin/didyoumean.pl" class="force_reload cancel">Cancel</a></fieldset>
66 </div> <!-- /.col-sm-10.col-sm-push-2 -->
68 <div class="col-sm-2 col-sm-pull-10">
70 [% INCLUDE 'admin-menu.inc' %]
72 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
75 [% MACRO jsinclude BLOCK %]
76 [% Asset.js("js/admin-menu.js") | $raw %]
78 $(document).ready(function() {
79 $( ".pluginlist" ).sortable();
80 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
81 .find( ".pluginname" )
82 .addClass( "ui-widget-header ui-corner-all" )
84 .find( ".plugindesc" );
85 $(".save-all").on("click",function(e){
89 $(".force_reload").on("click",function(e){
91 window.location.reload(true);
95 function yesimeant() {
96 var OPACdidyoumean = serialize_plugins('opac');
97 var INTRAdidyoumean = serialize_plugins('intranet');
99 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean) + "&pref_INTRAdidyoumean=" + encodeURIComponent(INTRAdidyoumean);
104 url: '/cgi-bin/koha/svc/config/systempreferences/',
105 success: function () { alert(_("Successfully saved configuration")); },
110 function serialize_plugins(interface) {
111 var serializedconfig = '[';
112 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
113 var name = $(this).find('.pluginlabel').text();
114 var enabled = $(this).find('input:checkbox:checked').length ?
115 ', "enabled": 1' : '';
116 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
118 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
119 serializedconfig += ']';
120 return serializedconfig;
124 [% INCLUDE 'intranet-bottom.inc' %]