15046 |
stevensc |
1 |
<?php
|
1 |
www |
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
$routeAdd = $this->url('publications/posts/add');
|
|
|
9 |
$routeDatatable = $this->url('publications/posts');
|
|
|
10 |
$routeDashboard = $this->url('dashboard');
|
|
|
11 |
|
|
|
12 |
$allowAdd = $acl->isAllowed($roleName, 'publications/posts/add') ? 1 : 0;
|
|
|
13 |
$allowEdit = $acl->isAllowed($roleName, 'publications/posts/edit') ? 1 : 0;
|
|
|
14 |
$allowDelete = $acl->isAllowed($roleName, 'publications/posts/delete') ? 1 : 0;
|
|
|
15 |
|
15046 |
stevensc |
16 |
$typeURL = \LeadersLinked\Model\Page::TYPE_URL;
|
|
|
17 |
$typePAGE = \LeadersLinked\Model\Page::TYPE_PAGE;
|
1 |
www |
18 |
|
16822 |
efrain |
19 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
20 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
1 |
www |
21 |
|
16822 |
efrain |
22 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
1 |
www |
23 |
|
|
|
24 |
|
16822 |
efrain |
25 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
26 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
27 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
1 |
www |
28 |
|
16822 |
efrain |
29 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
30 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
1 |
www |
31 |
|
16822 |
efrain |
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
34 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
1 |
www |
36 |
|
16822 |
efrain |
37 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
38 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
1 |
www |
39 |
|
|
|
40 |
|
16843 |
efrain |
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
16822 |
efrain |
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
44 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
46 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
1 |
www |
47 |
|
16822 |
efrain |
48 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
49 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
50 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
1 |
www |
51 |
|
|
|
52 |
|
|
|
53 |
|
16822 |
efrain |
54 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
1 |
www |
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
16822 |
efrain |
60 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
|
|
|
61 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
|
|
|
62 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
|
1 |
www |
63 |
|
16927 |
efrain |
64 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
|
1 |
www |
65 |
|
16822 |
efrain |
66 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
|
|
|
67 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
|
|
|
68 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
|
1 |
www |
69 |
|
|
|
70 |
|
16822 |
efrain |
71 |
|
|
|
72 |
|
1 |
www |
73 |
$status_active = \LeadersLinked\Model\Post::STATUS_ACTIVE;
|
|
|
74 |
|
|
|
75 |
$this->inlineScript()->captureStart();
|
|
|
76 |
echo <<<JS
|
|
|
77 |
jQuery( document ).ready(function( $ ) {
|
|
|
78 |
$.validator.addMethod('requiredDescriptionAdd', function (value, element, param) {
|
|
|
79 |
CKEDITOR.instances.description_add.updateElement();
|
|
|
80 |
|
|
|
81 |
var value = CKEDITOR.instances.description_add.getData();
|
|
|
82 |
value = $.trim($.fn.stripHtml(value));
|
|
|
83 |
return value.length > 0;
|
|
|
84 |
}, 'ERROR_REQUIRED');
|
|
|
85 |
|
|
|
86 |
$.validator.addMethod('requiredDescriptionEdit', function (value, element, param) {
|
|
|
87 |
CKEDITOR.instances.description_edit.updateElement();
|
|
|
88 |
|
|
|
89 |
var value = CKEDITOR.instances.description_edit.getData();
|
|
|
90 |
value = $.trim($.fn.stripHtml(value));
|
|
|
91 |
return value.length > 0;
|
|
|
92 |
}, 'ERROR_REQUIRED');
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
$.validator.setDefaults({
|
|
|
96 |
debug: true,
|
|
|
97 |
highlight: function(element) {
|
|
|
98 |
$(element).addClass('is-invalid');
|
|
|
99 |
},
|
|
|
100 |
unhighlight: function(element) {
|
|
|
101 |
$(element).removeClass('is-invalid');
|
|
|
102 |
},
|
|
|
103 |
errorElement: 'span',
|
|
|
104 |
errorClass: 'error invalid-feedback',
|
|
|
105 |
errorPlacement: function(error, element) {
|
|
|
106 |
if(element.parent('.form-group').length) {
|
|
|
107 |
error.insertAfter(element);
|
|
|
108 |
} else if(element.parent('.toggle').length) {
|
|
|
109 |
error.insertAfter(element.parent().parent());
|
|
|
110 |
} else {
|
|
|
111 |
error.insertAfter(element.parent());
|
|
|
112 |
}
|
|
|
113 |
}
|
|
|
114 |
});
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
118 |
var field = $(fieldname);
|
|
|
119 |
if(field) {
|
|
|
120 |
$(field).addClass('is-invalid');
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
124 |
if(field.parent('.form-group').length) {
|
|
|
125 |
error.insertAfter(field);
|
|
|
126 |
} else if(field.parent('.toggle').length) {
|
|
|
127 |
error.insertAfter(field.parent().parent());
|
|
|
128 |
} else {
|
|
|
129 |
error.insertAfter(field.parent());
|
|
|
130 |
}
|
|
|
131 |
}
|
|
|
132 |
};
|
|
|
133 |
|
|
|
134 |
var allowEdit = $allowEdit;
|
|
|
135 |
var allowDelete = $allowDelete;
|
|
|
136 |
|
|
|
137 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
138 |
'processing': true,
|
|
|
139 |
'serverSide': true,
|
|
|
140 |
'searching': true,
|
|
|
141 |
'order': [[ 0, 'asc' ]],
|
|
|
142 |
'ordering': true,
|
|
|
143 |
'ordenable' : true,
|
|
|
144 |
'responsive': true,
|
|
|
145 |
'select' : false,
|
|
|
146 |
'paging': true,
|
|
|
147 |
'pagingType': 'simple_numbers',
|
|
|
148 |
'ajax': {
|
|
|
149 |
'url' : '$routeDatatable',
|
|
|
150 |
'type' : 'get',
|
|
|
151 |
'beforeSend': function (request) {
|
|
|
152 |
NProgress.start();
|
|
|
153 |
},
|
|
|
154 |
'dataFilter': function(response) {
|
|
|
155 |
var response = jQuery.parseJSON( response );
|
|
|
156 |
|
|
|
157 |
var json = {};
|
|
|
158 |
json.recordsTotal = 0;
|
|
|
159 |
json.recordsFiltered = 0;
|
|
|
160 |
json.data = [];
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
if(response.success) {
|
|
|
164 |
json.recordsTotal = response.data.total;
|
|
|
165 |
json.recordsFiltered = response.data.total;
|
|
|
166 |
json.data = response.data.items;
|
|
|
167 |
} else {
|
|
|
168 |
$.fn.showError(response.data)
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
return JSON.stringify( json );
|
|
|
172 |
}
|
|
|
173 |
},
|
|
|
174 |
'language' : {
|
|
|
175 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
176 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
177 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
178 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
179 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
180 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
181 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
182 |
'sInfoPostFix': '',
|
|
|
183 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
184 |
'sUrl': '',
|
|
|
185 |
'sInfoThousands': ',',
|
|
|
186 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
187 |
'oPaginate': {
|
|
|
188 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
189 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
190 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
191 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
192 |
},
|
|
|
193 |
'oAria': {
|
|
|
194 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
195 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
196 |
},
|
|
|
197 |
},
|
|
|
198 |
'drawCallback': function( settings ) {
|
|
|
199 |
NProgress.done();
|
16822 |
efrain |
200 |
|
1 |
www |
201 |
},
|
|
|
202 |
'aoColumns': [
|
|
|
203 |
{ 'mDataProp': 'title' },
|
|
|
204 |
{ 'mDataProp': 'date' },
|
|
|
205 |
{ 'mDataProp': 'active' },
|
|
|
206 |
{ 'mDataProp': 'actions' },
|
|
|
207 |
],
|
|
|
208 |
'columnDefs': [
|
|
|
209 |
{
|
|
|
210 |
'targets': 0,
|
|
|
211 |
'className' : 'text-vertical-middle',
|
|
|
212 |
'render' : function ( data, type, row ) {
|
|
|
213 |
var s = data ;
|
|
|
214 |
if(row['actions']['link_view'] ) {
|
16822 |
efrain |
215 |
s = s + '<br><button class="btn btn-light btn-view" data-href="' + row['actions']['link_view']+ '" data-toggle="tooltip" title="LABEL_POST"><i class="fa fa-external-link"></i></button> <br>';
|
1 |
www |
216 |
}
|
|
|
217 |
return s;
|
|
|
218 |
}
|
|
|
219 |
},
|
|
|
220 |
{
|
|
|
221 |
'targets': 1,
|
|
|
222 |
'className' : 'text-vertical-middle',
|
|
|
223 |
},
|
|
|
224 |
{
|
|
|
225 |
'targets': -2,
|
|
|
226 |
'orderable': false,
|
|
|
227 |
'className' : 'text-center',
|
|
|
228 |
'render' : function ( data, type, row ) {
|
|
|
229 |
|
16822 |
efrain |
230 |
checked = data == 'a' ? 'checked' : '';
|
|
|
231 |
return '<div class="form-check">' +
|
|
|
232 |
'<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
|
|
|
233 |
'<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
|
1 |
www |
234 |
}
|
|
|
235 |
},
|
|
|
236 |
{
|
|
|
237 |
'targets': -1,
|
|
|
238 |
'orderable': false,
|
|
|
239 |
'render' : function ( data, type, row ) {
|
|
|
240 |
s = '';
|
|
|
241 |
|
|
|
242 |
if(allowEdit && data['link_edit']) {
|
16906 |
efrain |
243 |
s = s + '<button class="btn btn-primary btn-sm btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button> ';
|
1 |
www |
244 |
}
|
|
|
245 |
if(allowDelete && data['link_delete']) {
|
|
|
246 |
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> ';
|
|
|
247 |
}
|
|
|
248 |
return s;
|
|
|
249 |
}
|
|
|
250 |
}
|
|
|
251 |
],
|
|
|
252 |
});
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
var validatorAdd = $('#form-add').validate({
|
|
|
256 |
debug: true,
|
|
|
257 |
onclick: false,
|
|
|
258 |
onkeyup: false,
|
|
|
259 |
ignore: [],
|
|
|
260 |
rules: {
|
|
|
261 |
'title': {
|
|
|
262 |
required: true,
|
|
|
263 |
maxlength: 128,
|
|
|
264 |
},
|
|
|
265 |
'description': {
|
|
|
266 |
requiredDescriptionAdd: true,
|
|
|
267 |
},
|
|
|
268 |
'url': {
|
|
|
269 |
description: false,
|
|
|
270 |
},
|
|
|
271 |
'status': {
|
9056 |
stevensc |
272 |
require: false,
|
1 |
www |
273 |
},
|
|
|
274 |
'date': {
|
|
|
275 |
required: true,
|
|
|
276 |
|
|
|
277 |
},
|
|
|
278 |
'image': {
|
|
|
279 |
required: true,
|
|
|
280 |
extension: 'jpg|jpeg|png',
|
|
|
281 |
accept: 'image/jpg,image/jpeg,image/png'
|
|
|
282 |
},
|
|
|
283 |
'file': {
|
|
|
284 |
required: true,
|
|
|
285 |
extension: 'jpg|jpeg|png|webm,mp4,webm|wav|mp3|pdf',
|
|
|
286 |
accept: 'image/jpg,image/jpeg,image/png,video/webm,video/mpeg,video/mp4,audio/wav, audio/mpeg, application/pdf'
|
|
|
287 |
},
|
|
|
288 |
},
|
|
|
289 |
submitHandler: function(form)
|
|
|
290 |
{
|
|
|
291 |
|
|
|
292 |
var formdata = false;
|
|
|
293 |
if (window.FormData){
|
|
|
294 |
formdata = new FormData(form); //form[0]);
|
|
|
295 |
}
|
|
|
296 |
|
15045 |
stevensc |
297 |
$('#modal-add .btn-primary').prop('disabled', true);
|
15046 |
stevensc |
298 |
|
1 |
www |
299 |
$.ajax({
|
|
|
300 |
'dataType' : 'json',
|
|
|
301 |
'accept' : 'application/json',
|
|
|
302 |
'method' : 'post',
|
|
|
303 |
'url' : '$routeAdd',
|
|
|
304 |
'data' : formdata,
|
|
|
305 |
'processData': false,
|
|
|
306 |
'contentType': false,
|
|
|
307 |
}).done(function(response) {
|
|
|
308 |
if(response['success']) {
|
|
|
309 |
$.fn.showSuccess(response['data']);
|
15046 |
stevensc |
310 |
$('#modal-add .btn-primary').prop('disabled', false);
|
1 |
www |
311 |
$('#modal-add').modal('hide');
|
|
|
312 |
|
|
|
313 |
gridTable.api().ajax.reload(null, false);
|
|
|
314 |
} else {
|
|
|
315 |
validatorAdd.resetForm();
|
15046 |
stevensc |
316 |
$('#modal-add .btn-primary').prop('disabled',false);
|
1 |
www |
317 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
318 |
$.fn.showError(response['data']);
|
|
|
319 |
} else {
|
|
|
320 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
321 |
$.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
|
|
|
322 |
});
|
|
|
323 |
}
|
|
|
324 |
}
|
|
|
325 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
326 |
$.fn.showError(textStatus);
|
|
|
327 |
}).always(function() {
|
|
|
328 |
NProgress.done();
|
|
|
329 |
});
|
|
|
330 |
return false;
|
|
|
331 |
},
|
|
|
332 |
invalidHandler: function(form, validator) {
|
|
|
333 |
|
|
|
334 |
}
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
});
|
|
|
338 |
|
|
|
339 |
var validatorEdit = $('#form-edit').validate({
|
|
|
340 |
debug: true,
|
|
|
341 |
onclick: false,
|
|
|
342 |
onkeyup: false,
|
|
|
343 |
ignore: [],
|
|
|
344 |
rules: {
|
|
|
345 |
'title': {
|
|
|
346 |
required: true,
|
|
|
347 |
maxlength: 128,
|
|
|
348 |
},
|
|
|
349 |
'description': {
|
|
|
350 |
requiredDescriptionEdit: true,
|
|
|
351 |
},
|
|
|
352 |
'url': {
|
|
|
353 |
description: false,
|
|
|
354 |
},
|
|
|
355 |
'status': {
|
9056 |
stevensc |
356 |
require: false,
|
1 |
www |
357 |
},
|
|
|
358 |
'date': {
|
|
|
359 |
required: true,
|
|
|
360 |
|
|
|
361 |
},
|
|
|
362 |
'image': {
|
|
|
363 |
required: false,
|
|
|
364 |
extension: 'jpg|jpeg|png',
|
|
|
365 |
accept: 'image/jpg,image/jpeg,image/png'
|
|
|
366 |
},
|
|
|
367 |
'file': {
|
|
|
368 |
required: false,
|
|
|
369 |
extension: 'jpg|jpeg|png|webm,mp4,webm|wav|mp3|pdf',
|
|
|
370 |
accept: 'image/jpg,image/jpeg,image/png,video/webm,video/mpeg,video/mp4,audio/wav, audio/mpeg, application/pdf'
|
|
|
371 |
},
|
|
|
372 |
},
|
|
|
373 |
submitHandler: function(form)
|
|
|
374 |
{
|
|
|
375 |
|
|
|
376 |
var formdata = false;
|
|
|
377 |
if (window.FormData){
|
|
|
378 |
formdata = new FormData(form); //form[0]);
|
|
|
379 |
}
|
|
|
380 |
|
|
|
381 |
$('input[type="submit"]').prop('disabled', true);
|
|
|
382 |
|
|
|
383 |
$.ajax({
|
|
|
384 |
'dataType' : 'json',
|
|
|
385 |
'accept' : 'application/json',
|
|
|
386 |
'method' : 'post',
|
|
|
387 |
'url' : $('#form-edit').attr('action'),
|
|
|
388 |
'data' : formdata,
|
|
|
389 |
'processData': false,
|
|
|
390 |
'contentType': false,
|
|
|
391 |
}).done(function(response) {
|
|
|
392 |
if(response['success']) {
|
|
|
393 |
$.fn.showSuccess(response['data']);
|
|
|
394 |
$('#modal-edit').modal('hide');
|
|
|
395 |
|
|
|
396 |
gridTable.api().ajax.reload(null, false);
|
|
|
397 |
} else {
|
|
|
398 |
validatorAdd.resetForm();
|
|
|
399 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
400 |
$.fn.showError(response['data']);
|
|
|
401 |
} else {
|
|
|
402 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
403 |
$.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
|
|
|
404 |
});
|
|
|
405 |
}
|
|
|
406 |
}
|
|
|
407 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
408 |
$.fn.showError(textStatus);
|
|
|
409 |
}).always(function() {
|
|
|
410 |
NProgress.done();
|
|
|
411 |
});
|
|
|
412 |
return false;
|
|
|
413 |
},
|
|
|
414 |
invalidHandler: function(form, validator) {
|
|
|
415 |
|
|
|
416 |
}
|
|
|
417 |
|
|
|
418 |
|
|
|
419 |
});
|
|
|
420 |
|
|
|
421 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
422 |
e.preventDefault();
|
|
|
423 |
|
|
|
424 |
$('#form-add #title').val('');
|
|
|
425 |
$('#form-add #date').val('');
|
|
|
426 |
$('#form-add #url').val('');
|
|
|
427 |
$('#form-add #status').bootstrapToggle('on');
|
|
|
428 |
|
|
|
429 |
$('#form-add #file').fileinput('reset');
|
|
|
430 |
$('#form-add #file').val('');
|
|
|
431 |
|
|
|
432 |
$('#form-add #image').fileinput('reset');
|
|
|
433 |
$('#form-add #image').val('');
|
|
|
434 |
|
|
|
435 |
CKEDITOR.instances.description_add.setData('');
|
|
|
436 |
validatorAdd.resetForm();
|
|
|
437 |
|
|
|
438 |
$('#modal-add').modal('show');
|
|
|
439 |
});
|
|
|
440 |
|
|
|
441 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
442 |
e.preventDefault();
|
|
|
443 |
NProgress.start();
|
|
|
444 |
var action = $(this).data('href');
|
|
|
445 |
|
|
|
446 |
$.ajax({
|
|
|
447 |
'dataType' : 'json',
|
|
|
448 |
'accept' : 'application/json',
|
|
|
449 |
'method' : 'get',
|
|
|
450 |
'url' : action,
|
|
|
451 |
}).done(function(response) {
|
|
|
452 |
if(response['success']) {
|
|
|
453 |
|
|
|
454 |
$('#form-edit').attr('action', action);
|
|
|
455 |
$('#form-edit #title').val(response['data']['title']);
|
|
|
456 |
$('#form-edit #date').val(response['data']['date']);
|
|
|
457 |
$('#form-edit #url').val(response['data']['url']);
|
|
|
458 |
$('#form-edit #status').bootstrapToggle(response['data']['status'] == 'a' ? 'on' : 'off');
|
|
|
459 |
|
|
|
460 |
$('#form-edit #file').fileinput('reset');
|
|
|
461 |
$('#form-edit #file').val('');
|
|
|
462 |
|
|
|
463 |
$('#form-edit #image').fileinput('reset');
|
|
|
464 |
$('#form-edit #image').val('');
|
|
|
465 |
|
|
|
466 |
var description = $.trim(response['data']['description']);
|
|
|
467 |
CKEDITOR.instances.description_edit.setData(description.length > 0 ? description : '');
|
|
|
468 |
|
|
|
469 |
validatorEdit.resetForm();
|
|
|
470 |
|
|
|
471 |
$('#modal-edit').modal('show');
|
|
|
472 |
|
|
|
473 |
|
|
|
474 |
} else {
|
|
|
475 |
$.fn.showError(response['data']);
|
|
|
476 |
}
|
|
|
477 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
478 |
$.fn.showError(textStatus);
|
|
|
479 |
}).always(function() {
|
|
|
480 |
NProgress.done();
|
|
|
481 |
});
|
|
|
482 |
});
|
|
|
483 |
|
|
|
484 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
485 |
e.preventDefault();
|
|
|
486 |
gridTable.api().ajax.reload(null, false);
|
|
|
487 |
});
|
|
|
488 |
|
|
|
489 |
|
|
|
490 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
491 |
e.preventDefault();
|
|
|
492 |
$('#modal-add').modal('hide');
|
|
|
493 |
$('#modal-edit').modal('hide');
|
|
|
494 |
});
|
|
|
495 |
|
|
|
496 |
$('body').on('click', 'button.btn-view', function(e) {
|
|
|
497 |
e.preventDefault();
|
|
|
498 |
|
|
|
499 |
var href = $(this).data('href');
|
|
|
500 |
window.open(href, '_blank');
|
|
|
501 |
|
|
|
502 |
});
|
|
|
503 |
|
16822 |
efrain |
504 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
505 |
e.preventDefault();
|
|
|
506 |
var action = $(this).data('href');
|
|
|
507 |
|
|
|
508 |
|
|
|
509 |
swal.fire({
|
|
|
510 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
511 |
icon: 'question',
|
|
|
512 |
cancelButtonText: 'LABEL_NO',
|
|
|
513 |
showCancelButton: true,
|
|
|
514 |
confirmButtonText: 'LABEL_YES'
|
|
|
515 |
}).then((result) => {
|
|
|
516 |
if (result.isConfirmed) {
|
|
|
517 |
|
|
|
518 |
NProgress.start();
|
|
|
519 |
$.ajax({
|
|
|
520 |
'dataType' : 'json',
|
|
|
521 |
'accept' : 'application/json',
|
|
|
522 |
'method' : 'post',
|
|
|
523 |
'url' : action,
|
|
|
524 |
}).done(function(response) {
|
|
|
525 |
if(response['success']) {
|
|
|
526 |
$.fn.showSuccess(response['data']);
|
|
|
527 |
gridTable.api().ajax.reload(null, false);
|
|
|
528 |
} else {
|
|
|
529 |
$.fn.showError(response['data']);
|
|
|
530 |
}
|
|
|
531 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
532 |
$.fn.showError(textStatus);
|
|
|
533 |
}).always(function() {
|
|
|
534 |
NProgress.done();
|
|
|
535 |
});
|
|
|
536 |
}
|
|
|
537 |
});
|
|
|
538 |
});
|
1 |
www |
539 |
|
|
|
540 |
|
|
|
541 |
$('#form-add #date').datetimepicker({
|
|
|
542 |
locale: 'es',
|
|
|
543 |
format: 'DD/MM/YYYY'
|
|
|
544 |
});
|
|
|
545 |
|
|
|
546 |
$('#form-edit #date').datetimepicker({
|
|
|
547 |
locale: 'es',
|
|
|
548 |
format: 'DD/MM/YYYY'
|
|
|
549 |
});
|
|
|
550 |
|
|
|
551 |
$('#form-add #image').fileinput({
|
|
|
552 |
theme: 'fa',
|
|
|
553 |
language: 'es',
|
|
|
554 |
showUpload: false,
|
|
|
555 |
dropZoneEnabled: false,
|
|
|
556 |
maxFileCount: 1,
|
|
|
557 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
558 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
|
|
|
559 |
});
|
|
|
560 |
|
|
|
561 |
|
|
|
562 |
$('#form-edit #image').fileinput({
|
|
|
563 |
theme: 'fa',
|
|
|
564 |
language: 'es',
|
|
|
565 |
showUpload: false,
|
|
|
566 |
dropZoneEnabled: false,
|
|
|
567 |
maxFileCount: 1,
|
|
|
568 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
569 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
|
|
|
570 |
});
|
|
|
571 |
|
|
|
572 |
$('#form-add #file').fileinput({
|
|
|
573 |
theme: 'fa',
|
|
|
574 |
language: 'es',
|
|
|
575 |
showUpload: false,
|
|
|
576 |
dropZoneEnabled: false,
|
|
|
577 |
maxFileCount: 1,
|
|
|
578 |
allowedFileExtensions: ['webm','mp4','mpeg','jpg','jpeg','png', 'wav', 'mp3', 'pdf'],
|
|
|
579 |
});
|
|
|
580 |
|
|
|
581 |
$('#form-edit #file').fileinput({
|
|
|
582 |
theme: 'fa',
|
|
|
583 |
language: 'es',
|
|
|
584 |
showUpload: false,
|
|
|
585 |
dropZoneEnabled: false,
|
|
|
586 |
maxFileCount: 1,
|
|
|
587 |
allowedFileExtensions: ['webm','mp4','mpeg','jpg','jpeg','png', 'wav', 'mp3', 'pdf'],
|
|
|
588 |
});
|
|
|
589 |
|
|
|
590 |
|
|
|
591 |
$('#form-add #status').bootstrapToggle({'on' : 'LABEL_ACTIVE', 'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
|
|
|
592 |
$('#form-edit #status').bootstrapToggle({'on' : 'LABEL_ACTIVE', 'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
|
8767 |
stevensc |
593 |
CKEDITOR.replace( 'description_add', {
|
|
|
594 |
toolbar: [
|
|
|
595 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
596 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
597 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
598 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
599 |
'/',
|
|
|
600 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
601 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
602 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
603 |
],
|
|
|
604 |
removePlugins: 'elementspath,Anchor',
|
|
|
605 |
heigth: 100
|
|
|
606 |
});
|
|
|
607 |
CKEDITOR.replace( 'description_edit', {
|
|
|
608 |
toolbar: [
|
|
|
609 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
610 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
611 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
612 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
613 |
'/',
|
|
|
614 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
615 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
616 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
617 |
],
|
|
|
618 |
removePlugins: 'elementspath,Anchor',
|
|
|
619 |
heigth: 100
|
|
|
620 |
});
|
1 |
www |
621 |
});
|
|
|
622 |
JS;
|
|
|
623 |
$this->inlineScript()->captureEnd();
|
|
|
624 |
?>
|
15046 |
stevensc |
625 |
|
|
|
626 |
|
|
|
627 |
|
16841 |
efrain |
628 |
<div class="container">
|
|
|
629 |
<div class="card" id="">
|
|
|
630 |
|
|
|
631 |
<div class="card-body">
|
|
|
632 |
<h6 class="card-title">LABEL_POSTS</h6>
|
|
|
633 |
<div class="row">
|
|
|
634 |
<div class="col-12 mt-3">
|
16845 |
efrain |
635 |
<table id="gridTable" class="table table-bordered">
|
16841 |
efrain |
636 |
<thead>
|
|
|
637 |
<tr>
|
|
|
638 |
<th>LABEL_TITLE</th>
|
|
|
639 |
<th>LABEL_DATE</th>
|
|
|
640 |
<th>LABEL_ACTIVE</th>
|
|
|
641 |
<th>LABEL_ACTIONS</th>
|
|
|
642 |
</tr>
|
|
|
643 |
</thead>
|
|
|
644 |
<tbody>
|
|
|
645 |
</tbody>
|
|
|
646 |
</table>
|
|
|
647 |
</div>
|
|
|
648 |
</div>
|
|
|
649 |
</div>
|
|
|
650 |
<div class="card-footer text-right">
|
|
|
651 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
|
|
|
652 |
<?php if ($allowAdd) : ?>
|
|
|
653 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
654 |
<?php endif; ?>
|
|
|
655 |
</div>
|
|
|
656 |
</div>
|
|
|
657 |
</div>
|
1 |
www |
658 |
|
|
|
659 |
|
16841 |
efrain |
660 |
|
1 |
www |
661 |
<!-- The Modal -->
|
|
|
662 |
<div class="modal" id="modal-add">
|
15046 |
stevensc |
663 |
<div class="modal-dialog modal-xl">
|
|
|
664 |
<div class="modal-content">
|
1 |
www |
665 |
|
|
|
666 |
<!-- Modal Header -->
|
15046 |
stevensc |
667 |
<div class="modal-header">
|
16845 |
efrain |
668 |
<h6 class="modal-title">LABEL_ADD</h6>
|
16822 |
efrain |
669 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
15046 |
stevensc |
670 |
</div>
|
1 |
www |
671 |
|
15046 |
stevensc |
672 |
<?php
|
|
|
673 |
$form = $this->formAdd;
|
|
|
674 |
$form->setAttributes([
|
|
|
675 |
'method' => 'post',
|
|
|
676 |
'name' => 'form-add',
|
|
|
677 |
'id' => 'form-add'
|
|
|
678 |
]);
|
1 |
www |
679 |
|
15046 |
stevensc |
680 |
$form->prepare();
|
|
|
681 |
echo $this->form()->openTag($form);
|
|
|
682 |
?>
|
16841 |
efrain |
683 |
<div class="modal-body">
|
|
|
684 |
|
|
|
685 |
<div class="row">
|
|
|
686 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
687 |
<?php
|
|
|
688 |
$element = $form->get('date');
|
|
|
689 |
$element->setOptions(['label' => 'LABEL_DATE']);
|
|
|
690 |
$element->setAttributes(['class' => 'form-control']);
|
1 |
www |
691 |
|
15046 |
stevensc |
692 |
echo $this->formLabel($element);
|
|
|
693 |
echo $this->formText($element);
|
|
|
694 |
?>
|
16841 |
efrain |
695 |
</div>
|
|
|
696 |
</div>
|
|
|
697 |
<div class="row">
|
|
|
698 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
699 |
<?php
|
|
|
700 |
$element = $form->get('title');
|
|
|
701 |
$element->setOptions(['label' => 'LABEL_TITLE']);
|
|
|
702 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
703 |
|
|
|
704 |
echo $this->formLabel($element);
|
|
|
705 |
echo $this->formText($element);
|
|
|
706 |
?>
|
16841 |
efrain |
707 |
</div>
|
|
|
708 |
</div>
|
|
|
709 |
<div class="row">
|
|
|
710 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
711 |
<?php
|
|
|
712 |
$element = $form->get('description');
|
|
|
713 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
714 |
$element->setAttributes(['id' => 'description_add', 'class' => 'form-control']);
|
|
|
715 |
|
|
|
716 |
echo $this->formLabel($element);
|
|
|
717 |
echo $this->formTextArea($element);
|
|
|
718 |
?>
|
16841 |
efrain |
719 |
</div>
|
|
|
720 |
</div>
|
|
|
721 |
<div class="row">
|
|
|
722 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
723 |
<?php
|
|
|
724 |
$element = $form->get('url');
|
|
|
725 |
$element->setOptions(['label' => 'LABEL_URL']);
|
|
|
726 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
727 |
|
|
|
728 |
echo $this->formLabel($element);
|
|
|
729 |
echo $this->formText($element);
|
|
|
730 |
?>
|
16841 |
efrain |
731 |
</div>
|
|
|
732 |
</div>
|
|
|
733 |
<div class="row">
|
|
|
734 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
735 |
<?php
|
|
|
736 |
$element = $form->get('status');
|
|
|
737 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
738 |
echo $this->formCheckbox($element);
|
|
|
739 |
?>
|
16841 |
efrain |
740 |
</div>
|
|
|
741 |
</div>
|
|
|
742 |
<div class="row">
|
|
|
743 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
744 |
|
|
|
745 |
<?php
|
|
|
746 |
$element = $form->get('image');
|
|
|
747 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
748 |
$element->setOptions(['label' => 'LABEL_IMAGE']);
|
|
|
749 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
750 |
echo $this->formLabel($element);
|
|
|
751 |
?>
|
|
|
752 |
<div class="file-loading">
|
|
|
753 |
<?php echo $this->formFile($element); ?>
|
|
|
754 |
</div>
|
|
|
755 |
|
16841 |
efrain |
756 |
</div>
|
|
|
757 |
</div>
|
|
|
758 |
<div class="row">
|
|
|
759 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
760 |
|
|
|
761 |
<?php
|
|
|
762 |
$element = $form->get('file');
|
|
|
763 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
764 |
$element->setOptions(['label' => 'LABEL_FILE']);
|
|
|
765 |
$element->setAttributes(['accept' => 'video/webm,video/mp4,video/mpeg,image/jpg,image/jpeg,image/png,audio/wav,audio/mpeg,application/pdf']);
|
|
|
766 |
echo $this->formLabel($element);
|
|
|
767 |
?>
|
|
|
768 |
<div class="file-loading">
|
|
|
769 |
<?php echo $this->formFile($element); ?>
|
|
|
770 |
</div>
|
|
|
771 |
|
16841 |
efrain |
772 |
</div>
|
|
|
773 |
</div>
|
15046 |
stevensc |
774 |
|
16841 |
efrain |
775 |
|
|
|
776 |
|
15046 |
stevensc |
777 |
</div>
|
|
|
778 |
|
1 |
www |
779 |
<!-- Modal footer -->
|
16891 |
efrain |
780 |
<div class="modal-footer text-right">
|
16841 |
efrain |
781 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
782 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
15046 |
stevensc |
783 |
</div>
|
16841 |
efrain |
784 |
<?php echo $this->form()->closeTag($form); ?>
|
1 |
www |
785 |
|
15046 |
stevensc |
786 |
</div>
|
|
|
787 |
</div>
|
|
|
788 |
</div>
|
1 |
www |
789 |
|
|
|
790 |
|
15046 |
stevensc |
791 |
|
1 |
www |
792 |
<!-- The Modal -->
|
|
|
793 |
<div class="modal" id="modal-edit">
|
15046 |
stevensc |
794 |
<div class="modal-dialog modal-xl">
|
|
|
795 |
<div class="modal-content">
|
1 |
www |
796 |
|
|
|
797 |
<!-- Modal Header -->
|
15046 |
stevensc |
798 |
<div class="modal-header">
|
16845 |
efrain |
799 |
<h6 class="modal-title">LABEL_EDIT</h6>
|
16822 |
efrain |
800 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
15046 |
stevensc |
801 |
</div>
|
1 |
www |
802 |
|
15046 |
stevensc |
803 |
<?php
|
|
|
804 |
$form = $this->formEdit;
|
|
|
805 |
$form->setAttributes([
|
|
|
806 |
'method' => 'post',
|
|
|
807 |
'name' => 'form-edit',
|
|
|
808 |
'id' => 'form-edit'
|
|
|
809 |
]);
|
1 |
www |
810 |
|
15046 |
stevensc |
811 |
$form->prepare();
|
|
|
812 |
echo $this->form()->openTag($form);
|
|
|
813 |
?>
|
16841 |
efrain |
814 |
<div class="modal-body">
|
|
|
815 |
|
|
|
816 |
<div class="row">
|
|
|
817 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
818 |
<?php
|
|
|
819 |
$element = $form->get('date');
|
|
|
820 |
$element->setOptions(['label' => 'LABEL_DATE']);
|
|
|
821 |
$element->setAttributes(['class' => 'form-control']);
|
1 |
www |
822 |
|
15046 |
stevensc |
823 |
echo $this->formLabel($element);
|
|
|
824 |
echo $this->formText($element);
|
|
|
825 |
?>
|
16841 |
efrain |
826 |
</div>
|
|
|
827 |
</div>
|
|
|
828 |
<div class="row">
|
|
|
829 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
830 |
<?php
|
|
|
831 |
$element = $form->get('title');
|
|
|
832 |
$element->setOptions(['label' => 'LABEL_TITLE']);
|
|
|
833 |
$element->setAttributes(['class' => 'form-control']);
|
1 |
www |
834 |
|
15046 |
stevensc |
835 |
echo $this->formLabel($element);
|
|
|
836 |
echo $this->formText($element);
|
|
|
837 |
?>
|
16841 |
efrain |
838 |
</div>
|
|
|
839 |
</div>
|
|
|
840 |
<div class="row">
|
|
|
841 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
842 |
<?php
|
|
|
843 |
$element = $form->get('description');
|
|
|
844 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
845 |
$element->setAttributes(['id' => 'description_edit', 'class' => 'form-control']);
|
1 |
www |
846 |
|
15046 |
stevensc |
847 |
echo $this->formLabel($element);
|
|
|
848 |
echo $this->formTextArea($element);
|
|
|
849 |
?>
|
16841 |
efrain |
850 |
</div>
|
|
|
851 |
</div>
|
|
|
852 |
<div class="row">
|
|
|
853 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
854 |
<?php
|
|
|
855 |
$element = $form->get('url');
|
|
|
856 |
$element->setOptions(['label' => 'LABEL_URL']);
|
|
|
857 |
$element->setAttributes(['class' => 'form-control']);
|
1 |
www |
858 |
|
15046 |
stevensc |
859 |
echo $this->formLabel($element);
|
|
|
860 |
echo $this->formText($element);
|
|
|
861 |
?>
|
16841 |
efrain |
862 |
</div>
|
|
|
863 |
</div>
|
|
|
864 |
<div class="row">
|
|
|
865 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
866 |
<?php
|
|
|
867 |
$element = $form->get('status');
|
|
|
868 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
869 |
echo $this->formCheckbox($element);
|
|
|
870 |
?>
|
16841 |
efrain |
871 |
</div>
|
|
|
872 |
</div>
|
|
|
873 |
<div class="row">
|
|
|
874 |
<div class="col-12 mt-3">
|
1 |
www |
875 |
|
15046 |
stevensc |
876 |
<?php
|
|
|
877 |
$element = $form->get('image');
|
|
|
878 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
879 |
$element->setOptions(['label' => 'LABEL_IMAGE']);
|
|
|
880 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
881 |
echo $this->formLabel($element);
|
|
|
882 |
?>
|
|
|
883 |
<div class="file-loading">
|
|
|
884 |
<?php echo $this->formFile($element); ?>
|
|
|
885 |
</div>
|
|
|
886 |
|
16841 |
efrain |
887 |
</div>
|
|
|
888 |
</div>
|
|
|
889 |
<div class="row">
|
|
|
890 |
<div class="col-12 mt-3">
|
15046 |
stevensc |
891 |
|
|
|
892 |
<?php
|
|
|
893 |
$element = $form->get('file');
|
|
|
894 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
895 |
$element->setOptions(['label' => 'LABEL_FILE']);
|
|
|
896 |
$element->setAttributes(['accept' => 'video/webm,video/mp4,video/mpeg,image/jpg,image/jpeg,image/png,audio/wav,audio/mpeg,application/pdf']);
|
|
|
897 |
echo $this->formLabel($element);
|
|
|
898 |
?>
|
|
|
899 |
<div class="file-loading">
|
|
|
900 |
<?php echo $this->formFile($element); ?>
|
|
|
901 |
</div>
|
|
|
902 |
|
16841 |
efrain |
903 |
</div>
|
|
|
904 |
</div>
|
15046 |
stevensc |
905 |
|
16841 |
efrain |
906 |
|
15046 |
stevensc |
907 |
</div>
|
|
|
908 |
|
|
|
909 |
<!-- Modal footer -->
|
16891 |
efrain |
910 |
<div class="modal-footer text-right">
|
16841 |
efrain |
911 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
912 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
15046 |
stevensc |
913 |
</div>
|
16841 |
efrain |
914 |
<?php echo $this->form()->closeTag($form); ?>
|
15046 |
stevensc |
915 |
</div>
|
|
|
916 |
</div>
|
|
|
917 |
</div>
|