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 backends in the address book. Each element
16 * is an array containing the following fields:
17 * ['BackendID'] - integer unique identifier for each source of
18 * addresses in the book. this should also be
19 * the same as the array key for this value
20 * ['BackendSource'] - description of each source of addresses
21 * ['BackendWritable'] - boolean TRUE if the address book can be
22 * modified. FALSE otherwise.
23 * ['Addresses'] - array containing address from this source.
24 * Each array element contains the following:
25 * ['FirstName'] - The entry's first name
26 * ['LastName'] - The entry's last name (surname)
27 * ['FullName'] - The entry's full name (first + last)
28 * ['NickName'] - The entry's nickname
30 * ['FullAddress'] - Email with full name or nick name
31 * optionally prepended.
32 * ['Info'] - Additional info about this contact
33 * ['Extra'] - Additional field, if provided. NULL if
34 * this field is not provided by the book.
35 * ['JSEmail'] - email address scrubbed for use with
36 * javascript functions.
38 * @copyright © 1999-2006 The SquirrelMail Project Team
39 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
41 * @package squirrelmail
42 * @subpackage templates
45 /** add required includes **/
46 include_once(SM_PATH . 'templates/util_addressbook.php');
48 /** extract template variables **/
51 /** Begin template **/
52 $source = $addresses[$current_backend];
53 $colspan = $abook_has_extra_field ? 6 : 5;
55 <div id="addressList">
56 <table cellspacing="0">
58 <td colspan=<?php echo '"'.$colspan.'"'; ?> class="header1">
59 <?php echo $source['BackendSource']; ?>
63 <td colspan="3" class="abookButtons">
64 <input type="submit" value=<?php echo '"'._("Edit selected").'"'; ?> name="editaddr" id="editaddr" />
65 <input type="submit" value=<?php echo '"'._("Delete selected").'"'; ?> name="deladdr" id="deladdr" />
67 <td colspan=<?php echo '"'.($colspan - 3).'"'; ?> class="abookSwitch">
69 if (count($backends) > 0) {
71 <select name="new_bnum">
73 foreach ($backends as $id=>$name) {
74 echo '<option value="'.$id.'"'.($id==$current_backend ? ' selected="selected"' : '').'>'.$name.'</option>'."\n";
78 <input type="submit" value=<?php echo '"'._("Change").'"'; ?> name="change_abook" id="change_abook" />
87 <td class="colHeader" style="width:1%"></td>
88 <td class="colHeader" style="width:15%"><?php echo addAbookSort('nickname'); ?></td>
89 <td class="colHeader"><?php echo addAbookSort('fullname'); ?></td>
90 <td class="colHeader"><?php echo addAbookSort('email'); ?></td>
91 <td class="colHeader"><?php echo addAbookSort('info'); ?></td>
93 if ($abook_has_extra_field) {
94 echo '<td class="colHeader"></td>';
100 if (count($source['Addresses']) == 0) {
101 echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n";
103 foreach ($source['Addresses'] as $contact) {
104 $id = $contact['NickName'] .'_'. $current_backend;
106 <tr class=<?php echo '"'.($count%2 ? 'even' : 'odd').'"'; ?>>
107 <td class="abookField" style="width:1%"><?php echo ($source['BackendWritable'] ? '<input type="checkbox" name="sel[' . $count . ']" value="'.$id.'" id="'.$id.'" />' : ''); ?></td>
108 <td class="abookField" style="width:15%"><label for=<?php echo '"'.$id.'"'; ?>><?php echo $contact['NickName']; ?></label></td>
109 <td class="abookField"><?php echo $contact['FullName']; ?></td>
110 <td class="abookField"><?php echo composeLink($contact); ?></td>
111 <td class="abookField"><?php echo $contact['Info']; ?></td>
113 if ($abook_has_extra_field) {
114 echo '<td class="abookField">'.$contact['Extra'].'</td>'."\n";