From 3704b78841ba05c31a2acaeabdffb9c471bb6610 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 02 Mar 2010 09:35:53 -0500
Subject: [PATCH] - Added function to get addressbooks list rcmail::get_address_sources() (#1486248)

---
 program/steps/addressbook/func.inc |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index ebf5546..ca1fd03 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -20,18 +20,7 @@
 */
 
 // add list of address sources to client env
-$js_list = array();
-if (strtolower($CONFIG['address_book_type']) != 'ldap') {
-  // We are using the DB address book, add it.
-  $js_list['0'] = array('id' => 0, 'name' => rcube_label('personaladrbook'), 'readonly' => false);
-}
-if (is_array($CONFIG['ldap_public'])) {
-  foreach ($CONFIG['ldap_public'] as $id => $prop)
-    $js_list[$id] = array('id' => $id, 'name' => $prop['name'], 'readonly' => !$prop['writable']);
-}
-
-$plugin = $RCMAIL->plugins->exec_hook('address_sources', array('sources' => $js_list));
-$js_list = $plugin['sources'];
+$js_list = $RCMAIL->get_address_sources();
 
 // select source
 $source = get_input_value('_source', RCUBE_INPUT_GPC);
@@ -39,7 +28,6 @@
 // if source is not set use first directory
 if (empty($source))
   $source = $js_list[key($js_list)]['id'];
-
 
 // instantiate a contacts object according to the given source
 $CONTACTS = $RCMAIL->get_address_book($source);

--
Gitblit v1.9.1