3f92c0c7 |
1 | <?php |
2 | /** |
3 | * addrbook_search_list.tpl |
4 | * |
5 | * Display a list of addresses from the search forms |
6 | * |
7 | * The following variables are available in this template: |
8 | * $use_js - boolean TRUE if we should use Javascript in this book. |
9 | * $include_abook_name - boolean TRUE if the resuls should also display |
10 | * the name of the address book the result is in. |
11 | * $addresses - array containing search results. Each element contains the |
12 | * following fields: |
13 | * $el['FirstName'] - The entry's first name |
14 | * $el['LastName'] - The entry's last name (surname) |
15 | * $el['FullName'] - The entry's full name (first + last) |
16 | * $el['NickName'] - The entry's nickname |
17 | * $el['Email'] - duh |
18 | * $el['FullAddress'] - Email with full name or nick name |
19 | * optionally prepended. |
20 | * $el['Info'] - Additional info about this contact |
21 | * $el['Extra'] - Additional field, if provided. NULL if this |
22 | * field is not provided by the book. |
23 | * $el['JSEmail'] - email address scrubbed for use with |
24 | * javascript functions. |
25 | * |
26 | * @copyright © 1999-2006 The SquirrelMail Project Team |
27 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
28 | * @version $Id$ |
29 | * @package squirrelmail |
30 | * @subpackage templates |
31 | */ |
32 | |
33 | /** add required includes **/ |
34 | |
35 | /** extract template variables **/ |
36 | extract($t); |
37 | |
38 | /** Begin template **/ |
39 | $colspan = $include_abook_name ? 5 : 4; |
40 | ?> |
41 | <?php |
42 | if ($use_js) { |
43 | insert_javascript(); |
44 | } |
45 | ?> |
46 | <div id="addressList"> |
47 | <table cellspacing="0"> |
48 | <tr> |
49 | <td class="colHeader" style="width:1%"></td> |
50 | <td class="colHeader"><?php echo _("Name"); ?></td> |
51 | <td class="colHeader"><?php echo _("E-mail"); ?></td> |
52 | <td class="colHeader"><?php echo _("Info"); ?></td> |
53 | <?php |
54 | if ($include_abook_name) { |
55 | echo '<td class="colHeader">'. _("Source") .'</td>'; |
56 | } |
57 | ?> |
58 | </tr> |
59 | <?php |
60 | if (count($addresses) == 0) { |
61 | echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n"; |
62 | } |
63 | foreach ($addresses as $index=>$contact) { |
64 | ?> |
65 | <tr class=<?php echo '"'.(($index+1)%2 ? 'even' : 'odd').'"'; ?>> |
66 | <td class="abookCompose" style="width:1%"> |
67 | <?php |
68 | if ($use_js) { |
69 | ?> |
70 | <a href="javascript:to_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("To"); ?></a> | |
71 | <a href="javascript:cc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Cc"); ?></a> | |
72 | <a href="javascript:bcc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Bcc"); ?></a> |
73 | <?php |
74 | } else { |
75 | ?> |
76 | <input type="checkbox" name=<?php echo '"send_to_search[T'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_T'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_T'.$index.'_"'; ?>><?php echo _("To"); ?></label> |
77 | <input type="checkbox" name=<?php echo '"send_to_search[C'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_C'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_C'.$index.'_"'; ?>><?php echo _("Cc"); ?></label> |
78 | <input type="checkbox" name=<?php echo '"send_to_search[B'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_B'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_B'.$index.'_"'; ?>><?php echo _("Bcc"); ?></label> |
79 | <?php |
80 | } |
81 | ?> |
82 | </td> |
83 | <td class="abookField"><?php echo $contact['FullName']; ?></td> |
84 | <td class="abookField"><a href="javascript:to_and_close('<?php echo $contact['JSEmail']; ?>')"><?php echo $contact['Email']; ?></a></td> |
85 | <td class="abookField"><?php echo $contact['Info']; ?></td> |
86 | <?php |
87 | if ($include_abook_name) { |
88 | echo '<td class="abookField">'.$contact['Source'].'</td>'."\n"; |
89 | } |
90 | ?> |
91 | </tr> |
92 | <?php |
93 | } |
94 | ?> |
95 | </table> |
96 | <?php |
97 | if (!$use_js) { |
98 | echo '<input type="submit" name="addr_search_done" value="'. _("Use Addresses") .'" />'."\n"; |
99 | echo '<input type="submit" name="addr_search_cancel" value="'. _("Cancel") .'" />'."\n"; |
100 | } |
101 | ?> |
102 | </div> |