From d1d2c4fb1d0e9b7a46693e617835850b0edc0fd5 Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Sun, 08 Jan 2006 02:15:44 -0500
Subject: [PATCH] adding files and modifications for public ldap search

---
 program/include/main.inc |   55 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 24110d3..c64ac7d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -924,6 +924,8 @@
         'recordscountdisplay' => 'rcmail_rowcount_display',
         'contactdetails' => 'rcmail_contact_details',
         'contacteditform' => 'rcmail_contact_editform',
+        'ldappublicsearch' => 'rcmail_ldap_public_search_form',
+        'ldappublicaddresslist' => 'rcmail_ldap_public_list',
 
         // USER SETTINGS
         'userprefs' => 'rcmail_user_prefs_form',
@@ -1110,7 +1112,7 @@
 
 
 
-function rcube_table_output($attrib, $sql_result, $a_show_cols, $id_col)
+function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
   {
   global $DB;
   
@@ -1128,21 +1130,44 @@
   $table .= "</tr></thead>\n<tbody>\n";
   
   $c = 0;
-  while ($sql_result && ($sql_arr = $DB->fetch_assoc($sql_result)))
+
+  if (!is_array($table_data)) 
     {
-    $zebra_class = $c%2 ? 'even' : 'odd';
-
-    $table .= sprintf('<tr id="rcmrow%d" class="contact '.$zebra_class.'">'."\n", $sql_arr[$id_col]);
-
-    // format each col
-    foreach ($a_show_cols as $col)
+    while ($table_data && ($sql_arr = $DB->fetch_assoc($table_data)))
       {
-      $cont = rep_specialchars_output($sql_arr[$col]);
-	  $table .= '<td class="'.$col.'">' . $cont . "</td>\n";
-      }
+      $zebra_class = $c%2 ? 'even' : 'odd';
 
-    $table .= "</tr>\n";
-    $c++;
+      $table .= sprintf('<tr id="rcmrow%d" class="contact '.$zebra_class.'">'."\n", $sql_arr[$id_col]);
+
+      // format each col
+      foreach ($a_show_cols as $col)
+        {
+        $cont = rep_specialchars_output($sql_arr[$col]);
+	    $table .= '<td class="'.$col.'">' . $cont . "</td>\n";
+        }
+
+      $table .= "</tr>\n";
+      $c++;
+      }
+    }
+  else 
+    {
+    foreach ($table_data as $row_data)
+      {
+      $zebra_class = $c%2 ? 'even' : 'odd';
+
+      $table .= sprintf('<tr id="rcmrow%d" class="contact '.$zebra_class.'">'."\n", $row_data[$id_col]);
+
+      // format each col
+      foreach ($a_show_cols as $col)
+        {
+        $cont = rep_specialchars_output($row_data[$col]);
+	    $table .= '<td class="'.$col.'">' . $cont . "</td>\n";
+        }
+
+      $table .= "</tr>\n";
+      $c++;
+      }
     }
 
   // complete message table
@@ -1420,7 +1445,6 @@
   }
 
 
-
 function rcube_timer()
   {
   list($usec, $sec) = explode(" ", microtime());
@@ -1442,5 +1466,4 @@
   console(sprintf("%s: %0.4f sec", $label, $diff));
   }
 
-
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1