Proyectos de Subversion LeadersLinked - Backend

Rev

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