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.
18 [% CASE 'LibrisSpellcheck' %]
19 Use the LIBRIS spellcheck API.
26 [% INCLUDE 'doc-head-open.inc' %]
27 <title>Koha › Administration › Did you mean?</title>
28 [% INCLUDE 'doc-head-close.inc' %]
31 <body id="admin_didyoumean" class="admin">
32 [% INCLUDE 'header.inc' %]
33 [% INCLUDE 'prefs-admin-search.inc' %]
34 <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>
36 <div class="main container-fluid">
38 <div class="col-sm-10 col-sm-push-2">
41 <h3>Did you mean?</h3>
42 <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
43 Configuring 'Did you mean?' plugins requires Javascript. If
44 you are unable to use Javascript, you may be able to enter the
45 configuration (which is stored in JSON in the OPACdidyoumean and
46 INTRAdidyoumean system preferences) in the Local Preferences tab in
47 the system preference editor, but this is unsupported, not
48 recommended, and likely will not work.</div></noscript>
49 <div id="didyoumeanlegend">
50 Please put the 'Did you mean?' plugins in order by significance, from
51 most significant to least significant, and check the box to enable those
52 plugins that you want to use. (NOTE: 'Did you mean?' functionality
53 is not yet enabled on the staff client)
55 <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
56 <fieldset id="didyoumeanopac">
58 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
60 <fieldset id="didyoumeanintranet">
61 <legend>Intranet</legend>
62 [% PROCESS pluginlist plugins=INTRApluginlist type='intranet' %]
64 <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>
68 </div> <!-- /.col-sm-10.col-sm-push-2 -->
70 <div class="col-sm-2 col-sm-pull-10">
72 [% INCLUDE 'admin-menu.inc' %]
74 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
77 [% MACRO jsinclude BLOCK %]
78 [% Asset.js("js/admin-menu.js") | $raw %]
80 $(document).ready(function() {
81 $( ".pluginlist" ).sortable();
82 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
83 .find( ".pluginname" )
84 .addClass( "ui-widget-header ui-corner-all" )
86 .find( ".plugindesc" );
87 $(".save-all").on("click",function(e){
91 $(".force_reload").on("click",function(e){
93 window.location.reload(true);
97 function yesimeant() {
98 var OPACdidyoumean = serialize_plugins('opac');
99 var INTRAdidyoumean = serialize_plugins('intranet');
101 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean) + "&pref_INTRAdidyoumean=" + encodeURIComponent(INTRAdidyoumean);
106 url: '/cgi-bin/koha/svc/config/systempreferences/',
107 success: function () { alert(_("Successfully saved configuration")); },
112 function serialize_plugins(interface) {
113 var serializedconfig = '[';
114 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
115 var name = $(this).find('.pluginlabel').text();
116 var enabled = $(this).find('input:checkbox:checked').length ?
117 ', "enabled": 1' : '';
118 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
120 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
121 serializedconfig += ']';
122 return serializedconfig;
126 [% INCLUDE 'intranet-bottom.inc' %]