Bug 24224: Convert OpacNavBottom system preference to additional content
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / additional-contents.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Additional contents &rsaquo; Tools &rsaquo; Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% IF ( wysiwyg ) %]
11     [% SET editmode = "wysiwyg" %]
12 [% ELSE %]
13     [% SET editmode = "text" %]
14     [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
15     [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
16     <style>
17         .CodeMirror {
18             resize: vertical;
19             z-index: 0;
20         }
21     </style>
22 [% END %]
23 </head>
24
25 <body id="tools_additional-contents" class="tools">
26 [% INCLUDE 'header.inc' %]
27 [% INCLUDE 'cat-search.inc' %]
28
29 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
30     <ol>
31         <li>
32             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
33         </li>
34         <li>
35             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
36         </li>
37
38             <li>
39                 <a href="/cgi-bin/koha/tools/additional-contents.pl">Additional contents</a>
40             </li>
41         [% IF op == 'add_form' %]
42             <li>
43                 [% IF category == 'news' %]
44                     <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
45                 [% ELSE %]
46                     <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
47                 [% END %]
48             </li>
49             <li>
50                 <a href="#" aria-current="page">
51                     [% IF additional_content.idnew %]
52                         Modify additional content
53                     [% ELSE %]
54                         Add additional content
55                     [% END %]
56                 </a>
57             </li>
58         [% ELSE %]
59             <li>
60                 <a href="#" aria-current="page">
61                     [% IF category == 'news' %]
62                         News
63                     [% ELSE %]
64                         HTML customizations
65                     [% END %]
66                 </a>
67             </li>
68         [% END %]
69
70     </ol>
71 </nav>
72
73 [% IF op == 'add_form' %]
74 <div class="main container-fluid">
75     <div class="row">
76         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
77 [% ELSE %]
78 <div class="main container-fluid">
79     <div class="row">
80         <div class="col-sm-10 col-sm-push-2">
81 [% END %]
82
83 <main>
84
85     [% FOR m IN messages %]
86         <div class="dialog [% m.type | html %]">
87             [% SWITCH m.code %]
88             [% CASE 'error_on_update' %]
89                 An error occurred when updating this content. Perhaps it already exists.
90             [% CASE 'error_on_insert' %]
91                 An error occurred when adding this content. Check the logs
92             [% CASE 'error_on_delete' %]
93                 An error occurred when deleting this content. Check the logs.
94             [% CASE 'success_on_update' %]
95                 Content updated successfully.
96             [% CASE 'success_on_insert' %]
97                 Content added successfully.
98             [% CASE 'success_on_delete' %]
99                 Content deleted successfully.
100             [% CASE %]
101                 [% m.code | html %]
102             [% END %]
103         </div>
104     [% END %]
105
106     [% IF op == 'add_form' %]
107         [% PROCESS add_form %]
108     [% ELSE %]
109         [% PROCESS list %]
110     [% END %]
111
112 </main>
113
114         [% IF op != 'add_form' %]
115             </div> <!-- /.col-sm-10.col-sm-push-2 -->
116
117             <div class="col-sm-2 col-sm-pull-10">
118                 <aside>
119
120                     <div id="news-filter">
121                         <form action="/cgi-bin/koha/tools/additional-contents.pl" method="get">
122                             <h4>Filter</h4>
123                             <fieldset class="brief">
124                                 <ol>
125                                     <li>
126                                         <label for="news_keyword">Keyword:</label>
127                                         <input type="text" name="news_keyword" id="news_keyword" />
128                                     </li>
129                                     <li>
130                                         <label for="news_display_location">Display location:</label>
131                                         <select name="news_display_location" id="news_display_location">
132                                             <option value="">All</option>
133                                             [% PROCESS locations_options category => category %]
134                                         </select>
135                                     </li>
136                                     <li>
137                                         <label for="news_library">Library: </label>
138                                         <select id="news_library" name="news_library">
139                                             <option value=""></option>
140                                             <option value="">All libraries</option>
141                                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
142                                         </select>
143                                     </li>
144                                     <li>
145                                         <label>
146                                             <input type="checkbox" name="show_expired" id="show_expired" /> Show expired
147                                         </label>
148                                     </li>
149                                 </ol>
150                             </fieldset>
151                         </form>
152                     </div>
153
154                     [% INCLUDE 'tools-menu.inc' %]
155                 </aside>
156             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
157         [% END %]
158     </div> <!-- /.row -->
159 </div> <!-- /.main.container-fluid -->
160
161 [% BLOCK add_form %]
162     [% IF additional_content %]
163         <h1>Modify an additional content</h1>
164     [% ELSE %]
165         <h1>New additional content ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h1>
166     [% END %]
167
168     <div id="toolbar" class="btn-toolbar">
169         <div class="btn-group">
170             <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
171         </div>
172         [% IF category == 'news' %]
173             <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
174         [% ELSE %]
175             <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations"><i class="fa fa-remove"></i> Cancel</a>
176         [% END %]
177     </div>
178
179     <form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validate">
180         <input type="hidden" name="op" value="add_validate" />
181         <input type="hidden" name="id" value="[% additional_content.idnew | html %]" />
182         <input type="hidden" name="category" value="[% category | html %]" />
183         <fieldset class="rows">
184             <ol>
185                 <li>
186                     [% IF additional_content %]
187                         <span class="label">Code:</span> [% additional_content.code | html %]
188                         <input type="hidden" id="code" name="code" value="[% additional_content.code | html %]" />
189                     [% ELSE %]
190                         <label for="code" class="required">Code:</label>
191                         <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
192                         <span class="required">Required</span>
193                     [% END %]
194                 </li>
195                 <li>
196                     <label for="location">Display location:</label>
197                     <select id="location" name="location">
198                         [% PROCESS locations_options location => additional_content.location %]
199                     </select>
200                 </li>
201                 <li>
202                     <label for="branchcode">Library: </label>
203                     <select id="branchcode" name="branchcode">
204                         [% IF additional_content.branchcode == '' %]
205                             <option value="" selected="selected">All libraries</option>
206                         [% ELSE %]
207                             <option value="">All libraries</option>
208                         [% END %]
209                         [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
210                     </select>
211                 </li>
212                 [% UNLESS languages.size %]
213                     <li>
214                         <label for="title" class="required">Title: </label>
215                         <input id="title" size="100" maxlength="250" type="text" name="title" value="[% additional_content.title | html %]" required="required" class="required" /> <span class="required">Required</span>
216                     </li>
217                 [% END %]
218                 <li>
219                     <label for="from">Publication date: </label>
220                     <input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | $KohaDates %]" class="flatpickr" data-date_to="to" />
221                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
222                 </li>
223                 <li>
224                     <label for="to">Expiration date: </label>
225                     <input id="to" type="text" name="expirationdate" size="15" value="[% additional_content.expirationdate | $KohaDates %]" class="flatpickr" />
226                     <div class="hint">
227                         [% INCLUDE 'date-format.inc' %]
228                         [% IF category == 'news' %]
229                             <br>News will still be accessible by direct URL if expired.
230                         [% END %]
231                     </div>
232                 </li>
233                 <li>
234                     <label for="number">Appear in position: </label>
235                     [% IF ( additional_content.number ) %]
236                         <input id="number" size="3" name="number" type="text" value="[% additional_content.number | html %]" />
237                     [% ELSE %]
238                         <input id="number" size="3" name="number" type="text" />
239                     [% END %]
240                 </li>
241             </ol>
242         </fieldset>
243
244         [% IF languages.size %]
245             <div style="clear:both"></div>
246             <div id="tabs">
247                 <ul>
248                     [% FOR language IN languages %]
249                         [% IF language.lang == 'default' %]
250                             <li><a href="#lang_default">Default</a></li>
251                         [% ELSE %]
252                             <li><a href="#lang_[% language.lang | uri %]">[% language.description | html %]</a></li>
253                         [% END %]
254                     [% END %]
255                 </ul>
256
257                 [% FOR language IN languages %]
258                     <div id="lang_[% language.lang | uri %]" class="lang clearfix" data-lang="[% language.description | html %]">
259                         <fieldset class="rows">
260                             <ol>
261                                 <li style="list-style: none;">
262                                     <label for="title_[% language.lang | html %]">Title: </label>
263                                     <input id="title_[% language.lang| html %]" size="100" maxlength="250" type="text" name="title" value="[% translated_contents.item(language.lang).title | html %]">
264                                 </li>
265                                 <li style="list-style: none;">
266                                     <label for="content_[% language.lang | html %]">Content: </label>
267                                     <textarea name="content" id="content_[% language.lang | html %]" data-lang="[% language.lang | html%]" cols="75" rows="10">[% translated_contents.item(language.lang).content | html %]</textarea>
268                                     <input type="hidden" name="lang" value="[% language.lang | html %]" />
269                                 </li>
270                             </ol>
271                         </fieldset>
272                     </div>
273                 [% END %]
274             </div>
275         [% ELSE %]
276             <div id="lang_default">
277                 <div class="clearfix">
278                     <textarea name="content" id="content_default" data-lang="[% language.lang | html %]"  cols="75" rows="10">[% additional_content.content | html %]</textarea>
279                 </div>
280             </div>
281         [% END %]
282     </form>
283 [% END %]
284
285 [% BLOCK list %]
286
287     <div id="toolbar" class="btn-toolbar">
288         <div class="btn-group">
289             <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=[% category | uri %]&editmode=[% editmode | uri %]" class="btn btn-default" id="newentry"> <i class="fa fa-plus"></i> New entry</a><button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
290                 <span class="caret"></span>
291             </button>
292             <ul class="dropdown-menu pull-right">
293                 <li>
294                     [% IF ( wysiwyg ) %]
295                         <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=[% category | uri %]&editmode=text">New entry using text editor</a>
296                     [% ELSE %]
297                         <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=[% category | uri %]&editmode=wysiwyg">New entry using WYSIWYG editor</a>
298                     [% END %]
299                 </li>
300             </ul>
301         </div>
302     </div>
303
304     <h2>Additional contents ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h2>
305     [% IF category == 'news' %]
306         See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
307     [% ELSE %]
308         See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
309     [% END %]
310
311     [% IF additional_contents.count %]
312         <form id="del_form" method="post" action="/cgi-bin/koha/tools/additional-contents.pl">
313             <table id="table_additional_contents">
314                 <thead>
315                     <tr>
316                         <th class="NoSort">&nbsp;</th>
317                         <th>Location</th>
318                         <th>Library</th>
319                         <th>Number</th>
320                         <th>Publication date</th>
321                         <th>Expiration date</th>
322                         <th class="anti-the">Title</th>
323                         <th>Author</th>
324                         <th class="anti-the">News</th>
325                         <th class="NoSort noExport">Actions</th>
326                     </tr>
327                 </thead>
328                 <tbody>
329                     [% FOREACH c IN additional_contents%]
330                         [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
331                         <td>
332                             <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
333                         </td>
334                         <td>
335                             [% IF c.category == 'news' %]
336                                 [% IF c.location == 'staff_and_opac' %]All
337                                 [% ELSIF c.location == 'staff_only' %]Librarian interface
338                                 [% ELSIF c.location == 'opac_only' %]OPAC
339                                 [% ELSIF c.location == 'slip' %]Slip
340                                 [% ELSE %]Unknown ('[% location | html %]')
341                                 [% END %]
342                             [% ELSE %]
343                                 [% c.location | html %]
344                             [% END %]
345                         </td>
346                         <td>
347                             [% IF ( c.branchcode == "" ) -%]
348                             All libraries
349                             [% ELSE %][% c.library.branchname | html %]
350                             [% END %]
351                         </td>
352                         <td>[% c.number | html %]</td>
353                         <td data-order="[% c.published_on | html %]">[% c.published_on | $KohaDates %]</td>
354                         <td data-order="[% c.expirationdate | html %]">[% c.expirationdate | $KohaDates %] [% IF ( c.is_expired ) %](<span class="expired">expired</span>)[% END %]</td>
355                         <td>[% c.title | html %]</td>
356                         <td>[% IF ( c.author) %][% INCLUDE 'patron-title.inc' patron=c.author %][% END %]</td>
357                         <td>
358                             <div class="btn-group">
359                                 <a class="preview_news btn btn-default btn-xs" data-number="[% loop.count | html %]"><i class="fa fa-eye" aria-hidden="true"></i> Preview content</a>
360                             </div>
361                             <div id="contentModal[% loop.count | html %]" class="modal" tabindex="-1" role="dialog" data-number="[% loop.count | html %]">
362                                 <div class="modal-dialog" role="document">
363                                     <div class="modal-content modal-lg">
364                                         <div class="modal-header">
365                                             <h5 class="modal-title">Preview of: "[% c.title | html %]"</h5>
366                                         </div>
367                                     <div class="modal-body">
368                                         [% c.content | $raw %]
369                                     </div>
370                                     <div class="modal-footer">
371                                         <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
372                                     </div>
373                                 </div>
374                             </div>
375                         </td>
376                         <td class="actions">
377                             <div class="btn-group dropup">
378                                 <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.idnew | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa fa-pencil"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
379                                     <span class="caret"></span>
380                                 </button>
381                                 <ul class="dropdown-menu pull-right">
382                                     <li>
383                                         [% IF ( wysiwyg ) %]
384                                             <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.idnew | uri %]&editmode=text"><i class="fa fa-pencil"></i> Edit with text editor</a>
385                                         [% ELSE %]
386                                             <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.idnew | uri %]&editmode=wysiwyg"><i class="fa fa-pencil"></i> Edit with WYSIWYG editor</a>
387                                         [% END %]
388                                     </li>
389                                 </ul>
390                             </div>
391                             <div class="btn-group">
392                                 <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash"></i> Delete</a>
393                             </div>
394                         </td>
395                     </tr>
396                     [% END %]
397                 </tbody>
398             </table>
399             <input type="hidden" name="op" value="delete_confirmed" />
400             <input type="hidden" name="category" value="[% category | html %]" />
401             <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
402         </form>
403         <form action="/cgi-bin/koha/tools/additional-contents.pl" method="post" id="delete_single">
404             <input type="hidden" id="del_op" name="op" value="delete_confirmed" />
405             <input type="hidden" id="del_category" name="category" value="[% category | html %]" />
406             <input type="hidden" id="del_ids" name="ids" />
407         </form>
408     [% ELSE %]
409         <div class="dialog message">There are no additional contents.</div>
410     [% END %]
411 [% END %]
412
413 [% BLOCK locations_options %]
414     [% IF category == 'news' %]
415         [% IF location == "staff_and_opac" %]
416             <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
417         [% ELSE %]
418             <option value="staff_and_opac">Librarian and OPAC interfaces</option>
419         [% END %]
420
421         [% IF location == "staff_only" %]
422             <option value="staff_only" selected="selected">Librarian interface</option>
423         [% ELSE %]
424             <option value="staff_only">Librarian interface</option>
425         [% END %]
426
427         [% IF location == "opac_only" %]
428             <option value="opac_only" selected="selected">OPAC</option>
429         [% ELSE %]
430             <option value="opac_only">OPAC</option>
431         [% END %]
432
433         [% IF location == "slip" %]
434             <option value="slip" selected="selected">Slip</option>
435         [% ELSE %]
436             <option value="slip">Slip</option>
437         [% END %]
438     [% ELSE %]
439         [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText' ] %]
440             [% IF l == location %]
441                 <option value="[% l | html %]" selected="selected">[% l | html %]</option>
442             [% ELSE %]
443                 <option value="[% l | html %]">[% l | html %]</option>
444             [% END %]
445         [% END %]
446     [% END %]
447 [% END %]
448
449 [% MACRO jsinclude BLOCK %]
450     [% INCLUDE 'calendar.inc' %]
451     [% Asset.js("js/tools-menu.js") | $raw %]
452     [% Asset.js("lib/hc-sticky.js") | $raw %]
453     [% IF additional_contents.count %]
454         [% INCLUDE 'datatables.inc' %]
455         <script>
456             $('.preview_news').click( function() {
457                 modalNumber = $(this).attr('data-number');
458                 $('.modal[data-number="'+modalNumber+'"]').modal('show');
459             })
460             function Checkbox(){
461                 var form = document.getElementById('del_form');
462                 var inputs = form.getElementsByTagName('input');
463                 var checked = false;
464                 for (var i=0; i<inputs.length; i++) {
465                     if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
466                         checked = inputs[i].checked;
467                         if (checked) return true;
468                     }
469                 }
470             }
471
472             function filterDataTable( table, column, term ){
473                 if( column ){
474                     table.column( column ).search( term ).draw();
475                 } else {
476                     table.search( term ).draw();
477                 }
478                 clearFilter( term );
479             }
480
481             function clearFilter( term ){
482                 if( term == "" ){
483                     $(".dt_button_clear_filter").addClass("disabled");
484                 } else {
485                     $(".dt_button_clear_filter").removeClass("disabled");
486                 }
487             }
488
489             /* Custom table search configuration: If a table row
490                has an "expired" class, hide it UNLESS the
491                show_expired checkbox is checked */
492             $.fn.dataTable.ext.search.push(
493                 function( settings, searchData, index, rowData, counter ) {
494                     var row = $(settings.aoData[index].nTr);
495                     if( row.hasClass("expired") && !$("#show_expired").prop("checked") ){
496                         return false;
497                     } else {
498                         return true;
499                     }
500                 }
501             );
502
503             $(document).ready(function() {
504
505                 var table = $("#table_additional_contents").DataTable($.extend(true, {}, dataTablesDefaults, {
506                     "order": [[ 4, "desc" ]],
507                     "aoColumnDefs": [
508                         { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
509                         { "type": "anti-the", "targets": [ "anti-the" ] }
510                     ],
511                     "sPaginationType": "full_numbers"
512                 }));
513
514                 $("#del_form").on("click", ".delete_news", function(e){
515                     e.preventDefault();
516                     if( confirmDelete( _("Are you sure you want to delete this content? This cannot be undone.") ) ){
517                         $("#del_ids").val( $(this).data("idnew") );
518                         $("#delete_single").submit();
519                     }
520                 });
521
522                 $("#del_form").on("submit",function(){
523                     if ( Checkbox() ) {
524                         return confirmDelete( _("Are you sure you want to delete the selected content?") );
525                     } else {
526                         alert(_("Please select content to delete."));
527                         return false;
528                     }
529                 });
530
531                 $("#show_expired").on("change", function(){
532                     /* redraw the DataTable according to the custom search function */
533                     table.draw();
534                 });
535
536                 table.on( 'search.dt', function () {
537                     var term = table.search();
538                     $("#news_keyword").val( term );
539                 });
540
541                 $("#news_keyword").on("keyup", function(){
542                     var term = $(this).val();
543                     filterDataTable( table, null, term );
544                 });
545
546                 $("#news_display_location").on("change", function(){
547                     var term = $(this).val();
548                     filterDataTable( table, 1, term );
549                 });
550
551                 $("#news_library").on("change", function(){
552                     // Table must be filtered by the <option>'s text, not its value
553                     var opt = $(this).find("option:selected").text();
554                     filterDataTable( table, 2, opt );
555                 });
556
557                 $(".dt_button_clear_filter").on("click", function(){
558                     table.search('').columns().search('').draw();
559                     $("#news-filter select").each(function(){
560                         $(this).val("");
561                     });
562                 });
563             });
564         </script>
565     [% ELSE %]
566         <script>
567             $(document).ready(function() {
568                 $("#tabs").tabs();
569                 $("#add_additional_content").validate({
570                     submitHandler: function(form){
571                         if ( ! $("#title_default").val().length > 0 ) {
572                             alert(__("Please specify a title for 'Default'"));
573                             return false;
574                         }
575
576                         form.submit();
577                     }
578                 });
579
580                 $("#submit_form").on("click",function(){
581                     $("#add_additional_content").submit();
582                 });
583
584                 Sticky = $("#toolbar");
585                 Sticky.hcSticky({
586                     stickTo: ".main",
587                     stickyClass: "floating"
588                 });
589
590             });
591         </script>
592     [% END %]
593     [% UNLESS ( wysiwyg ) %]
594         [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
595         [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
596         [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
597         [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
598         [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
599         <script>
600             $("textarea[name='content']").each( function(index) {
601                 var this_lang = $(this).attr('data-lang');
602                 var editor = CodeMirror.fromTextArea(document.getElementById('content_' + this_lang), {
603                     lineNumbers: true,
604                     lineWrapping: true,
605                     lint: true,
606                     mode: "text/html",
607                     gutters: ["CodeMirror-lint-markers"],
608                     viewportMargin: Infinity,
609                 });
610             });
611         </script>
612     [% ELSE %]
613         [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
614         [% INCLUDE 'str/tinymce_i18n.inc' %]
615         <script>
616             tinyMCE.init({
617                 verify_html: false,
618                 force_br_newlines : false,
619                 force_p_newlines : false,
620                 forced_root_block : '',
621                 branding : false,
622                 relative_urls : false,
623                 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
624                 menubar : "file edit view insert format tools table",
625                 mode : "specific_textareas",
626                 plugins : "autoresize table hr link image charmap lists code emoticons",
627                 extended_valid_elements:"style,link[href|rel]",
628                 custom_elements:"style,link,~link",
629                 toolbar : [
630                     "formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr",
631                     "table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code"
632                 ],
633             });
634         </script>
635     [% END # /UNLESS wysiwyg %]
636 [% END %]
637
638 [% INCLUDE 'intranet-bottom.inc' %]