From b0d8a8e9f535da27f8ec09df164fea3cf1a96480 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 30 Jul 2010 06:34:16 +0000 Subject: - 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 --- .../filesystem_attachments.php | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/filesystem_attachments/filesystem_attachments.php') 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); } } -- cgit v1.2.3