| | |
| | | $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : $plugin['result']; |
| | | |
| | | if (!$deleted) { |
| | | // send error message |
| | | exit; |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error'); |
| | | $OUTPUT->command('list_contacts'); |
| | | } |
| | | else { |
| | | $OUTPUT->show_message('contactdeleted', 'confirmation'); |
| | | |
| | | // count contacts for this user |
| | | $result = $CONTACTS->count(); |
| | |
| | | $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size); |
| | | if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages) |
| | | rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted)); |
| | | } |
| | | |
| | | // send response |
| | | $OUTPUT->send(); |