Happy New Year
[squirrelmail.git] / templates / default / addrbook_search_list.tpl
CommitLineData
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 *
353d074a 26 * @copyright 1999-2018 The SquirrelMail Project Team
3f92c0c7 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 **/
36extract($t);
37
38/** Begin template **/
39$colspan = $include_abook_name ? 5 : 4;
40?>
41<?php
0885e0d7 42if ($javascript_on) {
3f92c0c7 43 insert_javascript();
44}
45?>
46<div id="addressList">
47<table cellspacing="0">
48 <tr>
0885e0d7 49 <td class="colHeader" style="width:1%; font-size: 8pt; white-space: nowrap;">
50<?php
51if ($javascript_on && !$compose_addr_pop) {
52?>
53 <input type="checkbox" id="checkAllTo" onClick="CheckAll('T');"><label for="checkAllTo"><?php echo _("All");?></label> &nbsp;
54 <input type="checkbox" id="checkAllCc" onClick="CheckAll('C');"><label for="checkAllCc"><?php echo _("Cc");?></label> &nbsp;
55 <input type="checkbox" id="checkAllBcc" onClick="CheckAll('B');"><label for="checkAllBcc"><?php echo _("Bcc");?></label>
56<?php
57}
58?>
59 </td>
3f92c0c7 60 <td class="colHeader"><?php echo _("Name"); ?></td>
61 <td class="colHeader"><?php echo _("E-mail"); ?></td>
62 <td class="colHeader"><?php echo _("Info"); ?></td>
63 <?php
64 if ($include_abook_name) {
65 echo '<td class="colHeader">'. _("Source") .'</td>';
66 }
67 ?>
68 </tr>
69 <?php
70 if (count($addresses) == 0) {
71 echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n";
72 }
0885e0d7 73
74 if ($compose_addr_pop) {
75 $addr_str = '<a href="javascript:to_and_close(\'%1$s\')">%1$s</a>';
76 } else {
77 $addr_str = '%1$s';
78 }
79
3f92c0c7 80 foreach ($addresses as $index=>$contact) {
81 ?>
82 <tr class=<?php echo '"'.(($index+1)%2 ? 'even' : 'odd').'"'; ?>>
83 <td class="abookCompose" style="width:1%">
84 <?php
0885e0d7 85 if ($compose_addr_pop) {
3f92c0c7 86 ?>
87 <a href="javascript:to_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("To"); ?></a> |
88 <a href="javascript:cc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Cc"); ?></a> |
89 <a href="javascript:bcc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Bcc"); ?></a>
90 <?php
91 } else {
92 ?>
b116fd78 93 <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>
94 <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>
95 <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>
3f92c0c7 96 <?php
97 }
98 ?>
99 </td>
100 <td class="abookField"><?php echo $contact['FullName']; ?></td>
0885e0d7 101 <td class="abookField"><?php echo sprintf($addr_str, $contact['Email']); ?></td>
3f92c0c7 102 <td class="abookField"><?php echo $contact['Info']; ?></td>
103 <?php
104 if ($include_abook_name) {
105 echo '<td class="abookField">'.$contact['Source'].'</td>'."\n";
106 }
107 ?>
108 </tr>
109 <?php
110 }
111?>
112</table>
113<?php
0885e0d7 114if (!$compose_addr_pop) {
3f92c0c7 115 echo '<input type="submit" name="addr_search_done" value="'. _("Use Addresses") .'" />'."\n";
116 echo '<input type="submit" name="addr_search_cancel" value="'. _("Cancel") .'" />'."\n";
0885e0d7 117} else {
118 echo '<input type="submit" onClick="javascript:parent.close();" name="close_window" value="' . _("Close Window") . '" />'. "\n";
3f92c0c7 119}
120?>
b116fd78 121</div>