summaryrefslogtreecommitdiff
path: root/plugins/filesystem_attachments/filesystem_attachments.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-07-30 06:34:16 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-07-30 06:34:16 +0000
commitb0d8a8e9f535da27f8ec09df164fea3cf1a96480 (patch)
tree770bd522ff025f8d49b3131dcbb4e35f31254bb0 /plugins/filesystem_attachments/filesystem_attachments.php
parent009b6c1c0c9d62d338c57e53fd3a25f3cd22a50b (diff)
- Unify hooks names, see rcube_plugin_api::deprecated_hooks for complete list (old names are supported without errors nor warnings)
git-svn-id: https://svn.roundcube.net/trunk@3841 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/filesystem_attachments/filesystem_attachments.php')
-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);
}
}