Fix caricamento sia da upload che tramite copia-incolla

This commit is contained in:
loviuz 2022-10-27 19:05:35 +02:00
parent 73cc05be2a
commit 512e04ef45
1 changed files with 22 additions and 2 deletions

View File

@ -80,6 +80,12 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
'id_record' => $id_record,
]);
// Upload da form
if (!empty($funcNum) ){
echo '
<link rel="stylesheet" type="text/css" href="'.$baseurl.'/assets/dist/css/app.min.css" />
<script src="'.$baseurl.'/assets/dist/js/app.min.js"></script>';
}
// Creazione file fisico
if (!empty($upload)) {
@ -94,7 +100,21 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
'url' => $upload->filepath
];
echo json_encode($response);
// Upload da form
if (!empty($funcNum) ){
echo '
<script type="text/javascript">
$(document).ready(function() {
window.parent.toastr.success("'.tr('Caricamento riuscito').'");
window.parent.CKEDITOR.tools.callFunction('.$funcNum.', "'.$baseurl.'/'.$upload->filepath.'");
});
</script>';
}
// Copia-incolla
else {
echo json_encode($response);
}
} else {