utf-8 is already converted by ja_JP extra functions.
[squirrelmail.git] / plugins / abook_take / take.php
CommitLineData
e8b140ab 1<?php
08185f2a 2
b755a6b1 3/**
4 * take.php
5 *
6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Address Take -- steals addresses from incoming email messages. Searches
10 * the To, Cc, From and Reply-To headers.
11 *
12 * $Id$
13 */
e8b140ab 14
08185f2a 15/* Path for SquirrelMail required files. */
16define('SM_PATH','../../');
e8b140ab 17
08185f2a 18/* SquirrelMail required files. */
41ec18a3 19require_once(SM_PATH . 'include/validate.php');
08185f2a 20require_once(SM_PATH . 'functions/strings.php');
21require_once(SM_PATH . 'config/config.php');
22require_once(SM_PATH . 'functions/i18n.php');
23require_once(SM_PATH . 'functions/page_header.php');
24require_once(SM_PATH . 'functions/addressbook.php');
aa7fb30c 25require_once(SM_PATH . 'include/load_prefs.php');
08185f2a 26require_once(SM_PATH . 'functions/html.php');
27
28displayPageHeader($color, 'None');
b755a6b1 29
30/* input form data */
31sqgetGlobalVar('email', $email, SQ_POST);
32
08185f2a 33$abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
4cf43843 34
35$abook = addressbook_init(false, true);
36$name = 'addaddr';
b755a6b1 37
4cf43843 38echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n" .
39 html_tag( 'table',
40 html_tag( 'tr',
41 html_tag( 'th', sprintf(_("Add to %s"), $abook->localbackendname), 'center', $color[0] )
42 ) ,
43 'center', '', 'width="100%" cols="1"' ) .
44
45 html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"' ) . "\n" .
46 html_tag( 'tr', "\n" .
47 html_tag( 'td', _("Nickname") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
48 html_tag( 'td', '<input name="' . $name . '[nickname]" size="15" value="">' .
49 '&nbsp;<small>' . _("Must be unique") . '</small>',
50 'left', $color[4] )
51 ) . "\n" .
52 html_tag( 'tr' ) . "\n" .
53 html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" .
54 html_tag( 'td', '', 'left', $color[4] ) .
55 '<select name="' . $name . "[email]\">\n";
b755a6b1 56
57 foreach ($email as $Val)
58 {
59 if (valid_email($Val, $abook_take_verify))
60 {
61 echo '<option value="' . htmlspecialchars($Val) .
62 '">' . htmlspecialchars($Val) . "</option>\n";
63 } else {
64 echo '<option value="' . htmlspecialchars($Val) .
d55c0f66 65 '">FAIL - ' . htmlspecialchars($Val) . "</option>\n";
b755a6b1 66 }
67 }
e842b215 68 if ($squirrelmail_language == 'ja_JP') {
69 echo '</select></td></tr>' . "\n" .
70
71 html_tag( 'tr', "\n" .
72 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
73 html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
74 ) . "\n" .
75 html_tag( 'tr', "\n" .
76 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
77 html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
78 ) . "\n" .
79 html_tag( 'tr', "\n" .
80 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
81 html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
82 ) . "\n" .
83 html_tag( 'tr', "\n" .
84 html_tag( 'td',
85 '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
86 'center', $color[4], 'colspan="2"' )
87 ) . "\n" .
88 '</table>';
89 } else {
b755a6b1 90 echo '</select></td></tr>' . "\n" .
e8b140ab 91
b755a6b1 92 html_tag( 'tr', "\n" .
93 html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) .
94 html_tag( 'td', '<input name="' . $name . '[firstname]" size="45" value="">', 'left', $color[4] )
95 ) . "\n" .
96 html_tag( 'tr', "\n" .
97 html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) .
98 html_tag( 'td', '<input name="' . $name . '[lastname]" size="45" value="">', 'left', $color[4] )
99 ) . "\n" .
100 html_tag( 'tr', "\n" .
101 html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) .
102 html_tag( 'td', '<input name="' . $name . '[label]" size="45" value="">', 'left', $color[4] )
103 ) . "\n" .
104 html_tag( 'tr', "\n" .
105 html_tag( 'td',
106 '<input type="submit" name="' . $name . '[SUBMIT]" size="45" value="'. _("Add address") .'">' ,
107 'center', $color[4], 'colspan="2"' )
108 ) . "\n" .
109 '</table>';
e842b215 110 }
e8b140ab 111?>
4cf43843 112</form></body>
113</html>