Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17142 | Rev 17144 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
6
$routeDatatable = $this->url('microlearning/content/slides');
7
 
8
$allowAdd = $acl->isAllowed($roleName, 'microlearning/content/slides/add') ? 1 : 0;
9
$allowEdit = $acl->isAllowed($roleName, 'microlearning/content/slides/edit') ? 1 : 0;
10
$allowDelete = $acl->isAllowed($roleName, 'microlearning/content/slides/delete') ? 1 : 0;
11
 
16822 efrain 12
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
13
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
1 www 14
 
16822 efrain 15
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
16
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
12071 nelberth 17
 
16843 efrain 18
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
16822 efrain 20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
21
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
23
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
1 www 24
 
16822 efrain 25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
26
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
1 www 27
 
16822 efrain 28
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
29
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
1 www 30
 
16822 efrain 31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
34
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
1 www 35
 
17139 stevensc 36
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
16822 efrain 37
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
1 www 38
 
39
$this->inlineScript()->captureStart();
40
echo <<<JS
17140 stevensc 41
    console.log('Hola');
17141 stevensc 42
    jQuery(document).ready(function ($) {
43
        var routeAdd = ''
44
 
45
        $.validator.setDefaults({
46
            debug: true,
47
            highlight: function (element) {
48
            $(element).addClass('is-invalid')
49
            },
50
            unhighlight: function (element) {
51
            $(element).removeClass('is-invalid')
52
            },
53
            errorElement: 'span',
54
            errorClass: 'error invalid-feedback',
55
            errorPlacement: function (error, element) {}
56
        })
57
 
58
        var allowEdit = $allowEdit
59
        var allowDelete = $allowDelete
60
 
61
        var gridTable = $('#gridTable').dataTable({
62
            processing: true,
63
            serverSide: true,
64
            searching: true,
65
            order: [[0, 'asc']],
66
            ordering: true,
67
            ordenable: true,
68
            responsive: true,
69
            select: false,
70
            paging: true,
71
            pagingType: 'simple_numbers',
72
            ajax: {
73
            url: '$routeDatatable',
74
            type: 'get',
75
            data: function (d) {
76
                d.capsule_uuid = $('#form-filter #capsule_uuid').val()
77
            },
78
            beforeSend: function (request) {
79
                NProgress.start()
80
            },
81
            dataFilter: function (response) {
82
                var response = jQuery.parseJSON(response)
83
 
84
                console.log(response)
85
 
86
                var json = {}
87
                json.recordsTotal = 0
88
                json.recordsFiltered = 0
89
                json.data = []
90
 
91
                if (!response.success) {
92
                $.fn.showError(response.data || 'ERROR_UNKNOWN')
93
                json.recordsTotal = 0
94
                json.recordsFiltered = 0
95
                json.data = []
96
                return JSON.stringify(json)
97
                }
98
 
99
                $('#form-capsule-add').attr('action', response.data.link_add)
100
                routeAdd = response.data.link_add
101
                if (response.data.link_add) {
102
                $('button.btn-add').removeAttr('disabled')
103
                } else {
104
                $('button.btn-add').attr('disabled', 'disabled')
105
                }
106
 
107
                if (response.data.capsules) {
108
                var $select = $('#form-filter #capsule_uuid')
109
                $select.empty()
110
                $select.append('<option value="">LABEL_SELECT_CAPSULE</option>')
111
                $.each(response.data.capsules, function (index, value) {
112
                    $select.append(
113
                    '<option value="' + index + '">' + value + '</option>'
114
                    )
115
                })
116
 
117
                // Si hay una cápsula seleccionada en la URL, seleccionarla
118
                var urlParams = new URLSearchParams(window.location.search)
119
                var selectedCapsule = urlParams.get('capsule_uuid')
120
                if (selectedCapsule) {
121
                    $select.val(selectedCapsule)
122
                }
123
                }
124
 
125
                json.recordsTotal = response.data.total
126
                json.recordsFiltered = response.data.total
127
                json.data = response.data.items
128
 
129
                return JSON.stringify(json)
130
            }
131
            },
132
            language: {
133
            sProcessing: 'LABEL_DATATABLE_SPROCESSING',
134
            sLengthMenu: 'LABEL_DATATABLE_SLENGTHMENU',
135
            sZeroRecords: 'LABEL_DATATABLE_SZERORECORDS',
136
            sEmptyTable: 'LABEL_DATATABLE_SEMPTYTABLE',
137
            sInfo: 'LABEL_DATATABLE_SINFO',
138
            sInfoEmpty: 'LABEL_DATATABLE_SINFOEMPTY',
139
            sInfoFiltered: 'LABEL_DATATABLE_SINFOFILTERED',
140
            sInfoPostFix: '',
141
            sSearch: 'LABEL_DATATABLE_SSEARCH',
142
            sUrl: '',
143
            sInfoThousands: ',',
144
            sLoadingRecords: 'LABEL_DATATABLE_SLOADINGRECORDS',
145
            oPaginate: {
146
                sFirst: 'LABEL_DATATABLE_SFIRST',
147
                sLast: 'LABEL_DATATABLE_SLAST',
148
                sNext: 'LABEL_DATATABLE_SNEXT',
149
                sPrevious: 'LABEL_DATATABLE_SPREVIOUS'
150
            },
151
            oAria: {
152
                sSortAscending: ': LABEL_DATATABLE_SSORTASCENDING',
153
                sSortDescending: ':LABEL_DATATABLE_SSORTDESCENDING'
154
            }
155
            },
156
            drawCallback: function (settings) {
157
            NProgress.done()
158
            },
159
            aoColumns: [
160
            { mDataProp: 'name' },
161
            { mDataProp: 'details' },
162
            { mDataProp: 'media' },
163
            { mDataProp: 'actions' }
164
            ],
165
            columnDefs: [
166
            {
167
                targets: 0,
168
                className: 'text-vertical-middle'
169
            },
170
            {
171
                targets: -3,
172
                orderable: false,
173
                render: function (data, type, row) {
174
                var s = ''
17142 stevensc 175
                s += 'LABEL_TYPE: ' + data['type'] + '<br></br>'
17141 stevensc 176
                return s
177
                }
178
            },
179
            {
180
                targets: -2,
181
                orderable: false,
182
                render: function (data, type, row) {
183
                s = ''
184
                if (data['image']) {
185
                    s =
186
                    s +
187
                    '&nbsp; <img class="btn-view-image"" data-href="' +
188
                    data['image'] +
189
                    '" data-toggle="tooltip" src="' +
190
                    data['image'] +
191
                    '" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
192
                }
193
 
194
                if (data['audio']) {
195
                    s =
196
                    s +
17143 stevensc 197
                    '&nbsp' +
198
                    '<button class="btn btn-play-audio" data-href="' + data['audio'] +'" data-toggle="tooltip" title="LABEL_PLAY_AUDIO">' +
199
                    '<i class="fa fa-play"></i>' +
200
                    '</button>'
17141 stevensc 201
                }
202
 
203
                if (data['video']) {
204
                    s =
205
                    s +
17143 stevensc 206
                    '&nbsp;' +
207
                    '<button class="btn btn-play-video" data-href="' +
17141 stevensc 208
                    data['video'] +
17143 stevensc 209
                    '" data-toggle="tooltip" title="LABEL_PLAY_VIDEO">' +
210
                    '<i class="fa fa-video"></i>' +
211
                    '</button>'
17141 stevensc 212
                }
213
 
214
                if (data['document']) {
215
                    s =
216
                    s +
17143 stevensc 217
                    '&nbsp;' +
218
                    '<button class="btn btn-view-document" data-href="' +
17141 stevensc 219
                    data['document'] +
17143 stevensc 220
                    '" data-toggle="tooltip" title="LABEL_VIEW_DOCUMENT">' +
221
                    '<i class="fa fa-file"></i>' +
222
                    '</button>'
17141 stevensc 223
                }
224
 
225
                if (data['text']) {
226
                    s =
227
                    s +
17143 stevensc 228
                    '&nbsp;' +
229
                    '<button class="btn btn-view-text" data-href="' +
17141 stevensc 230
                    data['text'] +
17143 stevensc 231
                    '" data-toggle="tooltip" title="LABEL_VIEW_TEXT">' +
232
                    '<i class="fa fa-text-width"></i>' +
233
                    '</button>'
17141 stevensc 234
                }
235
 
236
                return s
237
                }
238
            },
239
            {
240
                targets: -1,
241
                orderable: false,
242
                render: function (data, type, row) {
243
                s = ''
244
 
245
                if (allowEdit && data['link_edit']) {
246
                    s =
247
                    s +
248
                    '<button class="btn btn-info btn-sm btn-edit" data-href="' +
249
                    data['link_edit'] +
250
                    '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> Editar </button>&nbsp;'
251
                }
252
                if (allowDelete && data['link_delete']) {
253
                    s =
254
                    s +
255
                    '<button class="btn btn-danger btn-sm btn-delete" data-href="' +
256
                    data['link_delete'] +
257
                    '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> Eliminar</button>&nbsp;'
258
                }
259
                return s
260
                }
261
            }
262
            ]
263
        })
264
 
265
        var validatorTextAdd = $('#form-slide-text-add').validate({
266
            debug: true,
267
            onclick: false,
268
            onkeyup: false,
269
            ignore: [],
270
            rules: {
271
            name: {
272
                required: true,
273
                maxlength: 128
274
            },
275
            description: {
276
                updateCkeditor: function () {
277
                CKEDITOR.instances.description_add.updateElement()
278
                },
279
                required: true
280
            },
281
            background: {
282
                required: true,
283
                extension: 'jpg|jpeg|png',
284
                accept: 'image/jpg,image/jpeg,image/png'
285
            },
286
            order: {
287
                required: true,
288
                digits: true,
289
                min: 1,
290
                max: 250
291
            }
292
            },
293
            submitHandler: function (form) {
294
            var formdata = false
295
            if (window.FormData) {
296
                formdata = new FormData(form) //form[0]);
297
            }
298
 
299
            NProgress.start()
300
            $.ajax({
301
                dataType: 'json',
302
                accept: 'application/json',
303
                method: 'post',
304
                url: routeAdd,
305
                data: formdata,
306
                processData: false,
307
                contentType: false
308
            })
309
                .done(function (response) {
310
                if (response['success']) {
311
                    $.fn.showSuccess(response['data'])
312
 
313
                    gridTable.api().ajax.reload(null, false)
314
 
315
                    $('#row-text-add-box').hide()
316
                    $('#row-text-edit-box').hide()
317
                    $('#row-image-add-box').hide()
318
                    $('#row-image-edit-box').hide()
319
                    $('#row-video-add-box').hide()
320
                    $('#row-video-edit-box').hide()
321
                    $('#row-document-add-box').hide()
322
                    $('#row-document-edit-box').hide()
323
                    $('#row-audio-add-box').hide()
324
                    $('#row-audio-edit-box').hide()
325
                    $('#row-quizz-add-box').hide()
326
                    $('#row-quizz-edit-box').hide()
327
                    $('#row-listing').show()
328
                } else {
329
                    validatorTextAdd.resetForm()
330
                    if (jQuery.type(response['data']) == 'string') {
331
                    $.fn.showError(response['data'])
332
                    } else {
333
                    $.each(response['data'], function (fieldname, errors) {
334
                        $.fn.showFormErrorValidator(
335
                        '#form-slide-text-add #' + fieldname,
336
                        errors
337
                        )
338
                    })
339
                    }
340
                }
341
                })
342
                .fail(function (jqXHR, textStatus, errorThrown) {
343
                $.fn.showError(textStatus)
344
                })
345
                .always(function () {
346
                NProgress.done()
347
                })
348
            return false
349
            },
350
            invalidHandler: function (form, validator) {}
351
        })
352
 
353
        var validatorTextEdit = $('#form-slide-text-edit').validate({
354
            debug: true,
355
            onclick: false,
356
            onkeyup: false,
357
            ignore: [],
358
            rules: {
359
            name: {
360
                required: true,
361
                maxlength: 128
362
            },
363
            description: {
364
                updateCkeditor: function () {
365
                CKEDITOR.instances.description_edit.updateElement()
366
                },
367
                required: true
368
            },
369
            background: {
370
                required: false,
371
                extension: 'jpg|jpeg|png',
372
                accept: 'image/jpg,image/jpeg,image/png'
373
            },
374
            order: {
375
                required: true,
376
                digits: true,
377
                min: 1,
378
                max: 250
379
            }
380
            },
381
            submitHandler: function (form) {
382
            var formdata = false
383
            if (window.FormData) {
384
                formdata = new FormData(form) //form[0]);
385
            }
386
 
387
            NProgress.start()
388
            $.ajax({
389
                dataType: 'json',
390
                accept: 'application/json',
391
                method: 'post',
392
                url: $('#form-slide-text-edit').attr('action'),
393
                data: formdata,
394
                processData: false,
395
                contentType: false
396
            })
397
                .done(function (response) {
398
                if (response['success']) {
399
                    $.fn.showSuccess(response['data'])
400
 
401
                    gridTable.api().ajax.reload(null, false)
402
 
403
                    $('#row-text-add-box').hide()
404
                    $('#row-text-edit-box').hide()
405
                    $('#row-image-add-box').hide()
406
                    $('#row-image-edit-box').hide()
407
                    $('#row-video-add-box').hide()
408
                    $('#row-video-edit-box').hide()
409
                    $('#row-document-add-box').hide()
410
                    $('#row-document-edit-box').hide()
411
                    $('#row-audio-add-box').hide()
412
                    $('#row-audio-edit-box').hide()
413
                    $('#row-quizz-add-box').hide()
414
                    $('#row-quizz-edit-box').hide()
415
                    $('#row-listing').show()
416
                } else {
417
                    validatorTextEdit.resetForm()
418
                    if (jQuery.type(response['data']) == 'string') {
419
                    $.fn.showError(response['data'])
420
                    } else {
421
                    $.each(response['data'], function (fieldname, errors) {
422
                        $.fn.showFormErrorValidator(
423
                        '#form-slide-text-edit #' + fieldname,
424
                        errors
425
                        )
426
                    })
427
                    }
428
                }
429
                })
430
                .fail(function (jqXHR, textStatus, errorThrown) {
431
                $.fn.showError(textStatus)
432
                })
433
                .always(function () {
434
                NProgress.done()
435
                })
436
            return false
437
            },
438
            invalidHandler: function (form, validator) {}
439
        })
440
 
441
        var validatorImageAdd = $('#form-slide-image-add').validate({
442
            debug: true,
443
            onclick: false,
444
            onkeyup: false,
445
            ignore: [],
446
            rules: {
447
            name: {
448
                required: true,
449
                maxlength: 128
450
            },
451
            file: {
452
                required: true,
453
                extension: 'jpg|jpeg|png',
454
                accept: 'image/jpg,image/jpeg,image/png'
455
            },
456
            order: {
457
                required: true,
458
                digits: true,
459
                min: 1,
460
                max: 250
461
            }
462
            },
463
            submitHandler: function (form) {
464
            var formdata = false
465
            if (window.FormData) {
466
                formdata = new FormData(form) //form[0]);
467
            }
468
 
469
            NProgress.start()
470
            $.ajax({
471
                dataType: 'json',
472
                accept: 'application/json',
473
                method: 'post',
474
                url: routeAdd,
475
                data: formdata,
476
                processData: false,
477
                contentType: false
478
            })
479
                .done(function (response) {
480
                console.log(response)
481
                if (response['success']) {
482
                    $.fn.showSuccess(response['data'])
483
 
484
                    gridTable.api().ajax.reload(null, false)
485
 
486
                    $('#row-text-add-box').hide()
487
                    $('#row-text-edit-box').hide()
488
                    $('#row-image-add-box').hide()
489
                    $('#row-image-edit-box').hide()
490
                    $('#row-video-add-box').hide()
491
                    $('#row-video-edit-box').hide()
492
                    $('#row-document-add-box').hide()
493
                    $('#row-document-edit-box').hide()
494
                    $('#row-audio-add-box').hide()
495
                    $('#row-audio-edit-box').hide()
496
                    $('#row-quizz-add-box').hide()
497
                    $('#row-quizz-edit-box').hide()
498
                    $('#row-listing').show()
499
                } else {
500
                    validatorImageAdd.resetForm()
501
                    if (jQuery.type(response['data']) == 'string') {
502
                    $.fn.showError(response['data'])
503
                    } else {
504
                    $.each(response['data'], function (fieldname, errors) {
505
                        $.fn.showFormErrorValidator(
506
                        '#form-slide-image-add #' + fieldname,
507
                        errors
508
                        )
509
                    })
510
                    }
511
                }
512
                })
513
                .fail(function (jqXHR, textStatus, errorThrown) {
514
                $.fn.showError(textStatus)
515
                })
516
                .always(function () {
517
                NProgress.done()
518
                })
519
            return false
520
            },
521
            invalidHandler: function (form, validator) {}
522
        })
523
 
524
        var validatorImageEdit = $('#form-slide-image-edit').validate({
525
            debug: true,
526
            onclick: false,
527
            onkeyup: false,
528
            ignore: [],
529
            rules: {
530
            name: {
531
                required: true,
532
                maxlength: 128
533
            },
534
            file: {
535
                required: false,
536
                extension: 'jpg|jpeg|png',
537
                accept: 'image/jpg,image/jpeg,image/png'
538
            },
539
            order: {
540
                required: true,
541
                digits: true,
542
                min: 1,
543
                max: 250
544
            }
545
            },
546
            submitHandler: function (form) {
547
            var formdata = false
548
            if (window.FormData) {
549
                formdata = new FormData(form) //form[0]);
550
            }
551
 
552
            NProgress.start()
553
            $.ajax({
554
                dataType: 'json',
555
                accept: 'application/json',
556
                method: 'post',
557
                url: $('#form-slide-image-edit').attr('action'),
558
                data: formdata,
559
                processData: false,
560
                contentType: false
561
            })
562
                .done(function (response) {
563
                if (response['success']) {
564
                    $.fn.showSuccess(response['data'])
565
 
566
                    gridTable.api().ajax.reload(null, false)
567
 
568
                    $('#row-text-add-box').hide()
569
                    $('#row-text-edit-box').hide()
570
                    $('#row-image-add-box').hide()
571
                    $('#row-image-edit-box').hide()
572
                    $('#row-video-add-box').hide()
573
                    $('#row-video-edit-box').hide()
574
                    $('#row-document-add-box').hide()
575
                    $('#row-document-edit-box').hide()
576
                    $('#row-audio-add-box').hide()
577
                    $('#row-audio-edit-box').hide()
578
                    $('#row-quizz-add-box').hide()
579
                    $('#row-quizz-edit-box').hide()
580
                    $('#row-listing').show()
581
                } else {
582
                    validatorImageEdit.resetForm()
583
                    if (jQuery.type(response['data']) == 'string') {
584
                    $.fn.showError(response['data'])
585
                    } else {
586
                    $.each(response['data'], function (fieldname, errors) {
587
                        $.fn.showFormErrorValidator(
588
                        '#form-slide-image-edit #' + fieldname,
589
                        errors
590
                        )
591
                    })
592
                    }
593
                }
594
                })
595
                .fail(function (jqXHR, textStatus, errorThrown) {
596
                $.fn.showError(textStatus)
597
                })
598
                .always(function () {
599
                NProgress.done()
600
                })
601
            return false
602
            },
603
            invalidHandler: function (form, validator) {}
604
        })
605
 
606
        var validatorVideoAdd = $('#form-slide-video-add').validate({
607
            debug: true,
608
            onclick: false,
609
            onkeyup: false,
610
            ignore: [],
611
            rules: {
612
            name: {
613
                required: true,
614
                maxlength: 128
615
            },
616
            file: {
617
                required: true,
618
                extension: 'webm,mp4,webm',
619
                accept: 'video/webm,video/mpeg,video/mp4'
620
            },
621
            background: {
622
                required: true,
623
                extension: 'jpg|jpeg|png',
624
                accept: 'image/jpg,image/jpeg,image/png'
625
            },
626
            order: {
627
                required: true,
628
                digits: true,
629
                min: 1,
630
                max: 250
631
            }
632
            },
633
            submitHandler: function (form) {
634
            var formdata = false
635
            if (window.FormData) {
636
                formdata = new FormData(form) //form[0]);
637
            }
638
 
639
            NProgress.start()
640
            $.ajax({
641
                dataType: 'json',
642
                accept: 'application/json',
643
                method: 'post',
644
                url: routeAdd,
645
                data: formdata,
646
                processData: false,
647
                contentType: false
648
            })
649
                .done(function (response) {
650
                if (response['success']) {
651
                    $.fn.showSuccess(response['data'])
652
 
653
                    gridTable.api().ajax.reload(null, false)
654
 
655
                    $('#row-text-add-box').hide()
656
                    $('#row-text-edit-box').hide()
657
                    $('#row-image-add-box').hide()
658
                    $('#row-image-edit-box').hide()
659
                    $('#row-video-add-box').hide()
660
                    $('#row-video-edit-box').hide()
661
                    $('#row-document-add-box').hide()
662
                    $('#row-document-edit-box').hide()
663
                    $('#row-audio-add-box').hide()
664
                    $('#row-audio-edit-box').hide()
665
                    $('#row-quizz-add-box').hide()
666
                    $('#row-quizz-edit-box').hide()
667
                    $('#row-listing').show()
668
                } else {
669
                    validatorVideoAdd.resetForm()
670
                    if (jQuery.type(response['data']) == 'string') {
671
                    $.fn.showError(response['data'])
672
                    } else {
673
                    $.each(response['data'], function (fieldname, errors) {
674
                        $.fn.showFormErrorValidator(
675
                        '#form-slide-video-add #' + fieldname,
676
                        errors
677
                        )
678
                    })
679
                    }
680
                }
681
                })
682
                .fail(function (jqXHR, textStatus, errorThrown) {
683
                $.fn.showError(textStatus)
684
                })
685
                .always(function () {
686
                NProgress.done()
687
                })
688
            return false
689
            },
690
            invalidHandler: function (form, validator) {}
691
        })
692
 
693
        var validatorVideoEdit = $('#form-slide-video-edit').validate({
694
            debug: true,
695
            onclick: false,
696
            onkeyup: false,
697
            ignore: [],
698
            rules: {
699
            name: {
700
                required: true,
701
                maxlength: 128
702
            },
703
            file: {
704
                required: false,
705
                extension: 'webm,mp4,webm',
706
                accept: 'video/webm,video/mpeg,video/mp4'
707
            },
708
            background: {
709
                required: false,
710
                extension: 'jpg|jpeg|png',
711
                accept: 'image/jpg,image/jpeg,image/png'
712
            },
713
            order: {
714
                required: true,
715
                digits: true,
716
                min: 1,
717
                max: 250
718
            }
719
            },
720
            submitHandler: function (form) {
721
            var formdata = false
722
            if (window.FormData) {
723
                formdata = new FormData(form) //form[0]);
724
            }
725
 
726
            NProgress.start()
727
            $.ajax({
728
                dataType: 'json',
729
                accept: 'application/json',
730
                method: 'post',
731
                url: $('#form-slide-video-edit').attr('action'),
732
                data: formdata,
733
                processData: false,
734
                contentType: false
735
            })
736
                .done(function (response) {
737
                if (response['success']) {
738
                    $.fn.showSuccess(response['data'])
739
 
740
                    gridTable.api().ajax.reload(null, false)
741
 
742
                    $('#row-text-add-box').hide()
743
                    $('#row-text-edit-box').hide()
744
                    $('#row-image-add-box').hide()
745
                    $('#row-image-edit-box').hide()
746
                    $('#row-video-add-box').hide()
747
                    $('#row-video-edit-box').hide()
748
                    $('#row-document-add-box').hide()
749
                    $('#row-document-edit-box').hide()
750
                    $('#row-audio-add-box').hide()
751
                    $('#row-audio-edit-box').hide()
752
                    $('#row-quizz-add-box').hide()
753
                    $('#row-quizz-edit-box').hide()
754
                    $('#row-listing').show()
755
                } else {
756
                    validatorVideoEdit.resetForm()
757
                    if (jQuery.type(response['data']) == 'string') {
758
                    $.fn.showError(response['data'])
759
                    } else {
760
                    $.each(response['data'], function (fieldname, errors) {
761
                        $.fn.showFormErrorValidator(
762
                        '#form-slide-video-edit #' + fieldname,
763
                        errors
764
                        )
765
                    })
766
                    }
767
                }
768
                })
769
                .fail(function (jqXHR, textStatus, errorThrown) {
770
                $.fn.showError(textStatus)
771
                })
772
                .always(function () {
773
                NProgress.done()
774
                })
775
            return false
776
            },
777
            invalidHandler: function (form, validator) {}
778
        })
779
 
780
        var validatorDocumentAdd = $('#form-slide-document-add').validate({
781
            debug: true,
782
            onclick: false,
783
            onkeyup: false,
784
            ignore: [],
785
            rules: {
786
            name: {
787
                required: true,
788
                maxlength: 128
789
            },
790
            file: {
791
                required: true,
792
                extension: 'pdf',
793
                accept: 'application/pdf'
794
            },
795
            background: {
796
                required: true,
797
                extension: 'jpg|jpeg|png',
798
                accept: 'image/jpg,image/jpeg,image/png'
799
            },
800
            order: {
801
                required: true,
802
                digits: true,
803
                min: 1,
804
                max: 250
805
            }
806
            },
807
            submitHandler: function (form) {
808
            var formdata = false
809
            if (window.FormData) {
810
                formdata = new FormData(form) //form[0]);
811
            }
812
 
813
            NProgress.start()
814
            $.ajax({
815
                dataType: 'json',
816
                accept: 'application/json',
817
                method: 'post',
818
                url: routeAdd,
819
                data: formdata,
820
                processData: false,
821
                contentType: false
822
            })
823
                .done(function (response) {
824
                if (response['success']) {
825
                    $.fn.showSuccess(response['data'])
826
 
827
                    gridTable.api().ajax.reload(null, false)
828
 
829
                    $('#row-text-add-box').hide()
830
                    $('#row-text-edit-box').hide()
831
                    $('#row-image-add-box').hide()
832
                    $('#row-image-edit-box').hide()
833
                    $('#row-video-add-box').hide()
834
                    $('#row-video-edit-box').hide()
835
                    $('#row-document-add-box').hide()
836
                    $('#row-document-edit-box').hide()
837
                    $('#row-audio-add-box').hide()
838
                    $('#row-audio-edit-box').hide()
839
                    $('#row-quizz-add-box').hide()
840
                    $('#row-quizz-edit-box').hide()
841
                    $('#row-listing').show()
842
                } else {
843
                    validatorDocumentAdd.resetForm()
844
                    if (jQuery.type(response['data']) == 'string') {
845
                    $.fn.showError(response['data'])
846
                    } else {
847
                    $.each(response['data'], function (fieldname, errors) {
848
                        $.fn.showFormErrorValidator(
849
                        '#form-slide-document-add #' + fieldname,
850
                        errors
851
                        )
852
                    })
853
                    }
854
                }
855
                })
856
                .fail(function (jqXHR, textStatus, errorThrown) {
857
                $.fn.showError(textStatus)
858
                })
859
                .always(function () {
860
                NProgress.done()
861
                })
862
            return false
863
            },
864
            invalidHandler: function (form, validator) {}
865
        })
866
 
867
        var validatorDocumentEdit = $('#form-slide-document-edit').validate({
868
            debug: true,
869
            onclick: false,
870
            onkeyup: false,
871
            ignore: [],
872
            rules: {
873
            name: {
874
                required: true,
875
                maxlength: 128
876
            },
877
            file: {
878
                required: false,
879
                extension: 'pdf',
880
                accept: 'application/pdf'
881
            },
882
            background: {
883
                required: false,
884
                extension: 'jpg|jpeg|png',
885
                accept: 'image/jpg,image/jpeg,image/png'
886
            },
887
            order: {
888
                required: true,
889
                digits: true,
890
                min: 1,
891
                max: 250
892
            }
893
            },
894
            submitHandler: function (form) {
895
            var formdata = false
896
            if (window.FormData) {
897
                formdata = new FormData(form) //form[0]);
898
            }
899
 
900
            NProgress.start()
901
            $.ajax({
902
                dataType: 'json',
903
                accept: 'application/json',
904
                method: 'post',
905
                url: $('#form-slide-document-edit').attr('action'),
906
                data: formdata,
907
                processData: false,
908
                contentType: false
909
            })
910
                .done(function (response) {
911
                if (response['success']) {
912
                    $.fn.showSuccess(response['data'])
913
 
914
                    gridTable.api().ajax.reload(null, false)
915
 
916
                    $('#row-text-add-box').hide()
917
                    $('#row-text-edit-box').hide()
918
                    $('#row-image-add-box').hide()
919
                    $('#row-image-edit-box').hide()
920
                    $('#row-video-add-box').hide()
921
                    $('#row-video-edit-box').hide()
922
                    $('#row-document-add-box').hide()
923
                    $('#row-document-edit-box').hide()
924
                    $('#row-audio-add-box').hide()
925
                    $('#row-audio-edit-box').hide()
926
                    $('#row-quizz-add-box').hide()
927
                    $('#row-quizz-edit-box').hide()
928
                    $('#row-listing').show()
929
                } else {
930
                    validatorDocumentEdit.resetForm()
931
                    if (jQuery.type(response['data']) == 'string') {
932
                    $.fn.showError(response['data'])
933
                    } else {
934
                    $.each(response['data'], function (fieldname, errors) {
935
                        $.fn.showFormErrorValidator(
936
                        '#form-slide-document-edit #' + fieldname,
937
                        errors
938
                        )
939
                    })
940
                    }
941
                }
942
                })
943
                .fail(function (jqXHR, textStatus, errorThrown) {
944
                $.fn.showError(textStatus)
945
                })
946
                .always(function () {
947
                NProgress.done()
948
                })
949
            return false
950
            },
951
            invalidHandler: function (form, validator) {}
952
        })
953
 
954
        var validatorAudioAdd = $('#form-slide-audio-add').validate({
955
            debug: true,
956
            onclick: false,
957
            onkeyup: false,
958
            ignore: [],
959
            rules: {
960
            name: {
961
                required: true,
962
                maxlength: 128
963
            },
964
            file: {
965
                required: true,
966
                extension: 'wav|mp3',
967
                accept: 'audio/wav, audio/mpeg'
968
            },
969
 
970
            background: {
971
                required: true,
972
                extension: 'jpg|jpeg|png',
973
                accept: 'image/jpg,image/jpeg,image/png'
974
            },
975
            order: {
976
                required: true,
977
                digits: true,
978
                min: 1,
979
                max: 250
980
            }
981
            },
982
            submitHandler: function (form) {
983
            var formdata = false
984
            if (window.FormData) {
985
                formdata = new FormData(form) //form[0]);
986
            }
987
 
988
            NProgress.start()
989
            $.ajax({
990
                dataType: 'json',
991
                accept: 'application/json',
992
                method: 'post',
993
                url: routeAdd,
994
                data: formdata,
995
                processData: false,
996
                contentType: false
997
            })
998
                .done(function (response) {
999
                if (response['success']) {
1000
                    $.fn.showSuccess(response['data'])
1001
 
1002
                    gridTable.api().ajax.reload(null, false)
1003
 
1004
                    $('#row-text-add-box').hide()
1005
                    $('#row-text-edit-box').hide()
1006
                    $('#row-image-add-box').hide()
1007
                    $('#row-image-edit-box').hide()
1008
                    $('#row-video-add-box').hide()
1009
                    $('#row-video-edit-box').hide()
1010
                    $('#row-document-add-box').hide()
1011
                    $('#row-document-edit-box').hide()
1012
                    $('#row-audio-add-box').hide()
1013
                    $('#row-audio-edit-box').hide()
1014
                    $('#row-quizz-add-box').hide()
1015
                    $('#row-quizz-edit-box').hide()
1016
                    $('#row-listing').show()
1017
                } else {
1018
                    validatorAudioAdd.resetForm()
1019
                    if (jQuery.type(response['data']) == 'string') {
1020
                    $.fn.showError(response['data'])
1021
                    } else {
1022
                    $.each(response['data'], function (fieldname, errors) {
1023
                        $.fn.showFormErrorValidator(
1024
                        '#form-slide-audio-add #' + fieldname,
1025
                        errors
1026
                        )
1027
                    })
1028
                    }
1029
                }
1030
                })
1031
                .fail(function (jqXHR, textStatus, errorThrown) {
1032
                $.fn.showError(textStatus)
1033
                })
1034
                .always(function () {
1035
                NProgress.done()
1036
                })
1037
            return false
1038
            },
1039
            invalidHandler: function (form, validator) {}
1040
        })
1041
 
1042
        var validatorAudioEdit = $('#form-slide-audio-edit').validate({
1043
            debug: true,
1044
            onclick: false,
1045
            onkeyup: false,
1046
            ignore: [],
1047
            rules: {
1048
            name: {
1049
                required: true,
1050
                maxlength: 128
1051
            },
1052
            file: {
1053
                required: false,
1054
                extension: 'wav|mp3',
1055
                accept: 'audio/wav, audio/mpeg'
1056
            },
1057
 
1058
            background: {
1059
                required: false,
1060
                extension: 'jpg|jpeg|png',
1061
                accept: 'image/jpg,image/jpeg,image/png'
1062
            },
1063
            order: {
1064
                required: true,
1065
                digits: true,
1066
                min: 1,
1067
                max: 250
1068
            }
1069
            },
1070
            submitHandler: function (form) {
1071
            var formdata = false
1072
            if (window.FormData) {
1073
                formdata = new FormData(form) //form[0]);
1074
            }
1075
 
1076
            NProgress.start()
1077
            $.ajax({
1078
                dataType: 'json',
1079
                accept: 'application/json',
1080
                method: 'post',
1081
                url: $('#form-slide-audio-edit').attr('action'),
1082
                data: formdata,
1083
                processData: false,
1084
                contentType: false
1085
            })
1086
                .done(function (response) {
1087
                if (response['success']) {
1088
                    $.fn.showSuccess(response['data'])
1089
 
1090
                    gridTable.api().ajax.reload(null, false)
1091
 
1092
                    $('#row-text-add-box').hide()
1093
                    $('#row-text-edit-box').hide()
1094
                    $('#row-image-add-box').hide()
1095
                    $('#row-image-edit-box').hide()
1096
                    $('#row-video-add-box').hide()
1097
                    $('#row-video-edit-box').hide()
1098
                    $('#row-document-add-box').hide()
1099
                    $('#row-document-edit-box').hide()
1100
                    $('#row-audio-add-box').hide()
1101
                    $('#row-audio-edit-box').hide()
1102
                    $('#row-quizz-add-box').hide()
1103
                    $('#row-quizz-edit-box').hide()
1104
                    $('#row-listing').show()
1105
                } else {
1106
                    validatorAudioEdit.resetForm()
1107
                    if (jQuery.type(response['data']) == 'string') {
1108
                    $.fn.showError(response['data'])
1109
                    } else {
1110
                    $.each(response['data'], function (fieldname, errors) {
1111
                        $.fn.showFormErrorValidator(
1112
                        '#form-slide-audio-edit #' + fieldname,
1113
                        errors
1114
                        )
1115
                    })
1116
                    }
1117
                }
1118
                })
1119
                .fail(function (jqXHR, textStatus, errorThrown) {
1120
                $.fn.showError(textStatus)
1121
                })
1122
                .always(function () {
1123
                NProgress.done()
1124
                })
1125
            return false
1126
            },
1127
            invalidHandler: function (form, validator) {}
1128
        })
1129
 
1130
        var validatorQuizzAdd = $('#form-slide-quizz-add').validate({
1131
            debug: true,
1132
            onclick: false,
1133
            onkeyup: false,
1134
            ignore: [],
1135
            rules: {
1136
            name: {
1137
                required: true,
1138
                maxlength: 128
1139
            },
1140
            file: {
1141
                required: true,
1142
                extension: 'wav|mp3',
1143
                accept: 'quizz/wav, quizz/mpeg'
1144
            },
1145
            background: {
1146
                required: true,
1147
                extension: 'jpg|jpeg|png',
1148
                accept: 'image/jpg,image/jpeg,image/png'
1149
            },
1150
            quiz_id: {
1151
                required: true
1152
            },
1153
            order: {
1154
                required: true,
1155
                digits: true,
1156
                min: 1,
1157
                max: 250
1158
            }
1159
            },
1160
            submitHandler: function (form) {
1161
            NProgress.start()
1162
            var formdata = false
1163
            if (window.FormData) {
1164
                formdata = new FormData(form) //form[0]);
1165
            }
1166
 
1167
            $.ajax({
1168
                dataType: 'json',
1169
                accept: 'application/json',
1170
                method: 'post',
1171
                url: routeAdd,
1172
                data: formdata,
1173
                processData: false,
1174
                contentType: false
1175
            })
1176
                .done(function (response) {
1177
                if (response['success']) {
1178
                    $.fn.showSuccess(response['data'])
1179
 
1180
                    gridTable.api().ajax.reload(null, false)
1181
 
1182
                    $('#row-text-add-box').hide()
1183
                    $('#row-text-edit-box').hide()
1184
                    $('#row-image-add-box').hide()
1185
                    $('#row-image-edit-box').hide()
1186
                    $('#row-video-add-box').hide()
1187
                    $('#row-video-edit-box').hide()
1188
                    $('#row-document-add-box').hide()
1189
                    $('#row-document-edit-box').hide()
1190
                    $('#row-audio-add-box').hide()
1191
                    $('#row-audio-edit-box').hide()
1192
                    $('#row-quizz-add-box').hide()
1193
                    $('#row-quizz-edit-box').hide()
1194
                    $('#row-listing').show()
1195
                } else {
1196
                    validatorQuizzAdd.resetForm()
1197
                    if (jQuery.type(response['data']) == 'string') {
1198
                    $.fn.showError(response['data'])
1199
                    } else {
1200
                    $.each(response['data'], function (fieldname, errors) {
1201
                        $.fn.showFormErrorValidator(
1202
                        '#form-slide-quizz-add #' + fieldname,
1203
                        errors
1204
                        )
1205
                    })
1206
                    }
1207
                }
1208
                })
1209
                .fail(function (jqXHR, textStatus, errorThrown) {
1210
                $.fn.showError(textStatus)
1211
                })
1212
                .always(function () {
1213
                NProgress.done()
1214
                })
1215
            return false
1216
            },
1217
            invalidHandler: function (form, validator) {}
1218
        })
1219
 
1220
        var validatorQuizzEdit = $('#form-slide-quizz-edit').validate({
1221
            debug: true,
1222
            onclick: false,
1223
            onkeyup: false,
1224
            ignore: [],
1225
            rules: {
1226
            name: {
1227
                required: true,
1228
                maxlength: 128
1229
            },
1230
            background: {
1231
                required: false,
1232
                extension: 'jpg|jpeg|png',
1233
                accept: 'image/jpg,image/jpeg,image/png'
1234
            },
1235
            quiz_id: {
1236
                required: true
1237
            },
1238
            order: {
1239
                required: true,
1240
                digits: true,
1241
                min: 1,
1242
                max: 250
1243
            }
1244
            },
1245
            submitHandler: function (form) {
1246
            NProgress.start()
1247
            var formdata = false
1248
            if (window.FormData) {
1249
                formdata = new FormData(form) //form[0]);
1250
            }
1251
            $.ajax({
1252
                dataType: 'json',
1253
                accept: 'application/json',
1254
                method: 'post',
1255
                url: $('#form-slide-quizz-edit').attr('action'),
1256
                data: formdata,
1257
                processData: false,
1258
                contentType: false
1259
            })
1260
                .done(function (response) {
1261
                if (response['success']) {
1262
                    $.fn.showSuccess(response['data'])
1263
 
1264
                    gridTable.api().ajax.reload(null, false)
1265
 
1266
                    $('#row-text-add-box').hide()
1267
                    $('#row-text-edit-box').hide()
1268
                    $('#row-image-add-box').hide()
1269
                    $('#row-image-edit-box').hide()
1270
                    $('#row-video-add-box').hide()
1271
                    $('#row-video-edit-box').hide()
1272
                    $('#row-document-add-box').hide()
1273
                    $('#row-document-edit-box').hide()
1274
                    $('#row-audio-add-box').hide()
1275
                    $('#row-audio-edit-box').hide()
1276
                    $('#row-quizz-add-box').hide()
1277
                    $('#row-quizz-edit-box').hide()
1278
                    $('#row-listing').show()
1279
                } else {
1280
                    validatorQuizzEdit.resetForm()
1281
                    if (jQuery.type(response['data']) == 'string') {
1282
                    $.fn.showError(response['data'])
1283
                    } else {
1284
                    $.each(response['data'], function (fieldname, errors) {
1285
                        $.fn.showFormErrorValidator(
1286
                        '#form-slide-quizz-edit #' + fieldname,
1287
                        errors
1288
                        )
1289
                    })
1290
                    }
1291
                }
1292
                })
1293
                .fail(function (jqXHR, textStatus, errorThrown) {
1294
                $.fn.showError(textStatus)
1295
                })
1296
                .always(function () {
1297
                NProgress.done()
1298
                })
1299
            return false
1300
            },
1301
            invalidHandler: function (form, validator) {}
1302
        })
1303
 
1304
        $('body').on('click', 'button.btn-edit', function (e) {
1305
            e.preventDefault()
1306
            NProgress.start()
1307
            var url = $(this).data('href')
1308
            $.ajax({
1309
            dataType: 'json',
1310
            accept: 'application/json',
1311
            method: 'get',
1312
            url: url
1313
            })
1314
            .done(function (response) {
1315
                if (response['success']) {
1316
                $('#row-listing').hide()
1317
 
1318
                $('#row-text-add-box').hide()
1319
                $('#row-text-edit-box').hide()
1320
                $('#row-image-add-box').hide()
1321
                $('#row-image-edit-box').hide()
1322
                $('#row-video-add-box').hide()
1323
                $('#row-video-edit-box').hide()
1324
                $('#row-document-add-box').hide()
1325
                $('#row-document-edit-box').hide()
1326
                $('#row-audio-add-box').hide()
1327
                $('#row-audio-edit-box').hide()
1328
                $('#row-quizz-add-box').hide()
1329
                $('#row-quizz-edit-box').hide()
1330
 
1331
                if (response['data']['type'] == 'text') {
1332
                    $('#form-slide-text-edit').attr('action', url)
1333
                    $('#form-slide-text-edit #name').val(response['data']['name'])
1334
                    $('#form-slide-text-edit #order').val(response['data']['order'])
1335
                    $('#form-slide-text-edit #file').fileinput('reset')
1336
                    $('#form-slide-text-edit #file').val('')
1337
 
1338
                    CKEDITOR.instances.description_edit.setData(
1339
                    response['data']['description']
1340
                    )
1341
                    validatorTextEdit.resetForm()
1342
 
1343
                    $('#row-text-edit-box').show()
1344
                }
1345
                if (response['data']['type'] == 'image') {
1346
                    console.log(response['data']['file'])
1347
                    $('#form-slide-image-edit').attr('action', url)
1348
                    $('#form-slide-image-edit #name').val(response['data']['name'])
1349
                    $('#form-slide-image-edit #order').val(response['data']['order'])
1350
                    $('#form-slide-image-edit #background').fileinput('reset')
1351
                    $('#form-slide-image-edit #background').val('')
1352
                    validatorImageEdit.resetForm()
1353
 
1354
                    $('#row-image-edit-box').show()
1355
                }
1356
                if (response['data']['type'] == 'video') {
1357
                    $('#form-slide-video-edit').attr('action', url)
1358
                    $('#form-slide-video-edit #name').val(response['data']['name'])
1359
                    $('#form-slide-video-edit #order').val(response['data']['order'])
1360
                    $('#form-slide-video-edit #file').fileinput('reset')
1361
                    $('#form-slide-video-edit #file').val('')
1362
                    $('#form-slide-video-edit #background').fileinput('reset')
1363
                    $('#form-slide-video-edit #background').val('')
1364
 
1365
                    $('#row-video-edit-box').show()
1366
                }
1367
                if (response['data']['type'] == 'document') {
1368
                    $('#form-slide-document-edit').attr('action', url)
1369
                    $('#form-slide-document-edit #name').val(response['data']['name'])
1370
                    $('#form-slide-document-edit #order').val(response['data']['order'])
1371
                    $('#form-slide-document-edit #file').fileinput('reset')
1372
                    $('#form-slide-document-edit #file').val('')
1373
                    $('#form-slide-document-edit #background').fileinput('reset')
1374
                    $('#form-slide-document-edit #background').val('')
1375
                    validatorDocumentEdit.resetForm()
1376
 
1377
                    $('#row-document-edit-box').show()
1378
                }
1379
                if (response['data']['type'] == 'audio') {
1380
                    $('#form-slide-audio-edit').attr('action', url)
1381
                    $('#form-slide-audio-edit #name').val(response['data']['name'])
1382
                    $('#form-slide-audio-edit #order').val(response['data']['order'])
1383
                    $('#form-slide-audio-edit #file').fileinput('reset')
1384
                    $('#form-slide-audio-edit #file').val('')
1385
                    $('#form-slide-audio-edit #background').fileinput('reset')
1386
                    $('#form-slide-audio-edit #background').val('')
1387
                    validatorAudioEdit.resetForm()
1388
 
1389
                    $('#row-audio-edit-box').show()
1390
                }
1391
                if (response['data']['type'] == 'quiz') {
1392
                    $('#form-slide-quizz-edit').attr('action', url)
1393
                    $('#form-slide-quizz-edit #name').val(response['data']['name'])
1394
                    $('#form-slide-quizz-edit #order').val(response['data']['order'])
1395
                    $('#form-slide-quizz-edit #quiz_id').val(
1396
                    response['data']['quiz_id']
1397
                    )
1398
                    $('#form-slide-quizz-edit #background').fileinput('reset')
1399
                    $('#form-slide-quizz-edit #background').val('')
1400
                    validatorQuizzEdit.resetForm()
1401
 
1402
                    $('#row-quizz-add-box').show()
1403
                }
1404
                } else {
1405
                validatorTextEdit.resetForm()
1406
                if (jQuery.type(response['data']) == 'string') {
1407
                    $.fn.showError(response['data'])
1408
                } else {
1409
                    $.each(response['data'], function (fieldname, errors) {
1410
                    $.fn.showFormErrorValidator(
1411
                        '#form-slide-image-edit #' + fieldname,
1412
                        errors
1413
                    )
1414
                    })
1415
                }
1416
                }
1417
            })
1418
            .fail(function (jqXHR, textStatus, errorThrown) {
1419
                $.fn.showError(textStatus)
1420
            })
1421
            .always(function () {
1422
                NProgress.done()
1423
            })
1424
        })
1425
 
1426
        $('.btn-cancel').on('click', function (e) {
1427
            e.preventDefault()
1428
 
1429
            $('#row-text-add-box').hide()
1430
            $('#row-text-edit-box').hide()
1431
            $('#row-image-add-box').hide()
1432
            $('#row-image-edit-box').hide()
1433
            $('#row-video-add-box').hide()
1434
            $('#row-video-edit-box').hide()
1435
            $('#row-document-add-box').hide()
1436
            $('#row-document-edit-box').hide()
1437
            $('#row-audio-add-box').hide()
1438
            $('#row-audio-edit-box').hide()
1439
            $('#row-quizz-add-box').hide()
1440
            $('#row-quizz-edit-box').hide()
1441
 
1442
            $('#modal-play-video-box').modal('hide')
1443
            $('#modal-play-audio-box').modal('hide')
1444
 
1445
            document.getElementById('microlearning-play-video').pause()
1446
            document.getElementById('microlearning-play-audio').pause()
1447
 
1448
            $('#row-listing').show()
1449
 
1450
            return false
1451
        })
1452
 
1453
        $('#btn-add-quizz').click(function (e) {
1454
            e.preventDefault()
1455
            $('#modal-add-capsule-type-box').modal('hide')
1456
 
1457
            $('#form-slide-quizz-add #name').val('')
1458
            $('#form-slide-quizz-add #order').val('1')
1459
            $('#form-slide-quizz-add #quiz_id').val('')
1460
            $('#form-slide-quizz-add #file').fileinput('reset')
1461
            $('#form-slide-quizz-add #file').val('')
1462
            CKEDITOR.instances.description_add.setData('')
1463
            validatorQuizzAdd.resetForm()
1464
 
1465
            $('#row-listing').hide()
1466
            $('#row-quizz-add-box').show()
1467
 
1468
            return false
1469
        })
1470
 
1471
        $('#btn-add-text').click(function (e) {
1472
            e.preventDefault()
1473
 
1474
            $('#modal-add-capsule-type-box').modal('hide')
1475
 
1476
            $('#form-slide-text-add #name').val('')
1477
            $('#form-slide-text-add #order').val('1')
1478
            $('#form-slide-text-add #file').fileinput('reset')
1479
            $('#form-slide-text-add #file').val('')
1480
 
1481
            CKEDITOR.instances.description_add.setData('')
1482
            validatorTextAdd.resetForm()
1483
 
1484
            $('#row-listing').hide()
1485
            $('#row-text-add-box').show()
1486
        })
1487
 
1488
        $('#btn-add-image').click(function (e) {
1489
            e.preventDefault()
1490
 
1491
            $('#modal-add-capsule-type-box').modal('hide')
1492
            $('#form-slide-image-add #name').val('')
1493
            $('#form-slide-image-add #order').val('1')
1494
            $('#form-slide-image-add #file').fileinput('reset')
1495
            $('#form-slide-image-add #file').val('')
1496
 
1497
            validatorImageAdd.resetForm()
1498
 
1499
            $('#row-listing').hide()
1500
            $('#row-image-add-box').show()
1501
 
1502
            return false
1503
        })
1504
 
1505
        $('#btn-add-video').click(function (e) {
1506
            e.preventDefault()
1507
 
1508
            $('#modal-add-capsule-type-box').modal('hide')
1509
            $('#form-slide-video-add #name').val('')
1510
            $('#form-slide-video-add #order').val('1')
1511
            $('#form-slide-video-add #file').fileinput('reset')
1512
            $('#form-slide-video-add #file').val('')
1513
            $('#form-slide-video-add #background').fileinput('reset')
1514
            $('#form-slide-video-add #backgroud').val('')
1515
            validatorVideoAdd.resetForm()
1516
 
1517
            $('#row-listing').hide()
1518
            $('#row-video-add-box').show()
1519
 
1520
            return false
1521
        })
1522
 
1523
        $('#btn-add-document').click(function (e) {
1524
            e.preventDefault()
1525
 
1526
            $('#modal-add-capsule-type-box').modal('hide')
1527
            $('#form-slide-document-add #name').val('')
1528
            $('#form-slide-document-add #order').val('1')
1529
            $('#form-slide-document-add #file').fileinput('reset')
1530
            $('#form-slide-document-add #file').val('')
1531
            $('#form-slide-document-add #background').fileinput('reset')
1532
            $('#form-slide-document-add #background').val('')
1533
            validatorDocumentAdd.resetForm()
1534
 
1535
            $('#row-listing').hide()
1536
            $('#row-document-add-box').show()
1537
 
1538
            return false
1539
        })
1540
 
1541
        $('#btn-add-audio').click(function (e) {
1542
            e.preventDefault()
1543
 
1544
            $('#modal-add-capsule-type-box').modal('hide')
1545
            $('#form-slide-audio-add #name').val('')
1546
            $('#form-slide-audio-add #order').val('1')
1547
            $('#form-slide-audio-add #file').fileinput('reset')
1548
            $('#form-slide-audio-add #file').val('')
1549
            $('#form-slide-audio-add #background').fileinput('reset')
1550
            $('#form-slide-audio-add #background').val('')
1551
            validatorAudioAdd.resetForm()
1552
 
1553
            $('#row-listing').hide()
1554
            $('#row-audio-add-box').show()
1555
 
1556
            return false
1557
        })
1558
 
1559
        $('#modal-play-video-box, #modal-play-audio-box').on(
1560
            'hide.bs.modal',
1561
            function () {
1562
            document.getElementById('microlearning-play-video').pause()
1563
            document.getElementById('microlearning-play-audio').pause()
1564
            }
1565
        )
1566
 
1567
        $('#form-slide-text-add #order').inputNumberFormat({ decimal: 0 })
1568
        $('#form-slide-text-edit #order').inputNumberFormat({ decimal: 0 })
1569
 
1570
        $('#form-slide-text-add #background').fileinput({
1571
            theme: 'fa',
1572
            language: 'es',
1573
            showUpload: false,
1574
            dropZoneEnabled: false,
1575
            maxFileCount: 1,
1576
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1577
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1578
        })
1579
 
1580
        $('#form-slide-text-edit #background').fileinput({
1581
            theme: 'fa',
1582
            language: 'es',
1583
            showUpload: false,
1584
            dropZoneEnabled: false,
1585
            maxFileCount: 1,
1586
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1587
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1588
        })
1589
 
1590
        $('#form-slide-image-add #order').inputNumberFormat({ decimal: 0 })
1591
        $('#form-slide-image-edit #order').inputNumberFormat({ decimal: 0 })
1592
 
1593
        $('#form-slide-image-add #file').fileinput({
1594
            theme: 'fa',
1595
            language: 'es',
1596
            showUpload: false,
1597
            dropZoneEnabled: false,
1598
            maxFileCount: 1,
1599
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1600
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1601
        })
1602
 
1603
        $('#form-slide-image-edit #file').fileinput({
1604
            theme: 'fa',
1605
            language: 'es',
1606
            showUpload: false,
1607
            dropZoneEnabled: false,
1608
            maxFileCount: 1,
1609
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1610
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1611
        })
1612
 
1613
        $('#form-slide-video-add #order').inputNumberFormat({ decimal: 0 })
1614
        $('#form-slide-video-edit #order').inputNumberFormat({ decimal: 0 })
1615
 
1616
        $('#form-slide-video-add #file').fileinput({
1617
            theme: 'fa',
1618
            language: 'es',
1619
            showUpload: false,
1620
            dropZoneEnabled: false,
1621
            maxFileCount: 1,
1622
            allowedFileExtensions: ['mp4', 'mpeg', 'webm'],
1623
            msgPlaceholder: 'Video de extensión mp4, mpeg, webm'
1624
        })
1625
 
1626
        $('#form-slide-video-edit #file').fileinput({
1627
            theme: 'fa',
1628
            language: 'es',
1629
            showUpload: false,
1630
            dropZoneEnabled: false,
1631
            maxFileCount: 1,
1632
            allowedFileExtensions: ['mp4', 'mpeg', 'webm'],
1633
            msgPlaceholder: 'Video de extensión mp4, mpeg, webm'
1634
        })
1635
 
1636
        $('#form-slide-video-add #background').fileinput({
1637
            theme: 'fa',
1638
            language: 'es',
1639
            showUpload: false,
1640
            dropZoneEnabled: false,
1641
            maxFileCount: 1,
1642
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1643
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1644
        })
1645
 
1646
        $('#form-slide-video-edit #background').fileinput({
1647
            theme: 'fa',
1648
            language: 'es',
1649
            showUpload: false,
1650
            dropZoneEnabled: false,
1651
            maxFileCount: 1,
1652
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1653
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1654
        })
1655
 
1656
        $('#form-slide-document-add #order').inputNumberFormat({ decimal: 0 })
1657
 
1658
        $('#form-slide-document-add #file').fileinput({
1659
            theme: 'fa',
1660
            language: 'es',
1661
            showUpload: false,
1662
            dropZoneEnabled: false,
1663
            maxFileCount: 1,
1664
            allowedFileExtensions: ['pdf'],
1665
            msgPlaceholder: 'Documentos de extensión pdf'
1666
        })
1667
 
1668
        $('#form-slide-document-edit #order').inputNumberFormat({ decimal: 0 })
1669
 
1670
        $('#form-slide-document-edit #file').fileinput({
1671
            theme: 'fa',
1672
            language: 'es',
1673
            showUpload: false,
1674
            dropZoneEnabled: false,
1675
            maxFileCount: 1,
1676
            allowedFileExtensions: ['pdf'],
1677
            msgPlaceholder: 'Documentos de extensión pdf'
1678
        })
1679
 
1680
        $('#form-slide-document-add #background').fileinput({
1681
            theme: 'fa',
1682
            language: 'es',
1683
            showUpload: false,
1684
            dropZoneEnabled: false,
1685
            maxFileCount: 1,
1686
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1687
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1688
        })
1689
 
1690
        $('#form-slide-document-edit #background').fileinput({
1691
            theme: 'fa',
1692
            language: 'es',
1693
            showUpload: false,
1694
            dropZoneEnabled: false,
1695
            maxFileCount: 1,
1696
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1697
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1698
        })
1699
 
1700
        $('#form-slide-audio-add #order').inputNumberFormat({ decimal: 0 })
1701
 
1702
        $('#form-slide-audio-add #file').fileinput({
1703
            theme: 'fa',
1704
            language: 'es',
1705
            showUpload: false,
1706
            dropZoneEnabled: false,
1707
            maxFileCount: 1,
1708
            allowedFileExtensions: ['wav', 'mp3'],
1709
            msgPlaceholder: 'Audios de extensión wav y mp3'
1710
        })
1711
 
1712
        $('#form-slide-audio-edit #order').inputNumberFormat({ decimal: 0 })
1713
 
1714
        $('#form-slide-audio-edit #file').fileinput({
1715
            theme: 'fa',
1716
            language: 'es',
1717
            showUpload: false,
1718
            dropZoneEnabled: false,
1719
            maxFileCount: 1,
1720
            allowedFileExtensions: ['wav', 'mp3'],
1721
            msgPlaceholder: 'Audios de extensión wav y mp3'
1722
        })
1723
 
1724
        $('#form-slide-audio-add #background').fileinput({
1725
            theme: 'fa',
1726
            language: 'es',
1727
            showUpload: false,
1728
            dropZoneEnabled: false,
1729
            maxFileCount: 1,
1730
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1731
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1732
        })
1733
 
1734
        $('#form-slide-audio-edit #background').fileinput({
1735
            theme: 'fa',
1736
            language: 'es',
1737
            showUpload: false,
1738
            dropZoneEnabled: false,
1739
            maxFileCount: 1,
1740
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1741
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1742
        })
1743
 
1744
        $('#form-slide-quizz-add #order').inputNumberFormat({ decimal: 0 })
1745
 
1746
        $('#form-slide-quizz-edit #order').inputNumberFormat({ decimal: 0 })
1747
 
1748
        $('#form-slide-quizz-add #background').fileinput({
1749
            theme: 'fa',
1750
            language: 'es',
1751
            showUpload: false,
1752
            dropZoneEnabled: false,
1753
            maxFileCount: 1,
1754
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1755
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1756
        })
1757
 
1758
        $('#form-slide-quizz-edit #background').fileinput({
1759
            theme: 'fa',
1760
            language: 'es',
1761
            showUpload: false,
1762
            dropZoneEnabled: false,
1763
            maxFileCount: 1,
1764
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
1765
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
1766
        })
1767
 
1768
        CKEDITOR.replace('description_add', {
1769
            toolbar: [
1770
            { name: 'editing', items: ['Scayt'] },
1771
            { name: 'links', items: ['Link', 'Unlink'] },
1772
            {
1773
                name: 'paragraph',
1774
                items: [
1775
                'NumberedList',
1776
                'BulletedList',
1777
                '-',
1778
                'Outdent',
1779
                'Indent',
1780
                'Blockquote'
1781
                ]
1782
            },
1783
            {
1784
                name: 'basicstyles',
1785
                items: ['Bold', 'Italic', 'Strike', 'RemoveFormat']
1786
            },
1787
            '/',
1788
            {
1789
                name: 'insert',
1790
                items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar']
1791
            },
1792
            { name: 'styles', items: ['Styles', 'Format'] },
1793
            { name: 'tools', items: ['Maximize'] }
1794
            ],
1795
            removePlugins: 'elementspath,Anchor',
1796
            heigth: 100
1797
        })
1798
        CKEDITOR.replace('description_edit', {
1799
            toolbar: [
1800
            { name: 'editing', items: ['Scayt'] },
1801
            { name: 'links', items: ['Link', 'Unlink'] },
1802
            {
1803
                name: 'paragraph',
1804
                items: [
1805
                'NumberedList',
1806
                'BulletedList',
1807
                '-',
1808
                'Outdent',
1809
                'Indent',
1810
                'Blockquote'
1811
                ]
1812
            },
1813
            {
1814
                name: 'basicstyles',
1815
                items: ['Bold', 'Italic', 'Strike', 'RemoveFormat']
1816
            },
1817
            '/',
1818
            {
1819
                name: 'insert',
1820
                items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar']
1821
            },
1822
            { name: 'styles', items: ['Styles', 'Format'] },
1823
            { name: 'tools', items: ['Maximize'] }
1824
            ],
1825
            removePlugins: 'elementspath,Anchor',
1826
            heigth: 100
1827
        })
1828
 
1829
        $('body').on('click', '.btn-view-image', function (e) {
1830
            e.preventDefault()
1831
 
1832
            $('#modal-view-image-box').modal('show')
1833
 
1834
            $('#image-view').attr('src', $(this).data('href'))
1835
 
1836
            return false
1837
        })
1838
 
1839
        $('body').on('click', '.btn-play-video', function (e) {
1840
            e.preventDefault()
1841
 
1842
            $('#microlearning-play-video').attr('src', $(this).data('href'))
1843
            $('#modal-play-video-box').modal('show')
1844
 
1845
            return false
1846
        })
1847
 
1848
        $('body').on('click', '.btn-play-audio', function (e) {
1849
            e.preventDefault()
1850
 
1851
            $('#microlearning-play-audio').attr('src', $(this).data('href'))
1852
            $('#modal-play-audio-box').modal('show')
1853
 
1854
            return false
1855
        })
1856
 
1857
        $('body').on('click', '.btn-view-document', function (e) {
1858
            e.preventDefault()
1859
 
1860
            $('#document-view').attr('src', $(this).data('href'))
1861
            $('#modal-view-document-box').modal('show')
1862
 
1863
            return false
1864
        })
1865
 
1866
        $('body').on('click', '.btn-view-text', function (e) {
1867
            e.preventDefault()
1868
 
1869
            var url = $(this).data('href')
1870
            $.ajax({
1871
            dataType: 'json',
1872
            accept: 'application/json',
1873
            method: 'get',
1874
            url: url
1875
            })
1876
            .done(function (response) {
1877
                if (response['success']) {
1878
                $('#document-text').html(response['data'])
1879
                }
1880
            })
1881
            .fail(function (jqXHR, textStatus, errorThrown) {
1882
                $.fn.showError(textStatus)
1883
            })
1884
            .always(function () {
1885
                NProgress.done()
1886
            })
1887
 
1888
            $('#modal-view-text-box').modal('show')
1889
 
1890
            return false
1891
        })
1892
 
1893
        $('#form-filter #capsule_uuid').change(function (e) {
1894
            e.preventDefault()
1895
            if ($(this).val()) {
1896
            gridTable.api().ajax.reload(null, false)
1897
            } else {
1898
            // Si no hay cápsula seleccionada, limpiar la tabla
1899
            gridTable.api().clear().draw()
1900
            }
1901
        })
1902
 
1903
        $('button.btn-add').click(function (e) {
1904
            e.preventDefault()
1905
 
1906
            $('#modal-add-capsule-type-box').modal('show')
1907
        })
1908
 
1909
        $('body').on('click', 'button.btn-delete', function (e) {
1910
            e.preventDefault()
1911
            var action = $(this).data('href')
1912
 
1913
            swal
1914
            .fire({
1915
                title: 'LABEL_ARE_YOU_SURE',
1916
                icon: 'question',
1917
                cancelButtonText: 'LABEL_NO',
1918
                showCancelButton: true,
1919
                confirmButtonText: 'LABEL_YES'
1920
            })
1921
            .then((result) => {
1922
                if (result.isConfirmed) {
1923
                NProgress.start()
1924
                $.ajax({
1925
                    dataType: 'json',
1926
                    accept: 'application/json',
1927
                    method: 'post',
1928
                    url: action
1929
                })
1930
                    .done(function (response) {
1931
                    if (response['success']) {
1932
                        $.fn.showSuccess(response['data'])
1933
                        gridTable.api().ajax.reload(null, false)
1934
                    } else {
1935
                        $.fn.showError(response['data'])
1936
                    }
1937
                    })
1938
                    .fail(function (jqXHR, textStatus, errorThrown) {
1939
                    $.fn.showError(textStatus)
1940
                    })
1941
                    .always(function () {
1942
                    NProgress.done()
1943
                    })
1944
                }
1945
            })
1946
        })
1947
 
1948
        $('body').on('click', 'button.btn-refresh', function (e) {
1949
            e.preventDefault()
1950
            gridTable.api().ajax.reload(null, false)
1951
        })
1952
 
1953
        var validatorFilter = $('#form-filter').validate({
1954
            debug: true,
1955
            onclick: false,
1956
            onkeyup: false,
1957
            ignore: [],
1958
            rules: {
1959
            capsule_uuid: {
1960
                required: true
1961
            }
1962
            },
1963
            submitHandler: function (form) {
1964
            return false
1965
            }
1966
        })
1967
 
1968
        $('#form-filter').on('submit', function (e) {
1969
            e.preventDefault()
1970
            if (validatorFilter.valid()) {
1971
            gridTable.api().ajax.reload(null, false)
1972
            }
1973
            return false
1974
        })
1975
    })
1 www 1976
JS;
1977
$this->inlineScript()->captureEnd();
1978
?>
1979
 
16905 efrain 1980
<div class="container">
1981
	<div class="card" id="row-listing">
1982
	 	<div class="card-header">
1983
	 		<h6 class="card-title">LABEL_SLIDES</h6>
1984
	 	</div>
17138 stevensc 1985
 
16905 efrain 1986
	 	<div class="card-body">
17138 stevensc 1987
            <?php
1988
            $form = $this->form;
1989
            $form->setAttributes([
1990
                'name'    => 'form-filter',
1991
                'id'      => 'form-filter',
1992
            ]);
1993
            $form->prepare();
1994
            echo $this->form()->openTag($form);
1995
            ?>
1996
                <div class="row">
17003 efrain 1997
         	    	<div class="col-md-12 mt-3">
16905 efrain 1998
        				<?php
1999
                        $element = $form->get('capsule_uuid');
2000
                        $element->setOptions(['label' => 'LABEL_CAPSULE']);
2001
                        $element->setAttributes(['class' => 'form-control']);
2002
                        echo $this->formLabel($element);
2003
                        echo $this->formSelect($element);
2004
                        ?>
2005
                	</div>
2006
              	</div>
17138 stevensc 2007
			<?php echo $this->form()->closeTag($form); ?>
16905 efrain 2008
 
17138 stevensc 2009
            <div class="row">
2010
                <div class="col-12 mt-3">
2011
                    <table id="gridTable" class="table   table-bordered">
2012
                        <thead>
2013
                            <tr>
2014
                                <th>LABEL_NAME</th>
2015
                                <th>LABEL_DETAILS</th>
2016
                                <th>LABEL_MEDIA</th>
2017
                                <th>LABEL_ACTIONS</th>
2018
                            </tr>
2019
                        </thead>
2020
                        <tbody>
2021
                        </tbody>
2022
                    </table>
2023
                </div>
2024
            </div>
16905 efrain 2025
		</div>
1 www 2026
 
16905 efrain 2027
	 	<div class="card-footer text-right">
17138 stevensc 2028
	 	    <button type="button" class="btn btn-info btn-refresh">
2029
                <i class="fa fa-sync"></i>
2030
                LABEL_REFRESH
2031
            </button>
16905 efrain 2032
			<?php if($allowAdd) : ?>
16910 efrain 2033
			<div class="btn-group dropup">
2034
            	<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2035
            		<i class="fa fa-plus"></i> LABEL_ADD
2036
            	</button>
17138 stevensc 2037
 
16910 efrain 2038
            	<div class="dropdown-menu">
2039
            		<a class="dropdown-item" href="#" id="btn-add-image"><i class="fa fa-image mr-2" aria-hidden="true"></i> LABEL_IMAGE </a>
2040
                   	<a class="dropdown-item" href="#" id="btn-add-text"><i class="fa fa-file mr-2" aria-hidden="true"></i> LABEL_TEXT </a>
2041
                    <a class="dropdown-item" href="#" id="btn-add-video"><i class="fa fa-video mr-2" aria-hidden="true"></i> LABEL_VIDEO </a>
2042
                    <a class="dropdown-item" href="#" id="btn-add-document"><i class="fa fa-file mr-2" aria-hidden="true"></i> LABEL_DOCUMENT </a>
2043
                    <a class="dropdown-item" href="#" id="btn-add-audio"><i class="fa fa-music mr-2" aria-hidden="true"></i> LABEL_AUDIO </a>
2044
                    <a class="dropdown-item" href="#" id="btn-add-quizz"><i class="fa fa-question mr-2" aria-hidden="true"></i> LABEL_QUIZ </a>
2045
            	</div>
2046
            </div>
16905 efrain 2047
			<?php endif; ?>
2048
	 	</div>
2049
	</div>
6528 nelberth 2050
 
16905 efrain 2051
 
16906 efrain 2052
	<div class="card" id="row-text-add-box" style="display: none">
16905 efrain 2053
	 	<div class="card-header">
2054
	 		<h6 class="card-title">LABEL_ADD_TEXT_SLIDE</h6>
2055
	 	</div>
2056
	 	<?php
1 www 2057
    	    $form = $this->formTextAdd;
2058
    	    $form->setAttributes([
2059
    	       'method'    => 'post',
2060
    	       'name'      => 'form-slide-text-add',
2061
    	       'id'        => 'form-slide-text-add'
2062
    	    ]);
2063
    	    $form->prepare();
2064
    	    echo $this->form()->openTag($form);
2065
 
2066
    	    $element = $form->get('type');
2067
    	    echo $this->formHidden($element);
2068
 
2069
    	    ?>
16905 efrain 2070
	 	<div class="card-body">
1 www 2071
 
16905 efrain 2072
	 		<div class="row">
2073
	 	         <div class="col-12 mt-3">
1 www 2074
    				<?php
2075
                        $element = $form->get('name');
2076
                        $element->setAttributes(['class' => 'form-control']);
2077
                        $element->setOptions(['label' => 'LABEL_NAME']);
2078
                        echo $this->formLabel($element);
2079
                        echo $this->formText($element);
2080
                    ?>
16905 efrain 2081
	 	         </div>
2082
	 	     </div>
2083
	 		<div class="row">
2084
	 	         <div class="col-12 mt-3">
1 www 2085
                	<?php
2086
                    $element = $form->get('description');
2087
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 2088
                    $element->setAttributes(['id' => 'description_add', 'rows' => '2',  'class' => 'form-control']);
1 www 2089
                    echo $this->formLabel($element);
2090
                    echo $this->formTextArea($element);
2091
                    ?>
16905 efrain 2092
	 	         </div>
2093
	 	     </div>
2094
	 		<div class="row">
2095
	 	         <div class="col-12 mt-3">
1 www 2096
    				<?php
2097
                        $element = $form->get('order');
2098
                        $element->setAttributes(['class' => 'form-control']);
2099
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2100
                        echo $this->formLabel($element);
2101
                        echo $this->formText($element);
2102
                    ?>
2103
				</div>
16906 efrain 2104
			</div>
16905 efrain 2105
	 		<div class="row">
2106
	 	         <div class="col-12 mt-3">
6529 nelberth 2107
                <?php
2108
                    $element = $form->get('background');
16905 efrain 2109
                    $element->setAttributes([ 'class' => 'form-control']);
2110
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2111
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2112
					echo $this->formLabel($element);
2113
                    echo $this->formFile($element);
2114
                ?>
2115
	 	         </div>
2116
	 	     </div>
2117
	 	</div>
2118
	 	<div class="card-footer text-right">
2119
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2120
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2121
	 	</div>
2122
	 	<?php echo $this->form()->closeTag($form); ?>
2123
	</div>
2124
 
16906 efrain 2125
	<div class="card" id="row-text-edit-box" style="display: none">
16905 efrain 2126
	 	<div class="card-header">
2127
	 		<h6 class="card-title">LABEL_EDIT_TEXT_SLIDE</h6>
2128
	 	</div>
2129
	 	<?php
1 www 2130
    	    $form = $this->formTextEdit;
2131
    	    $form->setAttributes([
2132
    	       'method'    => 'post',
2133
    	       'name'      => 'form-slide-text-edit',
2134
    	       'id'        => 'form-slide-text-edit'
2135
    	    ]);
2136
    	    $form->prepare();
2137
    	    echo $this->form()->openTag($form);
2138
 
2139
    	    $element = $form->get('type');
2140
    	    echo $this->formHidden($element);
2141
 
6595 nelberth 2142
    	    ?>
16905 efrain 2143
	 	<div class="card-body">
1 www 2144
 
16905 efrain 2145
	 		<div class="row">
2146
	 	         <div class="col-12 mt-3">
1 www 2147
    				<?php
2148
                        $element = $form->get('name');
2149
                        $element->setAttributes(['class' => 'form-control']);
2150
                        $element->setOptions(['label' => 'LABEL_NAME']);
2151
                        echo $this->formLabel($element);
2152
                        echo $this->formText($element);
2153
                    ?>
16905 efrain 2154
	 	         </div>
2155
	 	     </div>
2156
 
2157
	 		<div class="row">
2158
	 	         <div class="col-12 mt-3">
1 www 2159
                	<?php
2160
                    $element = $form->get('description');
2161
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 2162
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2',  'class' => 'form-control']);
1 www 2163
                    echo $this->formLabel($element);
2164
                    echo $this->formTextArea($element);
2165
                    ?>
16905 efrain 2166
	 	         </div>
2167
	 	     </div>
2168
 
2169
	 		<div class="row">
2170
	 	         <div class="col-12 mt-3">
1 www 2171
    				<?php
2172
                        $element = $form->get('order');
2173
                        $element->setAttributes(['class' => 'form-control']);
2174
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2175
                        echo $this->formLabel($element);
2176
                        echo $this->formText($element);
2177
                    ?>
16905 efrain 2178
	 	         </div>
2179
	 	     </div>
2180
 
2181
	 		<div class="row">
2182
	 	         <div class="col-12 mt-3">
6595 nelberth 2183
                <?php
2184
                    $element = $form->get('background');
16905 efrain 2185
                    $element->setAttributes([ 'class' => 'form-control']);
2186
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2187
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2188
					echo $this->formLabel($element);
2189
                    echo $this->formFile($element);
2190
                ?>
2191
	 	         </div>
2192
	 	     </div>
2193
	 	</div>
2194
	 	<div class="card-footer text-right">
2195
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2196
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2197
	 	</div>
2198
	 	<?php echo $this->form()->closeTag($form); ?>
2199
 
17138 stevensc 2200
	</div>
6595 nelberth 2201
 
16906 efrain 2202
	<div class="card" id="row-image-add-box" style="display: none">
16905 efrain 2203
	 	<div class="card-header">
2204
	 		<h6 class="card-title">LABEL_ADD_IMAGE_SLIDE</h6>
2205
	 	</div>
2206
		<?php
1 www 2207
    	    $form = $this->formImageAdd;
2208
    	    $form->setAttributes([
2209
    	       'method'    => 'post',
2210
    	        'name'      => 'form-slide-image-add',
2211
    	        'id'        => 'form-slide-image-add'
2212
    	    ]);
2213
    	    $form->prepare();
2214
    	    echo $this->form()->openTag($form);
2215
 
2216
    	    $element = $form->get('type');
2217
    	    echo $this->formHidden($element);
2218
 
2219
    	    ?>
16905 efrain 2220
	 	<div class="card-body">
1 www 2221
 
16905 efrain 2222
	 		<div class="row">
2223
	 	         <div class="col-12 mt-3">
1 www 2224
    				<?php
2225
                        $element = $form->get('name');
2226
                        $element->setAttributes(['class' => 'form-control']);
2227
                        $element->setOptions(['label' => 'LABEL_NAME']);
2228
                        echo $this->formLabel($element);
2229
                        echo $this->formText($element);
2230
                    ?>
16905 efrain 2231
	 	         </div>
2232
	 	     </div>
2233
	 		<div class="row">
2234
	 	         <div class="col-12 mt-3">
6137 nelberth 2235
 
6134 nelberth 2236
                <?php
2237
                    $element = $form->get('file');
16905 efrain 2238
					$element->setAttributes([ 'class' => 'form-control']);
2239
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2240
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2241
					echo $this->formLabel($element);
2242
                    echo $this->formFile($element);
6134 nelberth 2243
                ?>
16905 efrain 2244
	 	         </div>
2245
	 	     </div>
2246
	 		<div class="row">
2247
	 	         <div class="col-12 mt-3">
1 www 2248
    				<?php
2249
                        $element = $form->get('order');
2250
                        $element->setAttributes(['class' => 'form-control']);
2251
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2252
                        echo $this->formLabel($element);
2253
                        echo $this->formText($element);
2254
                    ?>
16905 efrain 2255
	 	         </div>
2256
	 	     </div>
2257
	 	</div>
2258
	 	<div class="card-footer text-right">
2259
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2260
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2261
	 	</div>
2262
	 	<?php echo $this->form()->closeTag($form); ?>
2263
	</div>
2264
 
2265
 
16906 efrain 2266
	<div class="card" id="row-image-edit-box" style="display: none">
16905 efrain 2267
	 	<div class="card-header">
2268
	 		<h6 class="card-title">LABEL_EDIT_IMAGE_SLIDE</h6>
2269
	 	</div>
2270
	 	 <?php
6505 nelberth 2271
    	    $form = $this->formImageEdit;
2272
    	    $form->setAttributes([
2273
    	       'method'    => 'post',
2274
    	       'name'      => 'form-slide-image-edit',
2275
    	       'id'        => 'form-slide-image-edit'
2276
    	    ]);
2277
    	    $form->prepare();
2278
    	    echo $this->form()->openTag($form);
2279
 
2280
    	    $element = $form->get('type');
2281
    	    echo $this->formHidden($element);
2282
 
2283
    	    ?>
16905 efrain 2284
	 	<div class="card-body">
6505 nelberth 2285
 
16905 efrain 2286
	 		<div class="row">
2287
	 	         <div class="col-12 mt-3">
6505 nelberth 2288
    				<?php
2289
                        $element = $form->get('name');
2290
                        $element->setAttributes(['class' => 'form-control']);
2291
                        $element->setOptions(['label' => 'LABEL_NAME']);
2292
                        echo $this->formLabel($element);
2293
                        echo $this->formText($element);
2294
                    ?>
16905 efrain 2295
	 	         </div>
2296
	 	     </div>
6505 nelberth 2297
 
16905 efrain 2298
	 		<div class="row">
2299
	 	         <div class="col-12 mt-3">
6505 nelberth 2300
                <?php
2301
                    $element = $form->get('file');
16905 efrain 2302
					$element->setAttributes([ 'class' => 'form-control']);
2303
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2304
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2305
					echo $this->formLabel($element);
2306
                    echo $this->formFile($element);
6505 nelberth 2307
                ?>
16905 efrain 2308
	 	         </div>
2309
	 	     </div>
2310
	 		<div class="row">
2311
	 	         <div class="col-12 mt-3">
6505 nelberth 2312
    				<?php
2313
                        $element = $form->get('order');
2314
                        $element->setAttributes(['class' => 'form-control']);
2315
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2316
                        echo $this->formLabel($element);
2317
                        echo $this->formText($element);
2318
                    ?>
2319
				</div>
16905 efrain 2320
	 	     </div>
2321
	 	</div>
2322
	 	<div class="card-footer text-right">
2323
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2324
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2325
	 	</div>
2326
	 	<?php echo $this->form()->closeTag($form); ?>
2327
	</div>
2328
 
16906 efrain 2329
	<div class="card" id="row-video-add-box" style="display: none">
16905 efrain 2330
	 	<div class="card-header">
2331
	 		<h6 class="card-title">LABEL_ADD_VIDEO_SLIDE</h6>
2332
	 	</div>
2333
	 	<?php
1 www 2334
    	    $form = $this->formVideoAdd;
2335
    	    $form->setAttributes([
2336
    	       'method'    => 'post',
2337
    	        'name'      => 'form-slide-video-add',
2338
    	        'id'        => 'form-slide-video-add'
2339
    	    ]);
2340
    	    $form->prepare();
2341
    	    echo $this->form()->openTag($form);
2342
 
2343
    	    $element = $form->get('type');
2344
    	    echo $this->formHidden($element);
2345
 
2346
    	    ?>
16905 efrain 2347
	 	<div class="card-body">
2348
	 		<div class="row">
2349
	 	         <div class="col-12 mt-3">
2350
	 	         </div>
2351
	 	     </div>
2352
 
2353
	 		<div class="row">
2354
	 	         <div class="col-12 mt-3">
1 www 2355
    				<?php
2356
                        $element = $form->get('name');
2357
                        $element->setAttributes(['class' => 'form-control']);
2358
                        $element->setOptions(['label' => 'LABEL_NAME']);
2359
                        echo $this->formLabel($element);
2360
                        echo $this->formText($element);
2361
                    ?>
16905 efrain 2362
	 	         </div>
2363
	 	     </div>
2364
	 		<div class="row">
2365
	 	         <div class="col-12 mt-3">
1 www 2366
    				<?php
2367
                        $element = $form->get('order');
2368
                        $element->setAttributes(['class' => 'form-control']);
2369
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2370
                        echo $this->formLabel($element);
2371
                        echo $this->formText($element);
2372
                    ?>
16905 efrain 2373
	 	         </div>
2374
	 	     </div>
2375
	 		<div class="row">
2376
	 	         <div class="col-12 mt-3">
1 www 2377
 
2378
                 		<?php
2379
                        $element = $form->get('file');
2380
                        $element->setAttributes(['class' => 'form-control']);
2381
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
2382
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
2383
                        echo $this->formLabel($element);
16905 efrain 2384
                        echo $this->formFile($element);
1 www 2385
                        ?>
16905 efrain 2386
	 	         </div>
2387
	 	     </div>
2388
	 		<div class="row">
2389
	 	         <div class="col-12 mt-3">
2390
                 		<?php
2391
                        $element = $form->get('background');
2392
                        $element->setAttributes(['class' => 'form-control']);
2393
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2394
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2395
                        echo $this->formLabel($element);
2396
                        echo $this->formFile($element);
2397
                        ?>
2398
 
2399
	 	         </div>
2400
	 	     </div>
2401
	 	</div>
2402
	 	<div class="card-footer text-right">
2403
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2404
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2405
	 	</div>
2406
	 	<?php echo $this->form()->closeTag($form); ?>
2407
	</div>
2408
 
2409
 
16906 efrain 2410
	<div class="card" id="row-video-edit-box" style="display: none">
16905 efrain 2411
	 	<div class="card-header">
2412
	 		<h6 class="card-title">>LABEL_EDIT_VIDEO_SLIDE</h6>
2413
	 	</div>
2414
	 	<?php
2415
    	 	$form = $this->formVideoEdit;
2416
    	 	$form->setAttributes([
2417
    	 	    'method'    => 'post',
2418
    	 	    'name'      => 'form-slide-video-edit',
2419
    	 	    'id'        => 'form-slide-video-edit'
2420
    	 	]);
1 www 2421
    	    $form->prepare();
2422
    	    echo $this->form()->openTag($form);
2423
 
2424
    	    $element = $form->get('type');
2425
    	    echo $this->formHidden($element);
2426
 
2427
    	    ?>
16905 efrain 2428
	 	<div class="card-body">
2429
	 		<div class="row">
2430
	 	         <div class="col-12 mt-3">
2431
	 	         </div>
2432
	 	     </div>
2433
 
2434
	 		<div class="row">
2435
	 	         <div class="col-12 mt-3">
1 www 2436
    				<?php
2437
                        $element = $form->get('name');
2438
                        $element->setAttributes(['class' => 'form-control']);
2439
                        $element->setOptions(['label' => 'LABEL_NAME']);
2440
                        echo $this->formLabel($element);
2441
                        echo $this->formText($element);
2442
                    ?>
16905 efrain 2443
	 	         </div>
2444
	 	     </div>
2445
	 		<div class="row">
2446
	 	         <div class="col-12 mt-3">
1 www 2447
    				<?php
2448
                        $element = $form->get('order');
2449
                        $element->setAttributes(['class' => 'form-control']);
2450
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2451
                        echo $this->formLabel($element);
2452
                        echo $this->formText($element);
2453
                    ?>
16905 efrain 2454
	 	         </div>
2455
	 	     </div>
2456
	 		<div class="row">
2457
	 	         <div class="col-12 mt-3">
2458
 
1 www 2459
                 		<?php
2460
                        $element = $form->get('file');
2461
                        $element->setAttributes(['class' => 'form-control']);
2462
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
2463
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
2464
                        echo $this->formLabel($element);
16905 efrain 2465
                        echo $this->formFile($element);
1 www 2466
                        ?>
16905 efrain 2467
	 	         </div>
2468
	 	     </div>
2469
	 		<div class="row">
2470
	 	         <div class="col-12 mt-3">
2471
                 		<?php
2472
                        $element = $form->get('background');
2473
                        $element->setAttributes(['class' => 'form-control']);
2474
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2475
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2476
                        echo $this->formLabel($element);
2477
                        echo $this->formFile($element);
2478
                        ?>
2479
 
2480
	 	         </div>
2481
	 	     </div>
2482
	 	</div>
2483
	 	<div class="card-footer text-right">
2484
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2485
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2486
	 	</div>
2487
	 	<?php echo $this->form()->closeTag($form); ?>
2488
	</div>
2489
 
2490
 
16906 efrain 2491
	<div class="card" id="row-document-add-box" style="display: none">
16905 efrain 2492
	 	<div class="card-header">
2493
	 		<h6 class="card-title">LABEL_ADD_DOCUMENT_SLIDE</h6>
2494
	 	</div>
2495
	 	<?php
1 www 2496
    	    $form = $this->formDocumentAdd;
2497
    	    $form->setAttributes([
2498
    	       'method'    => 'post',
2499
    	        'name'      => 'form-slide-document-add',
2500
    	        'id'        => 'form-slide-document-add'
2501
    	    ]);
2502
    	    $form->prepare();
2503
    	    echo $this->form()->openTag($form);
2504
 
2505
    	    $element = $form->get('type');
2506
    	    echo $this->formHidden($element);
2507
 
2508
    	    ?>
16905 efrain 2509
	 	<div class="card-body">
1 www 2510
 
16905 efrain 2511
 
2512
	 		<div class="row">
2513
	 	         <div class="col-12 mt-3">
1 www 2514
    				<?php
2515
                        $element = $form->get('name');
2516
                        $element->setAttributes(['class' => 'form-control']);
2517
                        $element->setOptions(['label' => 'LABEL_NAME']);
2518
                        echo $this->formLabel($element);
2519
                        echo $this->formText($element);
2520
                    ?>
16905 efrain 2521
	 	         </div>
2522
	 	     </div>
2523
	 		<div class="row">
2524
	 	         <div class="col-12 mt-3">
1 www 2525
    				<?php
2526
                        $element = $form->get('order');
2527
                        $element->setAttributes(['class' => 'form-control']);
2528
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2529
                        echo $this->formLabel($element);
2530
                        echo $this->formText($element);
2531
                    ?>
16905 efrain 2532
	 	         </div>
2533
	 	     </div>
2534
	 		<div class="row">
2535
	 	         <div class="col-12 mt-3">
1 www 2536
 
2537
                 		<?php
2538
                        $element = $form->get('file');
2539
                        $element->setAttributes(['class' => 'form-control']);
2540
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
2541
                        $element->setAttributes(['accept' => 'application/pdf']);
2542
                        echo $this->formLabel($element);
16905 efrain 2543
                        echo $this->formFile($element);
1 www 2544
                        ?>
16905 efrain 2545
 
1 www 2546
 
16905 efrain 2547
	 	         </div>
2548
	 	     </div>
2549
	 		<div class="row">
2550
	 	         <div class="col-12 mt-3">
2551
                 		<?php
2552
                        $element = $form->get('background');
2553
                        $element->setAttributes(['class' => 'form-control']);
2554
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2555
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2556
                        echo $this->formLabel($element);
2557
                        echo $this->formFile($element);
2558
                        ?>
6656 nelberth 2559
 
16905 efrain 2560
	 	         </div>
2561
	 	     </div>
2562
	 	</div>
2563
	 	<div class="card-footer text-right">
2564
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2565
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2566
	 	</div>
2567
	 	<?php echo $this->form()->closeTag($form); ?>
2568
	</div>
2569
 
2570
 
16906 efrain 2571
	<div class="card" id="row-document-edit-box" style="display: none">
16905 efrain 2572
	 	<div class="card-header">
2573
	 		<h6 class="card-title">LABEL_EDIT_DOCUMENT_SLIDE</h6>
2574
	 	</div>
2575
	 	<?php
2576
    	 	$form = $this->formDocumentEdit;
2577
    	 	$form->setAttributes([
2578
    	 	    'method'    => 'post',
2579
    	 	    'name'      => 'form-slide-document-edit',
2580
    	 	    'id'        => 'form-slide-document-edit'
2581
    	 	]);
1 www 2582
    	    $form->prepare();
2583
    	    echo $this->form()->openTag($form);
2584
 
2585
    	    $element = $form->get('type');
2586
    	    echo $this->formHidden($element);
2587
 
2588
    	    ?>
16905 efrain 2589
	 	<div class="card-body">
1 www 2590
 
16905 efrain 2591
 
2592
	 		<div class="row">
2593
	 	         <div class="col-12 mt-3">
1 www 2594
    				<?php
2595
                        $element = $form->get('name');
2596
                        $element->setAttributes(['class' => 'form-control']);
2597
                        $element->setOptions(['label' => 'LABEL_NAME']);
2598
                        echo $this->formLabel($element);
2599
                        echo $this->formText($element);
2600
                    ?>
16905 efrain 2601
	 	         </div>
2602
	 	     </div>
2603
	 		<div class="row">
2604
	 	         <div class="col-12 mt-3">
1 www 2605
    				<?php
2606
                        $element = $form->get('order');
2607
                        $element->setAttributes(['class' => 'form-control']);
2608
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2609
                        echo $this->formLabel($element);
2610
                        echo $this->formText($element);
2611
                    ?>
16905 efrain 2612
	 	         </div>
2613
	 	     </div>
2614
	 		<div class="row">
2615
	 	         <div class="col-12 mt-3">
1 www 2616
 
2617
                 		<?php
2618
                        $element = $form->get('file');
2619
                        $element->setAttributes(['class' => 'form-control']);
2620
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
2621
                        $element->setAttributes(['accept' => 'application/pdf']);
2622
                        echo $this->formLabel($element);
16905 efrain 2623
                        echo $this->formFile($element);
1 www 2624
                        ?>
16905 efrain 2625
 
1 www 2626
 
16905 efrain 2627
	 	         </div>
2628
	 	     </div>
2629
	 		<div class="row">
2630
	 	         <div class="col-12 mt-3">
2631
                 		<?php
2632
                        $element = $form->get('background');
2633
                        $element->setAttributes(['class' => 'form-control']);
2634
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2635
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2636
                        echo $this->formLabel($element);
2637
                        echo $this->formFile($element);
2638
                        ?>
6656 nelberth 2639
 
16905 efrain 2640
	 	         </div>
2641
	 	     </div>
2642
	 	</div>
2643
	 	<div class="card-footer text-right">
2644
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2645
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2646
	 	</div>
2647
	 	<?php echo $this->form()->closeTag($form); ?>
2648
	</div>
2649
 
16906 efrain 2650
	<div class="card" id="row-audio-add-box" style="display: none">
16905 efrain 2651
	 	<div class="card-header">
2652
	 		<h6 class="card-title">LABEL_ADD_AUDIO_SLIDE</h6>
2653
	 	</div>
2654
	 	<?php
1 www 2655
    	    $form = $this->formAudioAdd;
2656
    	    $form->setAttributes([
2657
    	       'method'    => 'post',
2658
    	        'name'      => 'form-slide-audio-add',
2659
    	        'id'        => 'form-slide-audio-add'
2660
    	    ]);
2661
    	    $form->prepare();
2662
    	    echo $this->form()->openTag($form);
2663
 
2664
    	    $element = $form->get('type');
2665
    	    echo $this->formHidden($element);
2666
 
2667
    	    ?>
16905 efrain 2668
	 	<div class="card-body">
2669
	 		<div class="row">
2670
	 	         <div class="col-12 mt-3">
2671
	 	         </div>
2672
	 	     </div>
2673
 
2674
	 		<div class="row">
2675
	 	         <div class="col-12 mt-3">
1 www 2676
    				<?php
2677
                        $element = $form->get('name');
2678
                        $element->setAttributes(['class' => 'form-control']);
2679
                        $element->setOptions(['label' => 'LABEL_NAME']);
2680
                        echo $this->formLabel($element);
2681
                        echo $this->formText($element);
2682
                    ?>
16905 efrain 2683
	 	         </div>
2684
	 	     </div>
2685
	 		<div class="row">
2686
	 	         <div class="col-12 mt-3">
1 www 2687
    				<?php
2688
                        $element = $form->get('order');
2689
                        $element->setAttributes(['class' => 'form-control']);
2690
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2691
                        echo $this->formLabel($element);
2692
                        echo $this->formText($element);
2693
                    ?>
16905 efrain 2694
	 	         </div>
2695
	 	     </div>
2696
	 		<div class="row">
2697
	 	         <div class="col-12 mt-3">
1 www 2698
 
2699
                 		<?php
2700
                        $element = $form->get('file');
2701
                        $element->setAttributes(['class' => 'form-control']);
2702
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
2703
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
2704
                        echo $this->formLabel($element);
16905 efrain 2705
                        echo $this->formFile($element);
2706
 
1 www 2707
                        ?>
16905 efrain 2708
	 	         </div>
2709
	 	     </div>
2710
	 		<div class="row">
2711
	 	         <div class="col-12 mt-3">
2712
                 		<?php
2713
                        $element = $form->get('background');
2714
                        $element->setAttributes(['class' => 'form-control']);
2715
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2716
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2717
                        echo $this->formLabel($element);
2718
                        echo $this->formFile($element);
2719
                        ?>
2720
 
2721
	 	         </div>
2722
	 	     </div>
2723
	 	</div>
2724
	 	<div class="card-footer text-right">
2725
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2726
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2727
	 	</div>
2728
	 	<?php echo $this->form()->closeTag($form); ?>
2729
	</div>
2730
 
2731
 
16906 efrain 2732
	<div class="card" id="row-audio-edit-box" style="display: none">
16905 efrain 2733
	 	<div class="card-header">
2734
	 		<h6 class="card-title">LABEL_EDIT_AUDIO_SLIDE</h6>
2735
	 	</div>
2736
	 	<?php
2737
    	 	$form = $this->formAudioEdit;
2738
    	 	$form->setAttributes([
2739
    	 	    'method'    => 'post',
2740
    	 	    'name'      => 'form-slide-audio-edit',
2741
    	 	    'id'        => 'form-slide-audio-edit'
2742
    	 	]);
1 www 2743
    	    $form->prepare();
2744
    	    echo $this->form()->openTag($form);
2745
 
2746
    	    $element = $form->get('type');
2747
    	    echo $this->formHidden($element);
2748
 
2749
    	    ?>
16905 efrain 2750
	 	<div class="card-body">
2751
	 		<div class="row">
2752
	 	         <div class="col-12 mt-3">
2753
	 	         </div>
2754
	 	     </div>
2755
 
2756
	 		<div class="row">
2757
	 	         <div class="col-12 mt-3">
1 www 2758
    				<?php
2759
                        $element = $form->get('name');
2760
                        $element->setAttributes(['class' => 'form-control']);
16905 efrain 2761
                        $element->setOptions(['label' => 'LABEL_NAME']);
1 www 2762
                        echo $this->formLabel($element);
2763
                        echo $this->formText($element);
2764
                    ?>
16905 efrain 2765
	 	         </div>
2766
	 	     </div>
2767
	 		<div class="row">
2768
	 	         <div class="col-12 mt-3">
1 www 2769
    				<?php
2770
                        $element = $form->get('order');
2771
                        $element->setAttributes(['class' => 'form-control']);
2772
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2773
                        echo $this->formLabel($element);
2774
                        echo $this->formText($element);
2775
                    ?>
16905 efrain 2776
	 	         </div>
2777
	 	     </div>
2778
	 		<div class="row">
2779
	 	         <div class="col-12 mt-3">
1 www 2780
 
2781
                 		<?php
2782
                        $element = $form->get('file');
2783
                        $element->setAttributes(['class' => 'form-control']);
2784
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
2785
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
2786
                        echo $this->formLabel($element);
16905 efrain 2787
                        echo $this->formFile($element);
2788
 
1 www 2789
                        ?>
16905 efrain 2790
	 	         </div>
2791
	 	     </div>
2792
	 		<div class="row">
2793
	 	         <div class="col-12 mt-3">
2794
                 		<?php
2795
                        $element = $form->get('background');
2796
                        $element->setAttributes(['class' => 'form-control']);
2797
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2798
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2799
                        echo $this->formLabel($element);
2800
                        echo $this->formFile($element);
2801
                        ?>
2802
 
2803
	 	         </div>
2804
	 	     </div>
2805
	 	</div>
2806
	 	<div class="card-footer text-right">
2807
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2808
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2809
	 	</div>
2810
	 	<?php echo $this->form()->closeTag($form); ?>
2811
	</div>
2812
 
2813
 
16906 efrain 2814
	<div class="card" id="row-quizz-add-box" style="display: none">
16905 efrain 2815
	 	<div class="card-header">
2816
	 		<h6 class="card-title">LABEL_ADD_QUIZ_SLIDE</h6>
2817
	 	</div>
2818
	 	<?php
1 www 2819
    	    $form = $this->formQuizzAdd;
2820
    	    $form->setAttributes([
2821
    	       'method'    => 'post',
2822
    	        'name'      => 'form-slide-quizz-add',
2823
    	        'id'        => 'form-slide-quizz-add'
2824
    	    ]);
2825
    	    $form->prepare();
2826
    	    echo $this->form()->openTag($form);
2827
 
2828
    	    $element = $form->get('type');
2829
    	    echo $this->formHidden($element);
2830
 
2831
    	    ?>
16905 efrain 2832
	 	<div class="card-body">
1 www 2833
 
16905 efrain 2834
	 		<div class="row">
2835
	 	         <div class="col-12 mt-3">
1 www 2836
    				<?php
2837
                        $element = $form->get('name');
2838
                        $element->setAttributes(['class' => 'form-control']);
2839
                        $element->setOptions(['label' => 'LABEL_NAME']);
2840
                        echo $this->formLabel($element);
2841
                        echo $this->formText($element);
2842
                    ?>
16905 efrain 2843
	 	         </div>
2844
	 	     </div>
2845
	 		<div class="row">
2846
	 	         <div class="col-12 mt-3">
1 www 2847
    				<?php
2848
                        $element = $form->get('order');
2849
                        $element->setAttributes(['class' => 'form-control']);
2850
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2851
                        echo $this->formLabel($element);
2852
                        echo $this->formText($element);
2853
                    ?>
16905 efrain 2854
	 	         </div>
2855
	 	     </div>
6657 nelberth 2856
 
16905 efrain 2857
	 		<div class="row">
2858
	 	         <div class="col-12 mt-3">
1 www 2859
    				<?php
2860
                        $element = $form->get('quiz_id');
2861
                        $element->setAttributes(['class' => 'form-control']);
2862
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
2863
                        echo $this->formLabel($element);
2864
                        echo $this->formSelect($element);
2865
                    ?>
16905 efrain 2866
	 	         </div>
2867
	 	     </div>
2868
 
2869
			<div class="row">
2870
	 	         <div class="col-12 mt-3">
2871
                 		<?php
2872
                        $element = $form->get('background');
2873
                        $element->setAttributes(['class' => 'form-control']);
2874
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2875
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2876
                        echo $this->formLabel($element);
2877
                        echo $this->formFile($element);
2878
                        ?>
2879
 
2880
	 	         </div>
2881
	 	     </div>
2882
	 	</div>
2883
	 	<div class="card-footer text-right">
2884
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2885
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2886
	 	</div>
2887
	 	<?php echo $this->form()->closeTag($form); ?>
2888
	</div>
2889
 
16906 efrain 2890
	<div class="card" id="row-quizz-edit-box" style="display: none">
16905 efrain 2891
	 	<div class="card-header">
2892
	 		<h6 class="card-title">LABEL_EDIT_QUIZ_SLIDE</h6>
2893
	 	</div>
2894
	 	<?php
2895
    	 	$form = $this->formQuizzEdit;
2896
    	 	$form->setAttributes([
2897
    	 	    'method'    => 'post',
2898
    	 	    'name'      => 'form-slide-quizz-edit',
2899
    	 	    'id'        => 'form-slide-quizz-edit'
2900
    	 	]);
1 www 2901
    	    $form->prepare();
2902
    	    echo $this->form()->openTag($form);
2903
 
2904
    	    $element = $form->get('type');
2905
    	    echo $this->formHidden($element);
2906
 
2907
    	    ?>
16905 efrain 2908
	 	<div class="card-body">
1 www 2909
 
16905 efrain 2910
	 		<div class="row">
2911
	 	         <div class="col-12 mt-3">
1 www 2912
    				<?php
2913
                        $element = $form->get('name');
2914
                        $element->setAttributes(['class' => 'form-control']);
2915
                        $element->setOptions(['label' => 'LABEL_NAME']);
2916
                        echo $this->formLabel($element);
2917
                        echo $this->formText($element);
2918
                    ?>
16905 efrain 2919
	 	         </div>
2920
	 	     </div>
2921
	 		<div class="row">
2922
	 	         <div class="col-12 mt-3">
1 www 2923
    				<?php
2924
                        $element = $form->get('order');
2925
                        $element->setAttributes(['class' => 'form-control']);
2926
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2927
                        echo $this->formLabel($element);
2928
                        echo $this->formText($element);
2929
                    ?>
16905 efrain 2930
	 	         </div>
2931
	 	     </div>
6657 nelberth 2932
 
16905 efrain 2933
	 		<div class="row">
2934
	 	         <div class="col-12 mt-3">
1 www 2935
    				<?php
2936
                        $element = $form->get('quiz_id');
2937
                        $element->setAttributes(['class' => 'form-control']);
2938
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
2939
                        echo $this->formLabel($element);
2940
                        echo $this->formSelect($element);
2941
                    ?>
16905 efrain 2942
	 	         </div>
2943
	 	     </div>
2944
 
2945
			<div class="row">
2946
	 	         <div class="col-12 mt-3">
2947
                 		<?php
2948
                        $element = $form->get('background');
2949
                        $element->setAttributes(['class' => 'form-control']);
2950
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2951
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2952
                        echo $this->formLabel($element);
2953
                        echo $this->formFile($element);
2954
                        ?>
2955
 
2956
	 	         </div>
2957
	 	     </div>
2958
	 	</div>
2959
	 	<div class="card-footer text-right">
2960
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2961
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2962
	 	</div>
2963
	 	<?php echo $this->form()->closeTag($form); ?>
2964
	</div>
2965
</div>
1 www 2966
 
16905 efrain 2967
 
2968
 
1 www 2969
 
2970
 
2971
 
2972
<!-- The Modal -->
16906 efrain 2973
<div class="modal" id="modal-play-video-box" >
1 www 2974
	<div class="modal-dialog ">
2975
    	<div class="modal-content">
2976
 
2977
            <!-- Modal Header -->
2978
      		<div class="modal-header">
16845 efrain 2979
        		<h6 class="modal-title">LABEL_PLAY_VIDEO</h6>
16822 efrain 2980
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 2981
      		</div>
2982
 
2983
            <!-- Modal body -->
2984
            <div class="modal-body">
2985
				<video src=""  style="width: 300px; height: auto" controls preload="false" autoplay="false"  poster="" id="microlearning-play-video"></video>
2986
      		</div>
2987
 
2988
            <!-- Modal footer -->
16891 efrain 2989
      		<div class="modal-footer text-right">
16822 efrain 2990
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 2991
          	</div>
2992
         </div>
2993
	</div>
2994
</div>
2995
 
2996
 
2997
 
2998
 
2999
 
3000
<!-- The Modal -->
16906 efrain 3001
<div class="modal" id="modal-play-audio-box" >
1 www 3002
	<div class="modal-dialog ">
3003
    	<div class="modal-content">
3004
 
3005
            <!-- Modal Header -->
3006
      		<div class="modal-header">
16845 efrain 3007
        		<h6 class="modal-title">LABEL_PLAY_AUDIO</h6>
16822 efrain 3008
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3009
      		</div>
3010
 
3011
            <!-- Modal body -->
3012
            <div class="modal-body">
3013
				<audio src="" controls autoplay="false"  id="microlearning-play-audio" >
3014
                  Your browser does not support the <code>audio</code> element.
3015
                </audio>
3016
      		</div>
3017
 
3018
            <!-- Modal footer -->
16891 efrain 3019
      		<div class="modal-footer text-right">
16822 efrain 3020
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3021
          	</div>
3022
         </div>
3023
	</div>
3024
</div>
3025
 
3026
 
3027
<!-- The Modal -->
16906 efrain 3028
<div class="modal" id="modal-view-image-box">
1 www 3029
	<div class="modal-dialog ">
3030
    	<div class="modal-content">
3031
 
3032
            <!-- Modal Header -->
3033
      		<div class="modal-header">
16845 efrain 3034
        		<h6 class="modal-title">LABEL_IMAGE</h6>
16822 efrain 3035
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3036
      		</div>
3037
 
3038
            <!-- Modal body -->
3039
            <div class="modal-body text-center">
3040
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-view" />
3041
      		</div>
3042
 
3043
            <!-- Modal footer -->
16891 efrain 3044
      		<div class="modal-footer text-right">
16822 efrain 3045
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3046
          	</div>
3047
         </div>
3048
	</div>
3049
</div>
3050
 
3051
 
3052
<!-- The Modal -->
16906 efrain 3053
<div class="modal" id="modal-view-document-box">
1 www 3054
	<div class="modal-dialog ">
3055
    	<div class="modal-content">
3056
 
3057
            <!-- Modal Header -->
3058
      		<div class="modal-header">
16845 efrain 3059
        		<h6 class="modal-title">LABEL_DOCUMENT</h6>
16822 efrain 3060
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3061
      		</div>
3062
 
3063
            <!-- Modal body -->
3064
            <div class="modal-body text-center">
17137 stevensc 3065
            	<iframe id="document-view" style="width: 450px; height: 300px; overflow: auto">
1 www 3066
 
3067
            	</iframe>
3068
       	</div>
3069
 
3070
            <!-- Modal footer -->
16891 efrain 3071
      		<div class="modal-footer text-right">
16822 efrain 3072
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3073
          	</div>
3074
         </div>
3075
	</div>
3076
</div>
3077
 
3078
 
3079
<!-- The Modal -->
16906 efrain 3080
<div class="modal" id="modal-view-text-box">
1 www 3081
	<div class="modal-dialog modal-xl">
3082
    	<div class="modal-content">
3083
 
3084
            <!-- Modal Header -->
3085
      		<div class="modal-header">
16845 efrain 3086
        		<h6 class="modal-title">LABEL_TEXT</h6>
16822 efrain 3087
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3088
      		</div>
3089
 
3090
            <!-- Modal body -->
3091
            <div class="modal-body" >
17137 stevensc 3092
            	<div id="document-text" style="width: 100%; height: 300px; overflow: auto;">
1 www 3093
 
3094
 
3095
            	</div>
3096
 
3097
       	</div>
3098
 
3099
            <!-- Modal footer -->
16891 efrain 3100
      		<div class="modal-footer text-right">
16822 efrain 3101
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3102
          	</div>
3103
         </div>
3104
	</div>
3105
</div>
3106
 
3107
 
3108
 
3109
 
3110
 
3111
 
3112