diff --git a/actions.php b/actions.php index fff1d8993..cca727e2a 100755 --- a/actions.php +++ b/actions.php @@ -318,7 +318,10 @@ elseif (post('op') == 'send-email') { // Inclusione di eventuale plugin personalizzato if (!empty($structure['script'])) { - include $structure->getEditFile(); + $path = $structure->getEditFile(); + if (!empty($path)) { + include $path; + } $database->commitTransaction(); diff --git a/editor.php b/editor.php index c6808bbc8..bb2708334 100755 --- a/editor.php +++ b/editor.php @@ -273,7 +273,10 @@ if (empty($record) || !$has_access) {
'; - include $structure->getEditFile(); + $path = $structure->getEditFile(); + if (!empty($path)) { + include $path; + } echo '
diff --git a/include/manager.php b/include/manager.php index b44fd87eb..39f49d551 100755 --- a/include/manager.php +++ b/include/manager.php @@ -31,7 +31,10 @@ if (!empty($id_plugin)) { if (!empty($id_plugin)) { // Inclusione di eventuale plugin personalizzato if (!empty($structure['script'])) { - include $structure->getEditFile(); + $path = $structure->getEditFile(); + if (!empty($path)) { + include $path; + } return; } @@ -234,7 +237,10 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') { * Inclusione modulo personalizzato */ elseif ($type == 'custom') { - include $structure->getEditFile(); + $path = $structure->getEditFile(); + if (!empty($path)) { + include $path; + } } // Caricamento file aggiuntivo su elenco record diff --git a/mail.php b/mail.php index 1864d94cb..3e6d3fe54 100755 --- a/mail.php +++ b/mail.php @@ -82,7 +82,7 @@ echo ' '.tr('Destinatari').'
- {[ "type": "email", "name": "destinatari[0]", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungi_destinatario();\'", "class": "destinatari", "required": 1 ]} + {[ "type": "email", "name": "destinatari[0]", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]}
@@ -136,7 +136,7 @@ echo '
- +
'; @@ -144,7 +144,7 @@ echo ' echo ' '; @@ -161,18 +161,10 @@ echo ' emails = JSON.parse(response); $(".destinatari").each(function(){ - $(this).autocomplete({ - source: emails, - minLength: 0, - close: function(){ - aggiungi_destinatario(); - } - }).focus(function() { - $(this).autocomplete("search", $(this).val()); - }); + addAutoComplete(this); }); - aggiungi_destinatario(); + aggiungiDestinatario(); });'; } @@ -180,13 +172,25 @@ echo ' }); - function send() { + function inviaEmail() { if($("#email-form").parsley().validate() && confirm("Inviare e-mail?")) { $("#email-form").submit(); } } - function aggiungi_destinatario() { + function addAutoComplete(input){ + $(input).autocomplete({ + source: emails, + minLength: 0, + close: function() { + aggiungiDestinatario(); + }, + }).focus(function() { + $(this).autocomplete("search", $(this).val()); + }); + } + + function aggiungiDestinatario() { var last = $("#lista-destinatari input").last(); if (last.val()) { @@ -195,7 +199,7 @@ echo ' aggiungiContenuto("#lista-destinatari", "#template-destinatario", {"-id-": $("#lista-destinatari > div").length}); $(".destinatari").each(function(){ - $(this).autocomplete({source: emails}); + addAutoComplete(this); }); restart_inputs();