Proyectos de Subversion LeadersLinked - Backend

Rev

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