summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-07-30 06:34:02 +0000
committeralecpl <alec@alec.pl>2010-07-30 06:34:02 +0000
commite6ce0062f2331b8756cc91944ceaea8d7cbffd18 (patch)
tree1005f3248c2dc0eb12a7587c19c2bf5181ac7fc8 /program/steps/mail
parentee09d464a86a75958e1b61f230e0f0294e929a7e (diff)
- Unify hooks names, see rcube_plugin_api::deprecated_hooks for complete list (old names are supported without errors nor warnings)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc2
-rw-r--r--program/steps/mail/attachments.inc6
-rw-r--r--program/steps/mail/compose.inc6
-rw-r--r--program/steps/mail/func.inc2
-rw-r--r--program/steps/mail/sendmail.inc10
5 files changed, 13 insertions, 13 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 20a49a169..8a071be6d 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -47,7 +47,7 @@ if (!empty($_POST['_address']) && is_object($CONTACTS))
$OUTPUT->show_message('contactexists', 'warning');
else
{
- $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $contact, 'source' => null));
+ $plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $contact, 'source' => null));
$contact = $plugin['record'];
if (!$plugin['abort'] && ($done = $CONTACTS->insert($contact)))
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index dca727278..797c30ca3 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -32,7 +32,7 @@ if ($RCMAIL->action=='remove-attachment')
if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs))
$id = $regs[1];
if ($attachment = $_SESSION['compose']['attachments'][$id])
- $attachment = $RCMAIL->plugins->exec_hook('remove_attachment', $attachment);
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_delete', $attachment);
if ($attachment['status']) {
if (is_array($_SESSION['compose']['attachments'][$id])) {
unset($_SESSION['compose']['attachments'][$id]);
@@ -50,7 +50,7 @@ if ($RCMAIL->action=='display-attachment')
if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs))
$id = $regs[1];
if ($attachment = $_SESSION['compose']['attachments'][$id])
- $attachment = $RCMAIL->plugins->exec_hook('display_attachment', $attachment);
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment);
if ($attachment['status']) {
if (empty($attachment['size']))
@@ -87,7 +87,7 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i])
);
- $attachment = $RCMAIL->plugins->exec_hook('upload_attachment', $attachment);
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_upload', $attachment);
if ($attachment['status'] && !$attachment['abort']) {
$id = $attachment['id'];
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 712318d93..c154301e3 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -81,7 +81,7 @@ if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_v
// save attachment if valid
if (($attachment['data'] && $attachment['name']) || ($attachment['path'] && file_exists($attachment['path']))) {
- $attachment = rcmail::get_instance()->plugins->exec_hook('save_attachment', $attachment);
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
}
if ($attachment['status'] && !$attachment['abort']) {
@@ -829,7 +829,7 @@ function rcmail_save_attachment(&$message, $pid)
'size' => $path ? filesize($path) : strlen($data),
);
- $attachment = rcmail::get_instance()->plugins->exec_hook('save_attachment', $attachment);
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
if ($attachment['status']) {
unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
@@ -853,7 +853,7 @@ function rcmail_save_image($path, $mimetype='')
'size' => strlen($data),
);
- $attachment = rcmail::get_instance()->plugins->exec_hook('save_attachment', $attachment);
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
if ($attachment['status']) {
unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index a1cc68d16..c96f442c7 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1325,7 +1325,7 @@ function rcmail_compose_cleanup()
return;
$rcmail = rcmail::get_instance();
- $rcmail->plugins->exec_hook('cleanup_attachments',array());
+ $rcmail->plugins->exec_hook('attachments_cleanup', array());
$rcmail->session->remove('compose');
}
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 91f374cea..300bea019 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -358,7 +358,7 @@ if (!empty($CONFIG['useragent']))
$headers['User-Agent'] = $CONFIG['useragent'];
// exec hook for header checking and manipulation
-$data = $RCMAIL->plugins->exec_hook('outgoing_message_headers', array('headers' => $headers));
+$data = $RCMAIL->plugins->exec_hook('message_outgoing_headers', array('headers' => $headers));
// sending aborted by plugin
if ($data['abort'] && !$savedraft) {
@@ -428,7 +428,7 @@ if (is_array($_SESSION['compose']['attachments']) && $CONFIG['smtp_server']
// the HTML part and the plain-text part
if ($isHtml) {
- $plugin = $RCMAIL->plugins->exec_hook('outgoing_message_body',
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
array('body' => $message_body, 'type' => 'html', 'message' => $MAIL_MIME));
$MAIL_MIME->setHTMLBody($plugin['body']);
@@ -446,7 +446,7 @@ if ($isHtml) {
$plainTextPart = preg_replace('/\r?\n/', "\r\n", $plainTextPart);
}
- $plugin = $RCMAIL->plugins->exec_hook('outgoing_message_body',
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
array('body' => $plainTextPart, 'type' => 'alternative', 'message' => $MAIL_MIME));
$MAIL_MIME->setTXTBody($plugin['body']);
@@ -456,7 +456,7 @@ if ($isHtml) {
$message_body = rcmail_fix_emoticon_paths($MAIL_MIME);
}
else {
- $plugin = $RCMAIL->plugins->exec_hook('outgoing_message_body',
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
array('body' => $message_body, 'type' => 'plain', 'message' => $MAIL_MIME));
$message_body = $plugin['body'];
@@ -481,7 +481,7 @@ if (is_array($_SESSION['compose']['attachments']))
{
foreach ($_SESSION['compose']['attachments'] as $id => $attachment) {
// This hook retrieves the attachment contents from the file storage backend
- $attachment = $RCMAIL->plugins->exec_hook('get_attachment', $attachment);
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_get', $attachment);
$dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' . preg_quote($attachment['id']) . '[\s\'"]*/';
$message_body = $MAIL_MIME->getHTMLBody();