summaryrefslogtreecommitdiff
path: root/plugins/filesystem_attachments
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/filesystem_attachments')
-rw-r--r--plugins/filesystem_attachments/filesystem_attachments.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/filesystem_attachments/filesystem_attachments.php b/plugins/filesystem_attachments/filesystem_attachments.php
index d5f555311..2b2fe71ae 100644
--- a/plugins/filesystem_attachments/filesystem_attachments.php
+++ b/plugins/filesystem_attachments/filesystem_attachments.php
@@ -20,27 +20,27 @@
class filesystem_attachments extends rcube_plugin
{
public $task = 'mail';
-
+
function init()
{
// Save a newly uploaded attachment
- $this->add_hook('upload_attachment', array($this, 'upload'));
+ $this->add_hook('attachment_upload', array($this, 'upload'));
// Save an attachment from a non-upload source (draft or forward)
- $this->add_hook('save_attachment', array($this, 'save'));
+ $this->add_hook('attachment_save', array($this, 'save'));
// Remove an attachment from storage
- $this->add_hook('remove_attachment', array($this, 'remove'));
+ $this->add_hook('attachment_delete', array($this, 'remove'));
// When composing an html message, image attachments may be shown
- $this->add_hook('display_attachment', array($this, 'display'));
+ $this->add_hook('attachment_display', array($this, 'display'));
// Get the attachment from storage and place it on disk to be sent
- $this->add_hook('get_attachment', array($this, 'get_attachment'));
+ $this->add_hook('attachment_get', array($this, 'get'));
// Delete all temp files associated with this user
- $this->add_hook('cleanup_attachments', array($this, 'cleanup'));
- $this->add_hook('kill_session', array($this, 'cleanup'));
+ $this->add_hook('attachments_cleanup', array($this, 'cleanup'));
+ $this->add_hook('session_destroy', array($this, 'cleanup'));
}
/**
@@ -86,10 +86,10 @@ class filesystem_attachments extends rcube_plugin
} else
return $args;
}
-
+
$args['id'] = $this->file_id();
$args['status'] = true;
-
+
// Note the file for later cleanup
$_SESSION['plugins']['filesystem_attachments']['tmp_files'][] = $args['path'];
@@ -122,11 +122,11 @@ class filesystem_attachments extends rcube_plugin
* on disk for use. This stub function is kept here to make this
* class handy as a parent class for other plugins which may need it.
*/
- function get_attachment($args)
+ function get($args)
{
return $args;
}
-
+
/**
* Delete all temp files associated with this user
*/
@@ -149,7 +149,7 @@ class filesystem_attachments extends rcube_plugin
function file_id()
{
$userid = rcmail::get_instance()->user->ID;
- list($usec, $sec) = explode(' ', microtime());
+ list($usec, $sec) = explode(' ', microtime());
return preg_replace('/[^0-9]/', '', $userid . $sec . $usec);
}
}