+[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Administration › [% IF ( add_form ) %] System Preferences › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System Preferences › Data Added[% END %]
-[% IF ( delete_confirm ) %] System Preferences › [% searchfield %] › Confirm Deletion of Parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System Preferences › Parameter Deleted[% END %][% IF ( else ) %]System Preferences[% END %]</title>
+<title>Koha › Administration › [% IF ( add_form ) %] System preferences › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences › Data added[% END %]
+[% IF ( delete_confirm ) %] System preferences › [% searchfield %] › Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System preferences › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
+[%# Add WYSIWYG editor for htmlarea system preferences %]
+[% INCLUDE 'wysiwyg-systempreferences.inc' %]
+[% IF ( else ) %]
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript">
+ //<![CDATA[
+ $(document).ready(function() {
+ [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "sDom": '<"top pager"ilf>t',
+ "aoColumnDefs": [
+ { "aTargets": [ -1, -2, -3 ], "bSortable": false }
+ ],
+ "bPaginate": false
+ }));[% END %]
+ });
+</script>
+[% END %]
<script type="text/javascript">
//<![CDATA[
[% IF ( add_form ) %]
return true;
}
//
- function toUC(f) {
- var x=f.value.toUpperCase();
- f.value=x;
- return true;
- }
- //
function isNum(v,maybenull) {
var n = new Number(v.value);
if (isNaN(n)) {
return true;
}
//
- function isDate(f) {
- var t = Date.parse(f.value);
- if (isNaN(t)) {
- return false;
- }
- }
- //
function Check(f) {
var ok=1;
var _alertString="";
return false;
} ).nextAll( 'textarea, input[type=submit]' ).hide();
} );
+
//]]>
</script>
</head>
-<body>
+<body id="admin_systempreferences" class="admin">
[% INCLUDE 'header.inc' %]
-[% INCLUDE 'sysprefs-admin-search.inc' %]
+[% INCLUDE 'prefs-admin-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › Data Added[% END %]
-[% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › <a href="/cgi-bin/koha/admin/systempreferences.pl?op=add_form&searchfield=[% searchfield %]">[% searchfield %]</a> › Confirm Deletion of Parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › Parameter Deleted[% END %][% IF ( else ) %]System Preferences[% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › Data added[% END %]
+[% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › <a href="/cgi-bin/koha/admin/systempreferences.pl?op=add_form&searchfield=[% searchfield %]">[% searchfield %]</a> › Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</div>
<div id="doc3" class="yui-t2">
<textarea id="value" name="value" cols="[% fieldlength %]">[% value |html %]</textarea>
[% ELSIF ( type_upload ) %]
<input type="file" name="value" />
- [% ELSIF ( type_textarea ) %]
+ [% ELSIF ( type_textarea || type_htmlarea ) %]
+ [% IF ( type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
+ <textarea class="mce" name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea>
+ [% ELSE %]
<textarea name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea>
+ [% END %]
[% ELSIF ( type_choice ) %]
<select name="value" id="value">
[% FOREACH option IN options %]
<fieldset class="brief">
<legend>Koha internal</legend>
- <div class="hint">Note: you should have no reasons to modify the following default values</div>
+ <div class="hint">Note: change the variable type to one of the dropdown values as needed</div>
<ol>
<li><label for="preftype">Variable type:</label>
- <div class="hint"> (<span class="variabletype" id="Choice">Choice</span>, <span class="variabletype" id="YesNo">YesNo</span>, <span class="variabletype" id="Integer">Integer</span>, <span class="variabletype" id="Textarea">Textarea</span>, <span class="variabletype" id="Float">Float</span>, <span class="variabletype" id="Themes">Themes</span>, <span class="variabletype" id="Languages">Languages</span>, <span class="variabletype" id="Upload">Upload</span> or <span class="variabletype" id="ClassSources">ClassSources</span>)</div>
- <input type="text" name="preftype" id="preftype" value="[% preftype %]" size="40" maxlength="40" /></li>
+ <select name="preftype" id="preftype">
+ [%- IF (preftype && preftype == 'Free') || !preftype -%]
+ <option value="Free" selected>Free</option>
+ [%- ELSE -%]
+ <option value="Free">Free</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Choice') -%]
+ <option value="Choice" selected>Choice</option>
+ [%- ELSE -%]
+ <option value="Choice">Choice</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'YesNo') -%]
+ <option value="YesNo" selected>YesNo</option>
+ [%- ELSE -%]
+ <option value="YesNo">YesNo</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Integer') -%]
+ <option value="Integer" selected>Integer</option>
+ [%- ELSE -%]
+ <option value="Integer">Integer</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Textarea') -%]
+ <option value="Textarea" selected>Textarea</option>
+ [%- ELSE -%]
+ <option value="Textarea">Textarea</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Htmlarea') -%]
+ <option value="Htmlarea" selected>Htmlarea</option>
+ [%- ELSE -%]
+ <option value="Htmlarea">Htmlarea</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Float') -%]
+ <option value="Float" selected>Float</option>
+ [%- ELSE -%]
+ <option value="Float">Float</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Themes') -%]
+ <option value="Themes" selected>Themes</option>
+ [%- ELSE -%]
+ <option value="Themes">Themes</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Languages') -%]
+ <option value="Languages" selected>Languages</option>
+ [%- ELSE -%]
+ <option value="Languages">Languages</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'Upload') -%]
+ <option value="Upload" selected>Upload</option>
+ [%- ELSE -%]
+ <option value="Upload">Upload</option>
+ [% END %]
+ [%- IF (preftype && preftype == 'ClassSources') -%]
+ <option value="ClassSources" selected>ClassSources</option>
+ [%- ELSE -%]
+ <option value="ClassSources">ClassSources</option>
+ [% END %]
+ </select>
<li><label for="prefoptions">Variable options:</label>
- <div class="hint">(a choice list for Choice (separated by |) or cols|rows for Texarea)</div>
+ <div class="hint">(a choice list for choice (separated by |) or cols|rows for texarea)</div>
<input type="text" name="prefoptions" id="prefoptions" value="[% prefoptions %]" size="60" maxlength="80" /></li>
</ol>
</fieldset>
[% IF ( delete_confirm ) %]
<table>
- <caption>Confirm Deletion of [% searchfield %]?</caption>
+ <caption>Confirm deletion of [% searchfield %]?</caption>
<tr>
- <th>Variable Name:</th>
+ <th>Variable name:</th>
<td>[% searchfield %]</td>
</tr>
<tr><th>Value: </th><td>
<input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="searchfield" value="[% searchfield %]" />
<input type="hidden" name="Tvalue" value="[% Tvalue %]" />
- <input type="submit" value="Yes, Delete" /></form>
- <form class="inline" action="[% script_name %]" method="post"><input type="submit" value="No, Do not Delete" /></form>
+ <input type="submit" value="Yes, delete" /></form>
+ <form class="inline" action="[% script_name %]" method="post"><input type="submit" value="No, do not delete" /></form>
[% END %]
[% IF ( delete_confirmed ) %]
[% END %]
[% IF ( else ) %]
-
- <div id="toolbar">
- <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
- <script type="text/javascript">
- //<![CDATA[
- // prepare DOM for YUI Toolbar
- $(document).ready(function() {
- yuiToolbar();
- [% IF ( loop ) %]$("#sysprefst").tablesorter({
- sortList: [[0,0]],
- headers: { 1: {sorter:false},2: { sorter: false },3: { sorter: false },4: { sorter: false }}
- });[% END %]
- });
- // YUI Toolbar Functions
- function yuiToolbar() {
- new YAHOO.widget.Button("newstopword");
- } //]]>
- </script>
- <ul class="toolbar">
- <li><a id="newstopword" href="[% script_name %]?op=add_form">New Preference</a></li>
- </ul></div>
-
- <h1>System preferences admin</h1>
- <h2>[% tab %] preferences</h2>
- [% searchfield %]
- <table width="80%" id="sysprefst">
- <thead><tr>
+
+ <div id="toolbar" class="btn-toolbar">
+ <a class="btn btn-small" id="newstopword" href="[% script_name %]?op=add_form"><i class="fa fa-plus"></i> New preference</a>
+ </div>
+
+ [% IF ( tab != 'local_use' ) %]
+ <p>Please click on one of the tabs at the left side of this form.</p>
+ <table>
+ [% ELSE %]
+ <h1>Local use preferences</h1>
+ <table width="80%" id="sysprefst">
+ <thead><tr>
<th>Preference</th>
<th>Explanation</th>
<th>Value</th>
- <th>Edit</th>
- <th>Delete</th>
- </tr></thead>
+ <th>Actions</th>
+ </tr></thead>
+ [% END %]
<tbody>[% FOREACH loo IN loop %]
- [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+ <tr>
<td><strong><a href="[% loo.edit %]">[% loo.variable %]</a></strong></td><td> [% loo.explanation |html %]</td>
[% IF ( loo.oneline ) %]
[% IF ( loo.type_upload ) %]
<input type="file" name="value" value="[% loo.value |html %]" />
[% END %]
- [% IF ( loo.type_textarea ) %]
- <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
- <textarea name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea>
+ [% IF ( loo.type_textarea ) || ( loo.type_htmlarea ) %]
+ [% IF ( loo.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
+ <textarea class="mce" name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea>
+ [% ELSE %]
+ <a class="expand-textarea" style="display: none" href="#">Click to edit</a>
+ <textarea name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea>
+ [% END %]
[% END %]
[% IF ( loo.type_choice ) %]
<select name="value">
<input type="hidden" name="prefoptions" value="[% loo.prefoptions |html %]" />
<input type="hidden" name="preftype" value="[% loo.type %]" />
<input type="hidden" name="explanation" value="[% loo.explanation |html %]" />
- <input type="submit" value="Save" />
+ <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
</form>
</td>
- <td><a href="[% loo.edit %]">Edit </a></td>
- <td><a href="[% loo.delete %]">Delete</a></td>
+ <td class="actions"><a class="btn btn-mini" href="[% loo.edit %]"><i class="fa fa-pencil"></i> Edit</a> <a class="btn btn-mini" href="[% loo.delete %]"><i class="fa fa-trash"></i> Delete</a></td>
</tr>
[% END %]</tbody>
</table>