+[% USE Koha %]
+[% SET footerjs = 1 %]
[% 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>
[% INCLUDE 'doc-head-close.inc' %]
-[% IF ( else ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/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, -4 ], "bSortable": false }
- ],
- "bPaginate": false
- }));[% END %]
- });
-</script>
-[% END %]
-<script type="text/javascript">
-//<![CDATA[
-[% IF ( add_form ) %]
- $(document).ready(function() {
- $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
- $('.variabletype').click(function() {
- $('#preftype').attr("value",$(this).attr("id"));
- });
- });
-[% END %]
- // FIXME: many of these js functions appear unused
- function isNotNull(f,noalert) {
- if (f.value.length ==0) {
- return false;
- }
- return true;
- }
- //
- function isNum(v,maybenull) {
- var n = new Number(v.value);
- if (isNaN(n)) {
- return false;
- }
- if (maybenull==0 && v.value=='') {
- return false;
- }
- return true;
- }
- //
- function Check(f) {
- var ok=1;
- var _alertString="";
- var alertString2;
- if (f.variable.value.length==0) {
- _alertString += "\n- " + _("variable missing");
- }
- if (f.value.value.length==0) {
- _alertString += "\n- " + _("value missing");
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = _("Form not submitted because of the following problem(s)");
- alertString2 += "\n------------------------------------------------------------------------------------\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
- }
- $( function() {
- $( '#sysprefst .expand-textarea' ).show().click( function () {
- $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
-
- return false;
- } ).nextAll( 'textarea, input[type=submit]' ).hide();
- } );
-
- //]]>
-</script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
</head>
+
<body id="admin_systempreferences" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
<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 %]
[%- 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 -%]
[% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
- <a class="btn btn-small" id="newstopword" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New preference</a>
+ <a class="btn btn-default btn-sm" id="newstopword" href="[% script_name %]?op=add_form"><i class="fa fa-plus"></i> New preference</a>
</div>
[% IF ( tab != 'local_use' ) %]
<th>Preference</th>
<th>Explanation</th>
<th>Value</th>
- <th>Edit</th>
- <th>Delete</th>
+ <th>Actions</th>
</tr></thead>
[% END %]
<tbody>[% FOREACH loo IN loop %]
[% 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-default btn-xs"><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-default btn-xs" href="[% loo.edit %]"><i class="fa fa-pencil"></i> Edit</a> <a class="btn btn-default btn-xs" href="[% loo.delete %]"><i class="fa fa-trash"></i> Delete</a></td>
</tr>
[% END %]</tbody>
</table>
[% INCLUDE 'prefs-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ [%# Add WYSIWYG editor for htmlarea system preferences %]
+ [% INCLUDE 'wysiwyg-systempreferences.inc' %]
+ [% IF ( else ) %]
+ [% INCLUDE 'datatables.inc' %]
+ <script type="text/javascript">
+ $(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">
+ [% IF ( add_form ) %]
+ $(document).ready(function() {
+ $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
+ $('.variabletype').click(function() {
+ $('#preftype').attr("value",$(this).attr("id"));
+ });
+ });
+ [% END %]
+ // FIXME: many of these js functions appear unused
+ function isNotNull(f,noalert) {
+ if (f.value.length ==0) {
+ return false;
+ }
+ return true;
+ }
+
+ function isNum(v,maybenull) {
+ var n = new Number(v.value);
+ if (isNaN(n)) {
+ return false;
+ }
+ if (maybenull==0 && v.value=='') {
+ return false;
+ }
+ return true;
+ }
+
+ function Check(f) {
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+ if (f.variable.value.length==0) {
+ _alertString += "\n- " + _("variable missing");
+ }
+ if (f.value.value.length==0) {
+ _alertString += "\n- " + _("value missing");
+ }
+ if (_alertString.length==0) {
+ document.Aform.submit();
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ }
+ }
+ $( function() {
+ $( '#sysprefst .expand-textarea' ).show().click( function () {
+ $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
+
+ return false;
+ } ).nextAll( 'textarea, input[type=submit]' ).hide();
+ });
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]