mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/14168] Use attachment manager instead of separate classes
PHPBB3-14168
This commit is contained in:
@@ -39,8 +39,8 @@ class acp_attachments
|
||||
/** @var \phpbb\filesystem\filesystem_interface */
|
||||
protected $filesystem;
|
||||
|
||||
/** @var \phpbb\attachment\delete */
|
||||
protected $attachment_delete;
|
||||
/** @var \phpbb\attachment\manager */
|
||||
protected $attachment_manager;
|
||||
|
||||
public $id;
|
||||
public $u_action;
|
||||
@@ -58,7 +58,7 @@ class acp_attachments
|
||||
$this->user = $user;
|
||||
$this->phpbb_container = $phpbb_container;
|
||||
$this->filesystem = $phpbb_filesystem;
|
||||
$this->attachment_delete = $phpbb_container->get('attachment.delete');
|
||||
$this->attachment_manager = $phpbb_container->get('attachment.manager');
|
||||
|
||||
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
||||
|
||||
@@ -926,11 +926,11 @@ class acp_attachments
|
||||
$delete_files = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$this->attachment_delete->unlink_attachment($row['physical_filename'], 'file');
|
||||
$this->attachment_manager->unlink($row['physical_filename'], 'file');
|
||||
|
||||
if ($row['thumbnail'])
|
||||
{
|
||||
$this->attachment_delete->unlink_attachment($row['physical_filename'], 'thumbnail');
|
||||
$this->attachment_manager->unlink($row['physical_filename'], 'thumbnail');
|
||||
}
|
||||
|
||||
$delete_files[$row['attach_id']] = $row['real_filename'];
|
||||
@@ -1095,7 +1095,7 @@ class acp_attachments
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($num_deleted = $this->attachment_delete->delete('attach', $delete_files))
|
||||
if ($num_deleted = $this->attachment_manager->delete('attach', $delete_files))
|
||||
{
|
||||
if (sizeof($delete_files) != $num_deleted)
|
||||
{
|
||||
|
Reference in New Issue
Block a user