Proyectos de Subversion LeadersLinked - Backend

Rev

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