66 |
efrain |
1 |
<?php
|
17003 |
efrain |
2 |
use LeadersLinked\Model\MicrolearningQuiz;
|
66 |
efrain |
3 |
|
|
|
4 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
5 |
$currentUser = $this->currentUserHelper();
|
|
|
6 |
$roleName = $currentUser->getUserTypeId();
|
|
|
7 |
|
|
|
8 |
$params = [
|
|
|
9 |
'quiz_id' => $quiz_uuid,
|
|
|
10 |
];
|
|
|
11 |
|
|
|
12 |
$routeAdd = $this->url('microlearning/content/quizzes/questions/add', $params);
|
|
|
13 |
$routeDatatable = $this->url('microlearning/content/quizzes/questions', $params);
|
16992 |
efrain |
14 |
$routeRegresar = $this->url('microlearning/content/quizzes');
|
66 |
efrain |
15 |
|
16992 |
efrain |
16 |
|
66 |
efrain |
17 |
$allowAdd = $acl->isAllowed($roleName, 'microlearning/content/quizzes/questions/add') ? 1 : 0;
|
|
|
18 |
$allowEdit = $acl->isAllowed($roleName, 'microlearning/content/quizzes/questions/edit') ? 1 : 0;
|
|
|
19 |
$allowDelete = $acl->isAllowed($roleName, 'microlearning/content/quizzes/questions/delete') ? 1 : 0;
|
|
|
20 |
$allowAnswer = $acl->isAllowed($roleName, 'microlearning/content/quizzes/questions/answers') ? 1 : 0;
|
|
|
21 |
|
16822 |
efrain |
22 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
23 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
66 |
efrain |
24 |
|
16822 |
efrain |
25 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
26 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
66 |
efrain |
27 |
|
16822 |
efrain |
28 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
29 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
31 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
66 |
efrain |
32 |
|
|
|
33 |
|
16822 |
efrain |
34 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
66 |
efrain |
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
|
16822 |
efrain |
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
|
|
44 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
|
66 |
efrain |
45 |
|
|
|
46 |
|
|
|
47 |
|
16822 |
efrain |
48 |
|
|
|
49 |
|
|
|
50 |
|
16929 |
efrain |
51 |
|
|
|
52 |
|
|
|
53 |
|
66 |
efrain |
54 |
$this->inlineScript()->captureStart();
|
|
|
55 |
echo <<<JS
|
|
|
56 |
|
|
|
57 |
var allowAdd = $allowAdd;
|
|
|
58 |
var allowEdit = $allowEdit;
|
|
|
59 |
var allowDelete = $allowDelete;
|
|
|
60 |
var allowAnswer = $allowAnswer;
|
|
|
61 |
|
|
|
62 |
jQuery( document ).ready(function( $ ) {
|
|
|
63 |
|
|
|
64 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
65 |
'processing': true,
|
|
|
66 |
'serverSide': true,
|
|
|
67 |
'searching': true,
|
|
|
68 |
'order': [[ 0, 'asc' ]],
|
|
|
69 |
'ordering': true,
|
|
|
70 |
'ordenable' : true,
|
|
|
71 |
'responsive': true,
|
|
|
72 |
'select' : false,
|
|
|
73 |
'paging': true,
|
|
|
74 |
'pagingType': 'simple_numbers',
|
|
|
75 |
'ajax': {
|
|
|
76 |
'url' : '$routeDatatable',
|
|
|
77 |
'type' : 'get',
|
|
|
78 |
'beforeSend': function (request) {
|
|
|
79 |
NProgress.start();
|
|
|
80 |
},
|
|
|
81 |
'dataFilter': function(response) {
|
|
|
82 |
var response = jQuery.parseJSON( response );
|
|
|
83 |
|
|
|
84 |
var json = {};
|
|
|
85 |
json.recordsTotal = 0;
|
|
|
86 |
json.recordsFiltered = 0;
|
|
|
87 |
json.data = [];
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
if(response.success) {
|
|
|
91 |
json.recordsTotal = response.data.total;
|
|
|
92 |
json.recordsFiltered = response.data.total;
|
|
|
93 |
json.data = response.data.items;
|
|
|
94 |
} else {
|
|
|
95 |
$.fn.showError(response.data)
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
return JSON.stringify( json );
|
|
|
99 |
}
|
|
|
100 |
},
|
|
|
101 |
'language' : {
|
|
|
102 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
103 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
104 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
105 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
106 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
107 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
108 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
109 |
'sInfoPostFix': '',
|
|
|
110 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
111 |
'sUrl': '',
|
|
|
112 |
'sInfoThousands': ',',
|
|
|
113 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
114 |
'oPaginate': {
|
|
|
115 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
116 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
117 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
118 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
119 |
},
|
|
|
120 |
'oAria': {
|
|
|
121 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
122 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
123 |
},
|
|
|
124 |
},
|
|
|
125 |
'drawCallback': function( settings ) {
|
|
|
126 |
NProgress.done();
|
16822 |
efrain |
127 |
|
66 |
efrain |
128 |
},
|
|
|
129 |
'aoColumns': [
|
|
|
130 |
{ 'mDataProp': 'text' },
|
|
|
131 |
{ 'mDataProp': 'details' },
|
|
|
132 |
{ 'mDataProp': 'actions' },
|
|
|
133 |
],
|
|
|
134 |
'columnDefs': [
|
|
|
135 |
{
|
|
|
136 |
'targets': 0,
|
|
|
137 |
'className' : 'text-vertical-middle',
|
|
|
138 |
'render' : function ( data, type, row ) {
|
|
|
139 |
var s = data;
|
|
|
140 |
if(allowAnswer && row['actions']['link_answer'] ) {
|
16932 |
efrain |
141 |
s = s + '<br><button class="btn btn-info btn-sm btn-answer" data-href="' + row['actions']['link_answer']+ '" data-toggle="tooltip" title="LABEL_ANSWERS"><i class="fa fa-external-link-alt"></i> LABEL_ANSWERS </button';
|
66 |
efrain |
142 |
}
|
|
|
143 |
|
|
|
144 |
return s;
|
|
|
145 |
}
|
|
|
146 |
},
|
|
|
147 |
{
|
|
|
148 |
'targets': 1,
|
|
|
149 |
'orderable': false,
|
|
|
150 |
'render' : function ( data, type, row ) {
|
|
|
151 |
var s = 'LABEL_VERIFICATION : ' + row['details']['check'] + '<br>';
|
|
|
152 |
s = s + 'LABEL_POINTS : ' + row['details']['points'] + '<br>';
|
|
|
153 |
s = s + 'LABEL_TYPE : ' + row['details']['type'] + '<br>';
|
|
|
154 |
|
|
|
155 |
return s;
|
|
|
156 |
}
|
|
|
157 |
},
|
|
|
158 |
{
|
|
|
159 |
'targets': -1,
|
|
|
160 |
'orderable': false,
|
|
|
161 |
'render' : function ( data, type, row ) {
|
|
|
162 |
s = '';
|
|
|
163 |
|
|
|
164 |
if(allowEdit && data['link_edit'] ) {
|
16906 |
efrain |
165 |
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> LABEL_EDIT </button> ';
|
66 |
efrain |
166 |
}
|
|
|
167 |
if(allowDelete && data['link_delete'] ) {
|
|
|
168 |
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> LABEL_DELETE </button> ';
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
return s;
|
|
|
174 |
}
|
|
|
175 |
}
|
|
|
176 |
],
|
|
|
177 |
});
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
|
183 |
$.validator.setDefaults({
|
|
|
184 |
debug: true,
|
|
|
185 |
highlight: function(element) {
|
|
|
186 |
$(element).addClass('is-invalid');
|
|
|
187 |
},
|
|
|
188 |
unhighlight: function(element) {
|
|
|
189 |
$(element).removeClass('is-invalid');
|
|
|
190 |
},
|
|
|
191 |
errorElement: 'span',
|
|
|
192 |
errorClass: 'error invalid-feedback',
|
|
|
193 |
errorPlacement: function(error, element) {
|
|
|
194 |
if(element.parent('.btn-file').length) {
|
|
|
195 |
error.insertAfter(element.parent().parent());
|
|
|
196 |
} else if(element.parent('.toggle').length) {
|
|
|
197 |
error.insertAfter(element.parent().parent());
|
|
|
198 |
} else {
|
|
|
199 |
error.insertAfter(element.parent());
|
|
|
200 |
}
|
|
|
201 |
}
|
|
|
202 |
});
|
|
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
var validator = $('#form').validate({
|
|
|
207 |
debug: true,
|
|
|
208 |
onclick: false,
|
|
|
209 |
onkeyup: false,
|
|
|
210 |
ignore: [],
|
|
|
211 |
rules: {
|
|
|
212 |
'text': {
|
|
|
213 |
updateCkeditor:function() {
|
|
|
214 |
CKEDITOR.instances.text.updateElement();
|
|
|
215 |
},
|
|
|
216 |
required: true
|
|
|
217 |
},
|
|
|
218 |
'type' : {
|
|
|
219 |
required: true,
|
|
|
220 |
},
|
|
|
221 |
'points' : {
|
|
|
222 |
required: true,
|
|
|
223 |
digits: true,
|
|
|
224 |
min: 1,
|
|
|
225 |
max: 100
|
|
|
226 |
},
|
|
|
227 |
},
|
|
|
228 |
submitHandler: function(form)
|
|
|
229 |
{
|
|
|
230 |
$('input[type="submit"]').prop('disabled', true);
|
|
|
231 |
|
|
|
232 |
$.ajax({
|
|
|
233 |
'dataType' : 'json',
|
|
|
234 |
'accept' : 'application/json',
|
|
|
235 |
'method' : 'post',
|
|
|
236 |
'url' : $('#form').attr('action'),
|
|
|
237 |
'data' : $('#form').serialize(),
|
|
|
238 |
}).done(function(response) {
|
|
|
239 |
if(response['success']) {
|
|
|
240 |
$.fn.showSuccess(response['data']);
|
|
|
241 |
|
|
|
242 |
$('#modal-form').modal('hide');
|
|
|
243 |
gridTable.api().ajax.reload(null, false);
|
|
|
244 |
} else {
|
|
|
245 |
validator.resetForm();
|
|
|
246 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
247 |
$.fn.showError(response['data']);
|
|
|
248 |
} else {
|
|
|
249 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
250 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
251 |
});
|
|
|
252 |
}
|
|
|
253 |
}
|
|
|
254 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
255 |
$.fn.showError(textStatus);
|
|
|
256 |
}).always(function() {
|
|
|
257 |
NProgress.done();
|
|
|
258 |
});
|
|
|
259 |
return false;
|
|
|
260 |
},
|
|
|
261 |
invalidHandler: function(form, validator) {
|
|
|
262 |
|
|
|
263 |
}
|
|
|
264 |
});
|
|
|
265 |
|
16992 |
efrain |
266 |
$('body').on('click', 'button.btn-back', function(e) {
|
|
|
267 |
e.preventDefault();
|
|
|
268 |
|
|
|
269 |
window.location.href = '$routeRegresar';
|
|
|
270 |
|
|
|
271 |
});
|
|
|
272 |
|
16993 |
efrain |
273 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
274 |
e.preventDefault();
|
|
|
275 |
gridTable.api().ajax.reload(null, false);
|
|
|
276 |
});
|
|
|
277 |
|
66 |
efrain |
278 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
279 |
e.preventDefault();
|
|
|
280 |
|
16840 |
efrain |
281 |
|
66 |
efrain |
282 |
$('#form').attr('action', '$routeAdd');
|
|
|
283 |
$('#form #name').val('');
|
|
|
284 |
$('#form #type').val('');
|
|
|
285 |
$('#form #maxlength').val('');
|
|
|
286 |
$('#form #maxlength').parent().hide();
|
|
|
287 |
$('#form #points').val('');
|
|
|
288 |
|
|
|
289 |
|
|
|
290 |
CKEDITOR.instances['text'].setData('');
|
|
|
291 |
validator.resetForm();
|
|
|
292 |
|
|
|
293 |
$('#modal-form').modal('show');
|
|
|
294 |
return false;
|
|
|
295 |
});
|
|
|
296 |
|
|
|
297 |
$('#form #type').change(function(e) {
|
|
|
298 |
e.preventDefault();
|
|
|
299 |
|
|
|
300 |
var value = $(this).val();
|
|
|
301 |
if(value == 'sl' || value == 'ml') {
|
|
|
302 |
$('#form #maxlength').parent().show();
|
|
|
303 |
} else {
|
|
|
304 |
$('#form #maxlength').val('');
|
|
|
305 |
$('#form #maxlength').parent().hide();
|
|
|
306 |
}
|
|
|
307 |
|
|
|
308 |
});
|
|
|
309 |
|
|
|
310 |
$('body').on('click', 'button.btn-answer', function(e) {
|
|
|
311 |
e.preventDefault();
|
|
|
312 |
var action = $(this).data('href');
|
|
|
313 |
window.location.href = action;
|
|
|
314 |
});
|
|
|
315 |
|
|
|
316 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
317 |
e.preventDefault();
|
|
|
318 |
NProgress.start();
|
|
|
319 |
var action = $(this).data('href');
|
|
|
320 |
|
|
|
321 |
$.ajax({
|
|
|
322 |
'dataType' : 'json',
|
|
|
323 |
'accept' : 'application/json',
|
|
|
324 |
'method' : 'get',
|
|
|
325 |
'url' : action,
|
|
|
326 |
}).done(function(response) {
|
|
|
327 |
if(response['success']) {
|
|
|
328 |
|
16840 |
efrain |
329 |
|
66 |
efrain |
330 |
$('#form').attr('action', action);
|
|
|
331 |
$('#form #name').val(response['data']['name']);
|
|
|
332 |
$('#form #type').val(response['data']['type']);
|
|
|
333 |
$('#form #maxlength').val(response['data']['maxlength']);
|
|
|
334 |
|
|
|
335 |
if(response['data']['type'] == 'sl' || response['data']['type'] == 'ml') {
|
|
|
336 |
$('#form #maxlength').parent().show();
|
|
|
337 |
} else {
|
|
|
338 |
|
|
|
339 |
$('#form #maxlength').parent().hide();
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
$('#form #points').val(response['data']['points']);
|
|
|
343 |
|
|
|
344 |
CKEDITOR.instances['text'].setData(response['data']['text']);
|
|
|
345 |
validator.resetForm();
|
|
|
346 |
|
|
|
347 |
$('#modal-form').modal('show');
|
|
|
348 |
return false;
|
|
|
349 |
} else {
|
|
|
350 |
$.fn.showError(response['data']);
|
|
|
351 |
}
|
|
|
352 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
353 |
$.fn.showError(textStatus);
|
|
|
354 |
}).always(function() {
|
|
|
355 |
NProgress.done();
|
|
|
356 |
});
|
|
|
357 |
});
|
|
|
358 |
|
16822 |
efrain |
359 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
360 |
e.preventDefault();
|
|
|
361 |
var action = $(this).data('href');
|
66 |
efrain |
362 |
|
16822 |
efrain |
363 |
|
|
|
364 |
swal.fire({
|
|
|
365 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
366 |
icon: 'question',
|
|
|
367 |
cancelButtonText: 'LABEL_NO',
|
|
|
368 |
showCancelButton: true,
|
|
|
369 |
confirmButtonText: 'LABEL_YES'
|
|
|
370 |
}).then((result) => {
|
|
|
371 |
if (result.isConfirmed) {
|
|
|
372 |
|
|
|
373 |
NProgress.start();
|
|
|
374 |
$.ajax({
|
|
|
375 |
'dataType' : 'json',
|
|
|
376 |
'accept' : 'application/json',
|
|
|
377 |
'method' : 'post',
|
|
|
378 |
'url' : action,
|
|
|
379 |
}).done(function(response) {
|
|
|
380 |
if(response['success']) {
|
|
|
381 |
$.fn.showSuccess(response['data']);
|
|
|
382 |
gridTable.api().ajax.reload(null, false);
|
|
|
383 |
} else {
|
|
|
384 |
$.fn.showError(response['data']);
|
|
|
385 |
}
|
|
|
386 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
387 |
$.fn.showError(textStatus);
|
|
|
388 |
}).always(function() {
|
|
|
389 |
NProgress.done();
|
|
|
390 |
});
|
|
|
391 |
}
|
|
|
392 |
});
|
|
|
393 |
});
|
|
|
394 |
|
|
|
395 |
|
66 |
efrain |
396 |
$('#form #points').inputNumberFormat({decimal: 0});
|
|
|
397 |
|
8290 |
stevensc |
398 |
CKEDITOR.replace('text', {
|
|
|
399 |
toolbar: [
|
|
|
400 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
401 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
402 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
403 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
404 |
'/',
|
|
|
405 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
406 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
407 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
408 |
],
|
|
|
409 |
removePlugins: 'elementspath,Anchor',
|
|
|
410 |
heigth: 100
|
|
|
411 |
});
|
66 |
efrain |
412 |
|
|
|
413 |
});
|
|
|
414 |
JS;
|
|
|
415 |
$this->inlineScript()->captureEnd();
|
|
|
416 |
?>
|
|
|
417 |
|
16910 |
efrain |
418 |
<div class="container">
|
|
|
419 |
<div class="card" id="">
|
|
|
420 |
<div class="card-header">
|
|
|
421 |
<h6 class="card-title"><?php echo $quiz_name ?> - LABEL_QUESTIONS </h6>
|
|
|
422 |
</div>
|
|
|
423 |
<div class="card-body">
|
|
|
424 |
<div class="row">
|
|
|
425 |
<div class="col-12 mt-3">
|
|
|
426 |
|
|
|
427 |
<div class="card-body">
|
16845 |
efrain |
428 |
<table id="gridTable" class="table table-bordered">
|
66 |
efrain |
429 |
<thead>
|
|
|
430 |
<tr>
|
|
|
431 |
<th>LABEL_NAME</th>
|
|
|
432 |
<th>LABEL_DETAILS</th>
|
|
|
433 |
<th>LABEL_ACTIONS</th>
|
|
|
434 |
</tr>
|
|
|
435 |
</thead>
|
|
|
436 |
<tbody>
|
|
|
437 |
</tbody>
|
|
|
438 |
</table>
|
|
|
439 |
</div>
|
16910 |
efrain |
440 |
|
|
|
441 |
</div>
|
|
|
442 |
</div>
|
|
|
443 |
</div>
|
|
|
444 |
<div class="card-footer text-right">
|
16992 |
efrain |
445 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
66 |
efrain |
446 |
<?php if($allowAdd) : ?>
|
|
|
447 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
448 |
<?php endif; ?>
|
16992 |
efrain |
449 |
<button type="button" class="btn btn-primary btn-back"><i class="fa fa-undo"></i> LABEL_BACK </button>
|
16910 |
efrain |
450 |
</div>
|
|
|
451 |
</div>
|
|
|
452 |
</div>
|
66 |
efrain |
453 |
|
16910 |
efrain |
454 |
|
66 |
efrain |
455 |
|
16910 |
efrain |
456 |
|
|
|
457 |
|
66 |
efrain |
458 |
<div class="modal" tabindex="-1" role="dialog" id="modal-form">
|
|
|
459 |
<div class="modal-dialog modal-lg">
|
|
|
460 |
<div class="modal-content">
|
|
|
461 |
<?php
|
|
|
462 |
$form = $this->formCreateOrEdit;
|
|
|
463 |
$form->setAttributes([
|
|
|
464 |
'method' => 'post',
|
|
|
465 |
'name' => 'form',
|
|
|
466 |
'id' => 'form'
|
|
|
467 |
]);
|
|
|
468 |
$form->prepare();
|
|
|
469 |
echo $this->form()->openTag($form);
|
|
|
470 |
?>
|
|
|
471 |
<div class="modal-content">
|
|
|
472 |
<div class="modal-header">
|
16935 |
efrain |
473 |
<h6 class="modal-title" ><span id="form-title">LABEL_ADD</span></h6>
|
66 |
efrain |
474 |
</div>
|
|
|
475 |
<div class="modal-body">
|
16910 |
efrain |
476 |
<div class="row">
|
|
|
477 |
<div class="col-12 mt-3">
|
|
|
478 |
<?php
|
|
|
479 |
$element = $form->get('text');
|
|
|
480 |
$element->setAttributes(['id' => 'text', 'rows' => '2', 'placeholder' => '', 'class' => 'form-control']);
|
|
|
481 |
$element->setOptions(['label' => 'LABEL_TEXT']);
|
66 |
efrain |
482 |
echo $this->formLabel($element);
|
16910 |
efrain |
483 |
echo $this->formTextArea($element);
|
|
|
484 |
?>
|
|
|
485 |
</div>
|
|
|
486 |
</div>
|
|
|
487 |
<div class="row">
|
|
|
488 |
<div class="col-12 mt-3">
|
|
|
489 |
<?php
|
|
|
490 |
$element = $form->get('type');
|
|
|
491 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
492 |
$element->setOptions(['label' => 'LABEL_TYPE']);
|
|
|
493 |
echo $this->formLabel($element);
|
|
|
494 |
echo $this->formSelect($element);
|
|
|
495 |
?>
|
|
|
496 |
</div>
|
|
|
497 |
</div>
|
|
|
498 |
<div class="row">
|
|
|
499 |
<div class="col-12 mt-3">
|
|
|
500 |
<?php
|
|
|
501 |
$element = $form->get('maxlength');
|
|
|
502 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
503 |
$element->setOptions(['label' => 'LABEL_MAXLENGTH']);
|
|
|
504 |
echo $this->formLabel($element);
|
|
|
505 |
echo $this->formText($element);
|
|
|
506 |
?>
|
|
|
507 |
</div>
|
|
|
508 |
</div>
|
|
|
509 |
<div class="row">
|
|
|
510 |
<div class="col-12 mt-3">
|
|
|
511 |
<?php
|
|
|
512 |
$element = $form->get('points');
|
|
|
513 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
514 |
$element->setOptions(['label' => 'LABEL_POINTS']);
|
|
|
515 |
echo $this->formLabel($element);
|
|
|
516 |
echo $this->formText($element);
|
|
|
517 |
?>
|
|
|
518 |
</div>
|
|
|
519 |
</div>
|
66 |
efrain |
520 |
</div>
|
|
|
521 |
|
16891 |
efrain |
522 |
<div class="modal-footer text-right">
|
66 |
efrain |
523 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
16822 |
efrain |
524 |
<button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
|
66 |
efrain |
525 |
</div>
|
|
|
526 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
527 |
</div>
|
|
|
528 |
</div>
|
|
|
529 |
</div>
|
|
|
530 |
</div>
|