thomascube
2008-07-25 6d5dbae53cd4b4b97da0b0c558292a7f1062a524
program/steps/addressbook/func.inc
@@ -22,7 +22,7 @@
// instantiate a contacts object according to the given source
if (($source = get_input_value('_source', RCUBE_INPUT_GPC)) && isset($CONFIG['ldap_public'][$source]))
  $CONTACTS = new rcube_ldap($CONFIG['ldap_public'][$source]);
else if ($CONFIG['address_book_type'] == 'ldap') {
else if (strtolower($CONFIG['address_book_type']) == 'ldap') {
    // Get the first LDAP address book.
    $source = key((array)$CONFIG['ldap_public']);
    $prop = current((array)$CONFIG['ldap_public']);
@@ -49,12 +49,14 @@
// add list of address sources to client env
$js_list = array();
if ($CONFIG['address_book_type'] != 'ldap') {
if (strtolower($CONFIG['address_book_type']) != 'ldap') {
  // We are using the DB address book, add it.
  $js_list = array("0" => array('id' => 0, 'readonly' => false));
} // end if
foreach ((array)$CONFIG['ldap_public'] as $id => $prop)
  $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']);
else if (!empty($CONFIG['ldap_public'])) {
  foreach ($CONFIG['ldap_public'] as $id => $prop)
    $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']);
}
$OUTPUT->set_env('address_sources', $js_list);
@@ -76,7 +78,7 @@
    
  // allow the following attributes to be added to the <ul> tag
  $out = '<ul' . create_attrib_string($attrib, array('style', 'class', 'id')) . ">\n";
  if ($CONFIG['address_book_type'] != 'ldap') {
  if (strtolower($CONFIG['address_book_type']) != 'ldap') {
    $out .= sprintf($line_templ,
      'rcmli'.$local_id,
      !$current ? 'selected' : '',
@@ -239,7 +241,8 @@
  return $out;
  }
$OUTPUT->set_pagetitle(rcube_label('addressbook'));
  
// register UI objects
$OUTPUT->add_handlers(array(