From b0b9a5123ffd36a245ffda5f6c287e8f0f213aca Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 16 May 2018 11:03:58 +0200 Subject: [PATCH] Ricarico via ajax lista allegati --- src/HTMLBuilder/Manager/FileManager.php | 32 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/HTMLBuilder/Manager/FileManager.php b/src/HTMLBuilder/Manager/FileManager.php index 27a61f705..086a7081a 100644 --- a/src/HTMLBuilder/Manager/FileManager.php +++ b/src/HTMLBuilder/Manager/FileManager.php @@ -1,6 +1,12 @@ '; +$result .= ' +
+ '; if (!empty($options['showpanel'])) { $result .= ' @@ -117,12 +125,17 @@ class FileManager implements ManagerInterface dataType : "html", data: form_data, success: function(data) { - + btn.html(prev_html); - btn.prop("disabled", false); - - location.href = globals.rootdir + "/editor.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '').'"; - }, + btn.prop("disabled", false);'; + + if (($options['ajax'])) { + $result .= '$("#attachments_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'").load( globals.rootdir + "/src/HTMLBuilder/Manager/FileManager.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '&id_plugin='.$options['id_plugin'] : '').((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '').'&ajax=true" );'; + }else{ + $result .= 'location.href = globals.rootdir + "/editor.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '').'";'; + } + + $result .= '}, error: function(data) { alert(data); } @@ -133,9 +146,10 @@ class FileManager implements ManagerInterface if (!empty($options['showpanel'])) { $result .= '
+ '; } return $result; } -} +} \ No newline at end of file