5 ** Adds a "taken" address to the address book. Takes addresses from
6 ** incoming mail -- the body, To, From, Cc, or Reply-To.
10 require_once('../src/validate.php');
11 require_once("../functions/strings.php");
12 require_once("../config/config.php");
13 require_once("../functions/i18n.php");
14 require_once("../functions/page_header.php");
15 require_once("../functions/addressbook.php");
16 require_once("../src/load_prefs.php");
17 require_once('../functions/html.php');
19 displayPageHeader($color, "None");
21 $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
24 $abook = addressbook_init(false, true);
26 echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
29 html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname
), 'center', $color[0] )
31 'center', '', 'width="100%" cols="1"' ) .
33 html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" .
34 html_tag( 'tr', "\n" .
35 html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
36 html_tag( 'td', '<input name="' . $name . '[nickname]" size="15" value="">' .
37 ' <small>' . _("Must be unique") . '</small>',
40 html_tag( 'tr' ) . "\n" .
41 html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
42 html_tag( 'td', '', 'left', $color[4] ) .
43 '<select name="' . $name . "[email]\">\n";
44 foreach ($email as $Val)
46 if (valid_email($Val, $abook_take_verify))
48 echo '<option value="' . htmlspecialchars($Val) .
49 '">' . htmlspecialchars($Val) . "</option>\n";
53 echo '<option value="' . htmlspecialchars($Val) .
54 '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
57 echo '</select></td></tr>' . "\n" .
59 html_tag( 'tr', "\n" .
60 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
61 html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
63 html_tag( 'tr', "\n" .
64 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
65 html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
67 html_tag( 'tr', "\n" .
68 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
69 html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
71 html_tag( 'tr', "\n" .
73 '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
74 'center', $color[4], 'colspan="2"' )