- // List search results
- function addr_display_result($res, $includesource = true) {
- global $color, $PHP_SELF;
-
- if(sizeof($res) <= 0) return;
-
- echo '<form method=post action="' . $PHP_SELF . "\">\n";
- echo '<input type=hidden name="html_addr_search_done" value="true">';
- echo "\n";
- addr_insert_hidden();
- $line = 0;
-
- print "<TABLE BORDER=0 WIDTH=\"98%\" ALIGN=center>";
- printf("<TR BGCOLOR=\"$color[9]\"><TH ALIGN=left> ".
- "<TH ALIGN=left> %s<TH ALIGN=left> %s".
- "<TH ALIGN=left> %s",
- _("Name"), _("E-mail"), _("Info"));
-
- if($includesource)
- printf("<TH ALIGN=left WIDTH=\"10%%\"> %s", _("Source"));
-
- print "</TR>\n";
-
- foreach ($res as $row) {
- echo '<tr';
- if ($line % 2) echo ' bgcolor="' . $color[0] . '"';
- echo ' nowrap><td nowrap align=center width="5%">';
- echo '<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '"> To ';
- echo '<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '"> Cc ';
- echo '<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '"> Bcc ';
- echo '</td><td nowrap> ' . $row['name'] . ' </td>';
- echo '<td nowrap> ' . $row['email'] . ' </td>';
- echo '<td nowrap> ' . $row['label'] . ' </td>';
- if($includesource)
- echo '<td nowrap> ' . $row['source'] . ' </td>';
- echo "</tr>\n";
- $line ++;
- }
- printf('<TR><TD ALIGN=center COLSPAN=%d><INPUT TYPE=submit '.
- 'NAME="addr_search_done" VALUE="%s"></TD></TR>',
- 4 + ($includesource ? 1 : 0),
- _("Use Addresses"));
- print '</TABLE>';
- print '<INPUT TYPE=hidden VALUE=1 NAME="html_addr_search_done">';
- print '</FORM>';
- }
-
- // --- End functions ---
-
- global $mailbox;
- displayPageHeader($color, $mailbox);
-
- // Initialize addressbook
- $abook = addressbook_init();
+/* List search results */
+function addr_display_result($res, $includesource = true) {
+ global $color, $PHP_SELF;
+
+ if (sizeof($res) <= 0) return;
+
+ echo '<form method=post action="' . $PHP_SELF . "\">\n" .
+ '<input type=hidden name="html_addr_search_done" value="true">' . "\n";
+ addr_insert_hidden();
+ $line = 0;
+
+ echo '<TABLE BORDER=0 WIDTH="98%" ALIGN=center>' .
+ '<TR BGCOLOR="' . $color[9] . '"><TH ALIGN=left> ' .
+ '<TH ALIGN=left> ' . _("Name") .
+ '<TH ALIGN=left> ' . _("E-mail") .
+ '<TH ALIGN=left> ' . _("Info");
+
+ if ($includesource) {
+ echo '<TH ALIGN=left WIDTH="10%"> ' . _("Source");
+ }
+
+ echo "</TR>\n";
+
+ foreach ($res as $row) {
+ echo '<tr';
+ if ($line % 2) { echo ' bgcolor="' . $color[0] . '"'; }
+ echo ' nowrap><td nowrap align=center width="5%">' .
+ '<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
+ htmlspecialchars($row['email']) . '"> To ' .
+ '<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
+ htmlspecialchars($row['email']) . '"> Cc ' .
+ '<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
+ htmlspecialchars($row['email']) . '"> Bcc ' .
+ '</td><td nowrap> ' . $row['name'] . ' </td>' .
+ '<td nowrap> ' . $row['email'] . ' </td>' .
+ '<td nowrap> ' . $row['label'] . ' </td>';
+ if ($includesource) {
+ echo '<td nowrap> ' . $row['source'] . ' </td>';
+ }
+ echo "</tr>\n";
+ $line ++;
+ }
+ echo '<TR><TD ALIGN=center COLSPAN=';
+ if ($includesource) { echo '4'; } else { echo '5'; }
+ echo '><INPUT TYPE=submit NAME="addr_search_done" VALUE="' .
+ _("Use Addresses") . '"></TD></TR>' .
+ '</TABLE>' .
+ '<INPUT TYPE=hidden VALUE=1 NAME="html_addr_search_done">' .
+ '</FORM>';
+}
+
+/* --- End functions --- */
+
+global $mailbox;
+displayPageHeader($color, $mailbox);
+
+/* Initialize addressbook */
+$abook = addressbook_init();