+ // Insert hidden data
+ function addr_insert_hidden() {
+ global $body, $subject, $send_to, $send_to_cc, $send_to_bcc;
+ printf("<input type=hidden value=\"%s\" name=body>\n",
+ htmlspecialchars($body));
+ printf("<input type=hidden value=\"%s\" name=subject>\n",
+ htmlspecialchars($subject));
+ printf("<input type=hidden value=\"%s\" name=send_to>\n",
+ htmlspecialchars($send_to));
+ printf("<input type=hidden value=\"%s\" name=send_to_cc>\n",
+ htmlspecialchars($send_to_cc));
+ printf("<input type=hidden value=\"%s\" name=send_to_bcc>\n",
+ htmlspecialchars($send_to_bcc));
+ }
+
+
+ // List search results
+ function addr_display_result($res, $includesource = true) {
+ global $color, $PHP_SELF;
+
+ if(sizeof($res) <= 0) return;
+
+ printf('<FORM METHOD=post ACTION="%s?html_addr_search_done=true">'."\n",
+ $PHP_SELF);
+ 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";
+
+ while(list($key, $row) = each($res)) {
+ printf("<tr%s nowrap><td nowrap align=center width=\"5%%\">".
+ "<input type=checkbox name=\"send_to_search[]\" value=\"%s\"> To".
+ "<input type=checkbox name=\"send_to_cc_search[]\" value=\"%s\"> Cc ".
+ "<td nowrap> %s <td nowrap> ".
+ "%s".
+ "<td nowrap> %s ",
+ ($line % 2) ? " bgcolor=\"$color[0]\"" : "",
+ htmlspecialchars($row["email"]), htmlspecialchars($row["email"]),
+ $row["name"], $row["email"], $row["label"]);
+ if($includesource)
+ printf("<td nowrap> %s", $row["source"]);
+
+ print "</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 ---
+