From be2380fb47b05a222ec5b22deff36d5156a8c943 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 13 Jan 2006 13:08:41 -0500
Subject: [PATCH] Added labels for LDAP search

---
 program/steps/addressbook/func.inc |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 8065219..f7993c9 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -30,7 +30,12 @@
 else
   $CONTACTS_LIST['page'] = $_SESSION['page'] ? $_SESSION['page'] : 1;
 
-
+// disable the ldap public search button if there's no servers configured
+$enable_ldap = 'true';
+if (!$CONFIG['ldap_public'])
+  $enable_ldap = 'false';
+  
+$OUTPUT->add_script("$JS_OBJECT_NAME.set_env('ldappublicsearch', $enable_ldap);");  
 
 // return the message list as HTML table
 function rcmail_contacts_list($attrib)
@@ -81,6 +86,7 @@
   $javascript = sprintf("%s.gui_object('contactslist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
   $javascript .= sprintf("%s.set_env('current_page', %d);\n", $JS_OBJECT_NAME, $CONTACTS_LIST['page']);
   $javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($rowcount/$CONFIG['pagesize']));
+  $javascript .= "rcmail.set_env('newcontact', '" . rcube_label('newcontact') . "');";
   //$javascript .= sprintf("%s.set_env('contacts', %s);", $JS_OBJECT_NAME, array2js($a_js_message_arr));
   
   $OUTPUT->add_script($javascript);  
@@ -191,4 +197,4 @@
   return $out;
   }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1