5 * Template for the basic address book list
7 * The following variables are available in this template:
8 * $current_backend - integer containing backend currently displayed.
9 * $abook_select - string containing HTML to display the address book
11 * $abook_has_extra_field - boolean TRUE if the address book contains an
12 * additional field. FALSE otherwise.
13 * $backends - array containing all available backends for selection.
14 * This will be empty if only 1 backend is available!
15 * $addresses - array of addresses in the address book. Each element
16 * is an array containing the following fields:
17 * $el['BackendID'] - integer unique identifier for each source of
18 * addresses in the book
19 * $el['BackendSource'] - description of each source of addresses
20 * $el['BackendWritable'] - boolean TRUE if the address book can be
21 * modified. FALSE otherwise.
22 * $el['Addresses'] - array containing address from this source.
23 * Each array element contains the following:
24 * $el['FirstName'] - The entry's first name
25 * $el['LastName'] - The entry's last name (surname)
26 * $el['FullName'] - The entry's full name (first + last)
27 * $el['NickName'] - The entry's nickname
29 * $el['FullAddress'] - Email with full name or nick name
30 * optionally prepended.
31 * $el['Info'] - Additional info about this contact
32 * $el['Extra'] - Additional field, if provided. NULL if this
33 * field is not provided by the book.
35 * @copyright © 1999-2006 The SquirrelMail Project Team
36 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
38 * @package squirrelmail
39 * @subpackage templates
42 /** add required includes **/
43 include_once(SM_PATH . 'templates/util_addressbook.php');
45 /** extract template variables **/
48 #echo dump_array($addresses).'<br>';
49 /** Begin template **/
50 $source = $addresses[$current_backend];
51 $colspan = $abook_has_extra_field ? 6 : 5;
53 <div id="addressList">
54 <table cellspacing="0">
56 <td colspan=<?php echo '"'.$colspan.'"'; ?> class="header1">
57 <?php echo $source['BackendSource']; ?>
61 <td colspan="3" class="abookButtons">
62 <input type="submit" value=<?php echo '"'._("Edit selected").'"'; ?> name="editaddr" id="editaddr" />
63 <input type="submit" value=<?php echo '"'._("Delete selected").'"'; ?> name="deladdr" id="deladdr" />
65 <td colspan=<?php echo '"'.($colspan - 3).'"'; ?> class="abookSwitch">
67 if (count($backends) > 0) {
69 <select name="new_bnum">
71 foreach ($backends as $id=>$name) {
72 echo '<option value="'.$id.'"'.($id==$current_backend ? ' selected="selected"' : '').'>'.$name.'</option>'."\n";
76 <input type="submit" value=<?php echo '"'._("Change").'"'; ?> name="change_abook" id="change_abook" />
85 <td class="colHeader" style="width:1%"></td>
86 <td class="colHeader" style="width:15%"><?php echo addAbookSort('nickname'); ?></td>
87 <td class="colHeader"><?php echo addAbookSort('fullname'); ?></td>
88 <td class="colHeader"><?php echo addAbookSort('email'); ?></td>
89 <td class="colHeader"><?php echo addAbookSort('info'); ?></td>
91 if ($abook_has_extra_field) {
92 echo '<td class="colHeader"></td>';
98 if (count($source['Addresses']) == 0) {
99 echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n";
101 foreach ($source['Addresses'] as $contact) {
102 $id = $current_backend.':'.$contact['NickName'];
104 <tr class=<?php echo '"'.($count%2 ? 'even' : 'odd').'"'; ?>>
105 <td class="abookField" style="width:1%"><?php echo ($source['BackendWritable'] ? '<input type="checkbox" name="sel[]" value="'.$id.'" id="'.$id.'" />' : ''); ?></td>
106 <td class="abookField" style="width:15%"><label for=<?php echo '"'.$id.'"'; ?>><?php echo $contact['NickName']; ?></lable></td>
107 <td class="abookField"><?php echo $contact['FullName']; ?></td>
108 <td class="abookField"><?php echo composeLink($contact); ?></td>
109 <td class="abookField"><?php echo $contact['Info']; ?></td>
111 if ($abook_has_extra_field) {
112 echo '<td class="abookField">'.$contact['Extra'].'</td>'."\n";