From 0ecf1b931f7476d4ab13af52add2f4ffbcd06043 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Mon, 9 Jul 2018 11:29:37 +0200 Subject: [PATCH] Bugfix upload --- src/HTMLBuilder/Manager/FileManager.php | 15 +++++---------- src/Uploads.php | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/HTMLBuilder/Manager/FileManager.php b/src/HTMLBuilder/Manager/FileManager.php index 018113fba..3bd45b2ca 100644 --- a/src/HTMLBuilder/Manager/FileManager.php +++ b/src/HTMLBuilder/Manager/FileManager.php @@ -27,12 +27,7 @@ class FileManager implements ManagerInterface $attachment_id = 'attachments_'.$options['id_module'].'-'.$options['id_plugin']; // Cartella delle anteprime - if (!empty($options['id_plugin'])) { - $directory = '/plugins/'.\Plugins::get($options['id_plugin'])['directory']; - } else { - $directory = \Modules::get($options['id_module'])['directory']; - } - $directory = basename($directory); + $directory = \Uploads::getUploadDirectory($options['id_module'], $options['id_plugin']); $dbo = \Database::getConnection(); @@ -83,8 +78,8 @@ class FileManager implements ManagerInterface $result .= ' - - '.$r['nome'].' + + '.$r['nome'].$directory.' '.\Translator::timestampToLocale($r['created_at']).' @@ -102,10 +97,10 @@ class FileManager implements ManagerInterface if ($extension == 'pdf') { $result .= ' - '; + '; } else { $result .= ' - '; + '; } $result .= ' diff --git a/src/Uploads.php b/src/Uploads.php index f8816dc90..e50af6224 100644 --- a/src/Uploads.php +++ b/src/Uploads.php @@ -128,7 +128,7 @@ class Uploads $info = Plugins::get($id_plugin); if (!empty($info['script'])) { - $directory = self::fileInfo($info['script'])['name']; + $directory = self::fileInfo($info['script'])['filename']; } else { $directory = $info['directory']; }