abdfb4d0 |
1 | <?php |
35586184 |
2 | /** |
3 | * addressbook.php |
4 | * |
82d304a0 |
5 | * Copyright (c) 1999-2004 The SquirrelMail Project Team |
35586184 |
6 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
7 | * |
8 | * Manage personal address book. |
9 | * |
30967a1e |
10 | * @version $Id$ |
8f6f9ba5 |
11 | * @package squirrelmail |
35586184 |
12 | */ |
13 | |
30967a1e |
14 | /** |
15 | * Path for SquirrelMail required files. |
16 | * @ignore |
17 | */ |
86725763 |
18 | define('SM_PATH','../'); |
19 | |
8f6f9ba5 |
20 | /** SquirrelMail required files. */ |
08185f2a |
21 | require_once(SM_PATH . 'include/validate.php'); |
1e12d1ff |
22 | require_once(SM_PATH . 'functions/global.php'); |
86725763 |
23 | require_once(SM_PATH . 'functions/display_messages.php'); |
24 | require_once(SM_PATH . 'functions/addressbook.php'); |
25 | require_once(SM_PATH . 'functions/strings.php'); |
26 | require_once(SM_PATH . 'functions/html.php'); |
19347763 |
27 | require_once(SM_PATH . 'functions/forms.php'); |
ffd8224c |
28 | |
8f6f9ba5 |
29 | /** lets get the global vars we may need */ |
1e12d1ff |
30 | sqgetGlobalVar('key', $key, SQ_COOKIE); |
0b97a708 |
31 | |
1e12d1ff |
32 | sqgetGlobalVar('username', $username, SQ_SESSION); |
33 | sqgetGlobalVar('onetimepad',$onetimepad, SQ_SESSION); |
34 | sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); |
35 | sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); |
0b97a708 |
36 | |
37 | /* From the address form */ |
1e12d1ff |
38 | sqgetGlobalVar('addaddr', $addaddr, SQ_POST); |
39 | sqgetGlobalVar('editaddr', $editaddr, SQ_POST); |
40 | sqgetGlobalVar('deladdr', $deladdr, SQ_POST); |
41 | sqgetGlobalVar('sel', $sel, SQ_POST); |
42 | sqgetGlobalVar('oldnick', $oldnick, SQ_POST); |
43 | sqgetGlobalVar('backend', $backend, SQ_POST); |
2741cc97 |
44 | sqgetGlobalVar('doedit', $doedit, SQ_POST); |
0b97a708 |
45 | |
8f6f9ba5 |
46 | /** |
47 | * Make an input field |
48 | * @param string $label |
49 | * @param string $field |
50 | * @param string $name |
51 | * @param string $size |
52 | * @param array $values |
53 | * @param string $add |
54 | */ |
19347763 |
55 | function addressbook_inp_field($label, $field, $name, $size, $values, $add) { |
daba719e |
56 | global $color; |
19347763 |
57 | $value = ( isset($values[$field]) ? $values[$field] : ''); |
58 | |
59 | $td_str = addInput($name.'['.$field.']', $value, $size) |
60 | . $add ; |
2741cc97 |
61 | |
ac987a56 |
62 | return html_tag( 'tr' , |
63 | html_tag( 'td', $label . ':', 'right', $color[4]) . |
64 | html_tag( 'td', $td_str, 'left', $color[4]) |
65 | ) |
66 | . "\n"; |
daba719e |
67 | } |
ffd8224c |
68 | |
8f6f9ba5 |
69 | /** |
70 | * Output form to add and modify address data |
71 | */ |
daba719e |
72 | function address_form($name, $submittext, $values = array()) { |
e842b215 |
73 | global $color, $squirrelmail_language; |
c6554ec0 |
74 | |
e842b215 |
75 | if ($squirrelmail_language == 'ja_JP') |
76 | { |
77 | echo html_tag( 'table', |
19347763 |
78 | addressbook_inp_field(_("Nickname"), 'nickname', $name, 15, $values, |
e842b215 |
79 | ' <SMALL>' . _("Must be unique") . '</SMALL>') . |
19347763 |
80 | addressbook_inp_field(_("E-mail address"), 'email', $name, 45, $values, '') . |
81 | addressbook_inp_field(_("Last name"), 'lastname', $name, 45, $values, '') . |
82 | addressbook_inp_field(_("First name"), 'firstname', $name, 45, $values, '') . |
83 | addressbook_inp_field(_("Additional info"), 'label', $name, 45, $values, '') . |
2741cc97 |
84 | list_writable_backends($name) . |
e842b215 |
85 | html_tag( 'tr', |
86 | html_tag( 'td', |
19347763 |
87 | '<INPUT TYPE=submit NAME="' . htmlentities($name) . '[SUBMIT]" VALUE="' . |
e842b215 |
88 | $submittext . '">', |
89 | 'center', $color[4], 'colspan="2"') |
90 | ) |
91 | , 'center', '', 'border="0" cellpadding="1" width="90%"') ."\n"; |
92 | } else { |
ac987a56 |
93 | echo html_tag( 'table', |
19347763 |
94 | addressbook_inp_field(_("Nickname"), 'nickname', $name, 15, $values, |
c6554ec0 |
95 | ' <SMALL>' . _("Must be unique") . '</SMALL>') . |
19347763 |
96 | addressbook_inp_field(_("E-mail address"), 'email', $name, 45, $values, '') . |
97 | addressbook_inp_field(_("First name"), 'firstname', $name, 45, $values, '') . |
98 | addressbook_inp_field(_("Last name"), 'lastname', $name, 45, $values, '') . |
99 | addressbook_inp_field(_("Additional info"), 'label', $name, 45, $values, '') . |
2741cc97 |
100 | list_writable_backends($name) . |
ac987a56 |
101 | html_tag( 'tr', |
102 | html_tag( 'td', |
19347763 |
103 | '<INPUT TYPE=submit NAME="' . htmlentities($name) . '[SUBMIT]" VALUE="' . |
ac987a56 |
104 | $submittext . '">', |
105 | 'center', $color[4], 'colspan="2"') |
106 | ) |
ac50138c |
107 | , 'center', '', 'border="0" cellpadding="1" width="90%"') ."\n"; |
daba719e |
108 | } |
e842b215 |
109 | } |
ffd8224c |
110 | |
08188c25 |
111 | function list_writable_backends($name) { |
112 | global $color, $abook; |
113 | if ( $name != 'addaddr' ) { return; } |
114 | if ( $abook->numbackends > 1 ) { |
115 | $ret = "<select name=backend>"; |
116 | $backends = $abook->get_backend_list(); |
117 | while (list($undef,$v) = each($backends)) { |
118 | if ($v->writeable) { |
2741cc97 |
119 | $ret .= '<OPTION VALUE=' . $v->bnum; |
120 | $ret .= '>' . $v->sname . "\n"; |
08188c25 |
121 | } |
122 | } |
123 | $ret .= "</select>"; |
124 | return html_tag( 'tr', |
2741cc97 |
125 | html_tag( 'td', _("Add to:"),'right', $color[4] ) . |
126 | html_tag( 'td', $ret, 'left', $color[4] )) . "\n"; |
08188c25 |
127 | } else { |
128 | return html_tag( 'tr', |
2741cc97 |
129 | html_tag( 'td', |
130 | addHidden('backend', '1'), |
08188c25 |
131 | 'center', $color[4], 'colspan="2"')) . "\n"; |
132 | } |
133 | } |
134 | |
f6c945b9 |
135 | /* Open addressbook, with error messages on but without LDAP (the * |
136 | * second "true"). Don't need LDAP here anyway */ |
daba719e |
137 | $abook = addressbook_init(true, true); |
138 | if($abook->localbackend == 0) { |
139 | plain_error_message( |
140 | _("No personal address book is defined. Contact administrator."), |
141 | $color); |
142 | exit(); |
143 | } |
ffd8224c |
144 | |
daba719e |
145 | displayPageHeader($color, 'None'); |
ffd8224c |
146 | |
daba719e |
147 | $defdata = array(); |
148 | $formerror = ''; |
149 | $abortform = false; |
150 | $showaddrlist = true; |
151 | $defselected = array(); |
07dcee9f |
152 | $form_url = 'addressbook.php'; |
daba719e |
153 | |
154 | |
f6c945b9 |
155 | /* Handle user's actions */ |
1e12d1ff |
156 | if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'POST') { |
daba719e |
157 | |
f6c945b9 |
158 | /************************************************** |
159 | * Add new address * |
160 | **************************************************/ |
39b26252 |
161 | if (isset($addaddr)) { |
c6554ec0 |
162 | foreach( $addaddr as $k => $adr ) { |
163 | $addaddr[$k] = strip_tags( $adr ); |
164 | } |
2741cc97 |
165 | if (isset($backend)) { |
166 | $r = $abook->add($addaddr, $backend); |
167 | } else { |
168 | $r = $abook->add($addaddr, $abook->localbackend); |
169 | } |
ffd8224c |
170 | |
f6c945b9 |
171 | /* Handle error messages */ |
172 | if (!$r) { |
173 | /* Remove backend name from error string */ |
ffd8224c |
174 | $errstr = $abook->error; |
175 | $errstr = ereg_replace('^\[.*\] *', '', $errstr); |
176 | |
177 | $formerror = $errstr; |
178 | $showaddrlist = false; |
179 | $defdata = $addaddr; |
180 | } |
daba719e |
181 | } else { |
ffd8224c |
182 | |
f6c945b9 |
183 | /************************************************ |
184 | * Delete address(es) * |
185 | ************************************************/ |
186 | if ((!empty($deladdr)) && sizeof($sel) > 0) { |
daba719e |
187 | $orig_sel = $sel; |
188 | sort($sel); |
189 | |
f6c945b9 |
190 | /* The selected addresses are identidied by "backend:nickname". * |
191 | * Sort the list and process one backend at the time */ |
daba719e |
192 | $prevback = -1; |
193 | $subsel = array(); |
194 | $delfailed = false; |
195 | |
f6c945b9 |
196 | for ($i = 0 ; (($i < sizeof($sel)) && !$delfailed) ; $i++) { |
daba719e |
197 | list($sbackend, $snick) = explode(':', $sel[$i]); |
198 | |
f6c945b9 |
199 | /* When we get to a new backend, process addresses in * |
200 | * previous one. */ |
201 | if ($prevback != $sbackend && $prevback != -1) { |
daba719e |
202 | |
203 | $r = $abook->remove($subsel, $prevback); |
f6c945b9 |
204 | if (!$r) { |
daba719e |
205 | $formerror = $abook->error; |
206 | $i = sizeof($sel); |
207 | $delfailed = true; |
208 | break; |
209 | } |
210 | $subsel = array(); |
211 | } |
212 | |
f6c945b9 |
213 | /* Queue for processing */ |
daba719e |
214 | array_push($subsel, $snick); |
215 | $prevback = $sbackend; |
ffd8224c |
216 | } |
ffd8224c |
217 | |
f6c945b9 |
218 | if (!$delfailed) { |
daba719e |
219 | $r = $abook->remove($subsel, $prevback); |
f6c945b9 |
220 | if (!$r) { /* Handle errors */ |
daba719e |
221 | $formerror = $abook->error; |
222 | $delfailed = true; |
223 | } |
ffd8224c |
224 | } |
ffd8224c |
225 | |
f6c945b9 |
226 | if ($delfailed) { |
daba719e |
227 | $showaddrlist = true; |
228 | $defselected = $orig_sel; |
ffd8224c |
229 | } |
ffd8224c |
230 | |
daba719e |
231 | } else { |
232 | |
f6c945b9 |
233 | /*********************************************** |
234 | * Update/modify address * |
235 | ***********************************************/ |
236 | if (!empty($editaddr)) { |
daba719e |
237 | |
f6c945b9 |
238 | /* Stage one: Copy data into form */ |
daba719e |
239 | if (isset($sel) && sizeof($sel) > 0) { |
240 | if(sizeof($sel) > 1) { |
241 | $formerror = _("You can only edit one address at the time"); |
242 | $showaddrlist = true; |
243 | $defselected = $sel; |
244 | } else { |
245 | $abortform = true; |
246 | list($ebackend, $enick) = explode(':', $sel[0]); |
247 | $olddata = $abook->lookup($enick, $ebackend); |
248 | |
f6c945b9 |
249 | /* Display the "new address" form */ |
07dcee9f |
250 | echo '<FORM ACTION="' . $form_url . '" METHOD="POST">' . |
f6c945b9 |
251 | "\n" . |
ac987a56 |
252 | html_tag( 'table', |
253 | html_tag( 'tr', |
254 | html_tag( 'td', |
255 | "\n". '<strong>' . _("Update address") . '</strong>' ."\n", |
256 | 'center', $color[0] ) |
257 | ), |
bd9c880b |
258 | 'center', '', 'width="100%" ' ); |
daba719e |
259 | address_form("editaddr", _("Update address"), $olddata); |
2741cc97 |
260 | echo addHidden('oldnick', $olddata['nickname']). |
62366261 |
261 | addHidden('backend', $olddata['backend']). |
2741cc97 |
262 | addHidden('doedit', '1'). |
f6c945b9 |
263 | '</FORM>'; |
daba719e |
264 | } |
265 | } else { |
266 | |
f6c945b9 |
267 | /* Stage two: Write new data */ |
268 | if ($doedit = 1) { |
daba719e |
269 | $newdata = $editaddr; |
270 | $r = $abook->modify($oldnick, $newdata, $backend); |
271 | |
f6c945b9 |
272 | /* Handle error messages */ |
273 | if (!$r) { |
274 | /* Display error */ |
ac987a56 |
275 | echo html_tag( 'table', |
276 | html_tag( 'tr', |
277 | html_tag( 'td', |
09743787 |
278 | "\n". '<strong><font color="' . $color[2] . |
ac987a56 |
279 | '">' . _("ERROR") . ': ' . $abook->error . '</font></strong>' ."\n", |
280 | 'center' ) |
281 | ), |
ac50138c |
282 | 'center', '', 'width="100%"' ); |
f6c945b9 |
283 | |
284 | /* Display the "new address" form again */ |
07dcee9f |
285 | echo '<FORM ACTION="' . $form_url . |
f6c945b9 |
286 | '" METHOD="POST">' . "\n" . |
ac987a56 |
287 | html_tag( 'table', |
288 | html_tag( 'tr', |
289 | html_tag( 'td', |
09743787 |
290 | "\n". '<strong>' . _("Update address") . '</strong>' ."\n", |
ac987a56 |
291 | 'center', $color[0] ) |
292 | ), |
09743787 |
293 | 'center', '', 'width="100%"' ); |
daba719e |
294 | address_form("editaddr", _("Update address"), $newdata); |
19347763 |
295 | echo |
2741cc97 |
296 | addHidden('oldnick', $oldnick). |
297 | addHidden('backend', $backend). |
298 | addHidden('doedit', '1'). |
f6c945b9 |
299 | "\n" . '</FORM>'; |
daba719e |
300 | $abortform = true; |
301 | } |
302 | } else { |
303 | |
f6c945b9 |
304 | /* Should not get here... */ |
daba719e |
305 | plain_error_message(_("Unknown error"), $color); |
306 | $abortform = true; |
307 | } |
308 | } |
309 | } /* !empty($editaddr) - Update/modify address */ |
310 | } /* (!empty($deladdr)) && sizeof($sel) > 0 - Delete address(es) */ |
311 | } /* !empty($addaddr['nickname']) - Add new address */ |
312 | |
313 | // Some times we end output before forms are printed |
314 | if($abortform) { |
dcc1cc82 |
315 | echo "</BODY></HTML>\n"; |
daba719e |
316 | exit(); |
ffd8224c |
317 | } |
daba719e |
318 | } |
ffd8224c |
319 | |
320 | |
f6c945b9 |
321 | /* =================================================================== * |
322 | * The following is only executed on a GET request, or on a POST when * |
323 | * a user is added, or when "delete" or "modify" was successful. * |
324 | * =================================================================== */ |
ffd8224c |
325 | |
f6c945b9 |
326 | /* Display error messages */ |
327 | if (!empty($formerror)) { |
ac987a56 |
328 | echo html_tag( 'table', |
329 | html_tag( 'tr', |
330 | html_tag( 'td', |
331 | "\n". '<br><strong><font color="' . $color[2] . |
332 | '">' . _("ERROR") . ': ' . $formerror . '</font></strong>' ."\n", |
333 | 'center' ) |
334 | ), |
ac50138c |
335 | 'center', '', 'width="100%"' ); |
daba719e |
336 | } |
ffd8224c |
337 | |
338 | |
f6c945b9 |
339 | /* Display the address management part */ |
340 | if ($showaddrlist) { |
341 | /* Get and sort address list */ |
daba719e |
342 | $alist = $abook->list_addr(); |
343 | if(!is_array($alist)) { |
ffd8224c |
344 | plain_error_message($abook->error, $color); |
345 | exit; |
daba719e |
346 | } |
ffd8224c |
347 | |
daba719e |
348 | usort($alist,'alistcmp'); |
349 | $prevbackend = -1; |
350 | $headerprinted = false; |
ffd8224c |
351 | |
ac987a56 |
352 | echo html_tag( 'p', '<a href="#AddAddress">' . _("Add address") . '</a>', 'center' ) . "\n"; |
ffd8224c |
353 | |
f6c945b9 |
354 | /* List addresses */ |
91821fc0 |
355 | if (count($alist) > 0) { |
fc93f97c |
356 | echo '<form action="' . $form_url . '" method="post">' . "\n"; |
91821fc0 |
357 | while(list($undef,$row) = each($alist)) { |
358 | |
359 | /* New table header for each backend */ |
360 | if($prevbackend != $row['backend']) { |
92cd1e8e |
361 | if($prevbackend < 0) { |
ac987a56 |
362 | echo html_tag( 'table', |
363 | html_tag( 'tr', |
364 | html_tag( 'td', |
fc93f97c |
365 | '<input type=submit name=editaddr value="' . |
366 | _("Edit selected") . "\" />\n" . |
367 | '<input type=submit name=deladdr value="' . |
368 | _("Delete selected") . "\" />\n", |
ac987a56 |
369 | 'center', '', 'colspan="5"' ) |
370 | ) . |
371 | html_tag( 'tr', |
372 | html_tag( 'td', ' <br>', 'center', '', 'colspan="5"' ) |
373 | ) , |
374 | 'center' ); |
2741cc97 |
375 | echo "\n<!-- start of address book table -->\n" . |
376 | html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cellspacing="0" width="90%"' ) . |
377 | html_tag( 'tr', "\n" . |
378 | html_tag( 'th', ' ', 'left', '', 'width="1%"' ) . "\n" . |
379 | html_tag( 'th', _("Nickname") . |
380 | " <a href=\"$form_url?abook_sort=nickname\">". |
381 | "<img src=\"../images/sort_none.png\" border=\"0\" width=\"12\" height=\"10\" alt=\"sort by nickname\" title=\"" . |
382 | _("Click here to change the sorting of the address list") . |
383 | "\" /></a>", 'left', '', 'width="1%"' ) . "\n" . |
384 | html_tag( 'th', _("Name") . |
385 | " <a href=\"$form_url?abook_sort=name\">" . |
386 | "<img src=\"../images/sort_none.png\" border=\"0\" width=\"12\" height=\"10\" " . |
387 | "alt=\"sort by name\" title=\"" . |
388 | _("Click here to change the sorting of the address list") . |
389 | "\" /></a>", 'left', '', 'width="1%"' ) . "\n" . |
390 | html_tag( 'th', _("E-mail") . |
391 | " <a href=\"$form_url?abook_sort=email\">" . |
392 | "<img src=\"../images/sort_none.png\" border=\"0\" width=\"12\" height=\"10\" " . |
393 | "alt=\"sort by email\" title=\"" . |
394 | _("Click here to change the sorting of the address list") . |
395 | "\" /></a>", 'left', '', 'width="1%"' ) . "\n" . |
396 | html_tag( 'th', _("Info") . |
397 | " <a href=\"$form_url?abook_sort=label\">" . |
398 | "<img src=\"../images/sort_none.png\" border=\"0\" width=\"12\" height=\"10\" " . |
399 | "alt=\"sort by info\" title=\"" . |
400 | _("Click here to change the sorting of the address list") . |
401 | "\" /></a>", 'left', '', 'width="1%"' ) . "\n", |
402 | '', $color[9] ) . "\n"; |
d9879e29 |
403 | } |
404 | |
2741cc97 |
405 | // Separate different backends with <hr /> |
d9879e29 |
406 | if($prevbackend > 0) { |
407 | echo html_tag( 'tr', |
408 | html_tag( 'td', "<hr />", 'center', '' ,'colspan="5"' ) |
409 | ); |
2741cc97 |
410 | } |
411 | |
412 | // Print backend name |
d9879e29 |
413 | echo html_tag( 'tr', |
414 | html_tag( 'td', "\n" . '<strong>' . $row['source'] . '</strong>' . "\n", 'center', $color[0] ,'colspan="5"' ) |
415 | ); |
416 | |
91821fc0 |
417 | $line = 0; |
418 | $headerprinted = true; |
419 | } /* End of header */ |
fc93f97c |
420 | |
91821fc0 |
421 | $prevbackend = $row['backend']; |
422 | |
423 | /* Check if this user is selected */ |
19347763 |
424 | $selected = in_array($row['backend'] . ':' . $row['nickname'], $defselected); |
91821fc0 |
425 | |
426 | /* Print one row */ |
ac987a56 |
427 | $tr_bgcolor = ''; |
428 | if ($line % 2) { $tr_bgcolor = $color[0]; } |
e842b215 |
429 | if ($squirrelmail_language == 'ja_JP') |
430 | { |
ef5bea7d |
431 | echo html_tag( 'tr', '', '', $tr_bgcolor) . |
e842b215 |
432 | html_tag( 'td', |
fc93f97c |
433 | '<small>' . |
2741cc97 |
434 | addCheckBox('sel[]', $selected, $row['backend'].':'.$row['nickname']). |
fc93f97c |
435 | '</small>' , |
e842b215 |
436 | 'center', '', 'valign="top" width="1%"' ) . |
437 | html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . |
438 | html_tag( 'td', ' ' . $row['lastname'] . ' ' . $row['firstname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . |
439 | html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' '; |
440 | } else { |
ef5bea7d |
441 | echo html_tag( 'tr', '', '', $tr_bgcolor) . |
ac987a56 |
442 | html_tag( 'td', |
fc93f97c |
443 | '<small>' . |
444 | '<input type=checkbox ' . $selected . ' name="sel[]" value="' . |
445 | $row['backend'] . ':' . $row['nickname'] . '" /></small>' , |
ac987a56 |
446 | 'center', '', 'valign="top" width="1%"' ) . |
447 | html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . |
448 | html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . |
449 | html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' '; |
e842b215 |
450 | } |
3d0cada3 |
451 | $email = $abook->full_address($row); |
d62c4938 |
452 | echo makeComposeLink('src/compose.php?send_to='.rawurlencode($email), |
453 | htmlspecialchars($row['email']) ) . |
454 | ' </td>'."\n". |
4e160237 |
455 | html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'valign="top" width="1%"' ) . |
ac987a56 |
456 | "</tr>\n"; |
91821fc0 |
457 | $line++; |
daba719e |
458 | } |
2741cc97 |
459 | echo "</table>" . |
460 | "\n<!-- end of address book table -->\n"; |
d9879e29 |
461 | |
fc93f97c |
462 | /* End of list. Add edit/delete select buttons */ |
91821fc0 |
463 | if ($headerprinted) { |
fc93f97c |
464 | echo html_tag( 'table', |
2741cc97 |
465 | html_tag( 'tr', |
466 | html_tag( 'td', |
467 | '<input type="submit" name="editaddr" value="' . _("Edit selected") . |
468 | "\" />\n" . |
469 | '<input type="submit" name="deladdr" value="' . _("Delete selected") . |
470 | "\" />\n", |
471 | 'center', '', 'colspan="5"' ) |
472 | ), |
473 | 'center' ); |
91821fc0 |
474 | } |
fc93f97c |
475 | echo "</form>\n"; |
daba719e |
476 | } |
f6c945b9 |
477 | } /* end of addresslist */ |
daba719e |
478 | |
479 | |
f6c945b9 |
480 | /* Display the "new address" form */ |
481 | echo '<a name="AddAddress"></a>' . "\n" . |
fc93f97c |
482 | '<form action="' . $form_url . '" name="f_add" method="post">' . "\n" . |
c6554ec0 |
483 | html_tag( 'table', |
ac987a56 |
484 | html_tag( 'tr', |
08188c25 |
485 | html_tag( 'td', "\n". '<strong>' . _("Add to address book") . '</strong>' . "\n", |
ac987a56 |
486 | 'center', $color[0] |
487 | ) |
488 | ) |
ac50138c |
489 | , 'center', '', 'width="100%"' ) ."\n"; |
daba719e |
490 | address_form('addaddr', _("Add address"), $defdata); |
fc93f97c |
491 | echo "</form>\n"; |
daba719e |
492 | |
f6c945b9 |
493 | /* Add hook for anything that wants on the bottom */ |
daba719e |
494 | do_hook('addressbook_bottom'); |
dcc1cc82 |
495 | ?> |
496 | |
fc93f97c |
497 | </body></html> |