From ce92ba767a9557daf7f18be94882dd7e6f4591fb Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 30 Sep 2010 13:24:33 +0000 Subject: - Plugin API: improved 'abort' flag handling, added 'result' item in some hooks: group_*, contact_*, identity_* (#1486914) --- program/steps/addressbook/delete.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'program/steps/addressbook/delete.inc') diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc index 08ae36dfb..bb0457be7 100644 --- a/program/steps/addressbook/delete.inc +++ b/program/steps/addressbook/delete.inc @@ -23,14 +23,15 @@ if ($OUTPUT->ajax_call && ($cid = get_input_value('_cid', RCUBE_INPUT_POST)) && preg_match('/^[a-zA-Z0-9\+\/=_-]+(,[a-zA-Z0-9\+\/=_-]+)*$/', $cid) ) { - $plugin = $RCMAIL->plugins->exec_hook('contact_delete', array('id' => $cid, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); + $plugin = $RCMAIL->plugins->exec_hook('contact_delete', array( + 'id' => $cid, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); - $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : false; - if (!$deleted) - { + $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : $plugin['result']; + + if (!$deleted) { // send error message exit; - } + } // count contacts for this user $result = $CONTACTS->count(); @@ -46,7 +47,7 @@ if ($OUTPUT->ajax_call && // send response $OUTPUT->send(); - } +} exit; -- cgit v1.2.3