mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Ricarico via ajax lista allegati
This commit is contained in:
parent
473fe4d8d0
commit
b0b9a5123f
@ -1,6 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace HTMLBuilder\Manager;
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
if ($_GET['ajax']) {
|
||||
echo '{( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'", "ajax": "true" )}';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.3
|
||||
@ -9,13 +15,15 @@ class FileManager implements ManagerInterface
|
||||
{
|
||||
public function manage($options)
|
||||
{
|
||||
$options['showpanel'] = isset($options['showpanel']) ? $options['showpanel'] : true;
|
||||
$options['ajax'] = isset($options['ajax']) ? $options['ajax'] : false;
|
||||
$options['showpanel'] = isset($options['showpanel']) ? $options['showpanel'] : true;
|
||||
$options['label'] = isset($options['label']) ? $options['label'] : tr('Nuovo allegato').':';
|
||||
|
||||
$dbo = \Database::getConnection();
|
||||
|
||||
$result .= '
|
||||
<a name="attachments"></a>';
|
||||
$result .= '
|
||||
<div id="attachments_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'" >
|
||||
<a name="attachments_'.rand().'"></a>';
|
||||
|
||||
if (!empty($options['showpanel'])) {
|
||||
$result .= '
|
||||
@ -119,10 +127,15 @@ class FileManager implements ManagerInterface
|
||||
success: function(data) {
|
||||
|
||||
btn.html(prev_html);
|
||||
btn.prop("disabled", false);
|
||||
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'] : '').'";
|
||||
},
|
||||
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,6 +146,7 @@ class FileManager implements ManagerInterface
|
||||
if (!empty($options['showpanel'])) {
|
||||
$result .= '
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user