From 332ffef199745f1ddb3f3ad3e5618a4675b929bb Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 02 Feb 2016 05:41:45 -0500
Subject: [PATCH] Plugin API: Added addressbook_export hook

---
 program/steps/addressbook/export.inc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc
index 8d62ecd..859d0f0 100644
--- a/program/steps/addressbook/export.inc
+++ b/program/steps/addressbook/export.inc
@@ -98,6 +98,14 @@
     $result = $CONTACTS->list_records(null, 0, true);
 }
 
+// Give plugins a possibility to implement other output formats or modify the result
+$plugin = $RCMAIL->plugins->exec_hook('addressbook_export', array('result' => $result));
+$result = $plugin['result'];
+
+if ($plugin['abort']) {
+    exit;
+}
+
 // send downlaod headers
 header('Content-Type: text/x-vcard; charset='.RCUBE_CHARSET);
 header('Content-Disposition: attachment; filename="contacts.vcf"');

--
Gitblit v1.9.1