introduce new constant SM_COPYRIGHT that has the copyright years
[squirrelmail.git] / templates / default / addressbook_list.tpl
1 <?php
2 /**
3 * addressbook_list.tpl
4 *
5 * Template for the basic address book list
6 *
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
10 * selection drop down
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
28 * $el['Email'] - duh
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.
34 * $el['JSEmail'] - email address scrubbed for use with
35 * javascript functions.
36 *
37 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
38 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
39 * @version $Id$
40 * @package squirrelmail
41 * @subpackage templates
42 */
43
44 /** add required includes **/
45 include_once(SM_PATH . 'templates/util_addressbook.php');
46
47 /** extract template variables **/
48 extract($t);
49
50 /** Begin template **/
51 $source = $addresses[$current_backend];
52 $colspan = $abook_has_extra_field ? 6 : 5;
53 ?>
54 <div id="addressList">
55 <table cellspacing="0">
56 <tr>
57 <td colspan=<?php echo '"'.$colspan.'"'; ?> class="header1">
58 <?php echo $source['BackendSource']; ?>
59 </td>
60 </tr>
61 <tr>
62 <td colspan="3" class="abookButtons">
63 <input type="submit" value=<?php echo '"'._("Edit selected").'"'; ?> name="editaddr" id="editaddr" />
64 <input type="submit" value=<?php echo '"'._("Delete selected").'"'; ?> name="deladdr" id="deladdr" />
65 </td>
66 <td colspan=<?php echo '"'.($colspan - 3).'"'; ?> class="abookSwitch">
67 <?php
68 if (count($backends) > 0) {
69 ?>
70 <select name="new_bnum">
71 <?php
72 foreach ($backends as $id=>$name) {
73 echo '<option value="'.$id.'"'.($id==$current_backend ? ' selected="selected"' : '').'>'.$name.'</option>'."\n";
74 }
75 ?>
76 </select>
77 <input type="submit" value=<?php echo '"'._("Change").'"'; ?> name="change_abook" id="change_abook" />
78 <?php
79 } else {
80 echo '&nbsp;';
81 }
82 ?>
83 </td>
84 </tr>
85 <tr>
86 <td class="colHeader" style="width:1%"></td>
87 <td class="colHeader" style="width:15%"><?php echo addAbookSort('nickname'); ?></td>
88 <td class="colHeader"><?php echo addAbookSort('fullname'); ?></td>
89 <td class="colHeader"><?php echo addAbookSort('email'); ?></td>
90 <td class="colHeader"><?php echo addAbookSort('info'); ?></td>
91 <?php
92 if ($abook_has_extra_field) {
93 echo '<td class="colHeader"></td>';
94 }
95 ?>
96 </tr>
97 <?php
98 $count = 1;
99 if (count($source['Addresses']) == 0) {
100 echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n";
101 }
102 foreach ($source['Addresses'] as $contact) {
103 $id = $contact['NickName'] .'_'. $current_backend;
104 ?>
105 <tr class=<?php echo '"'.($count%2 ? 'even' : 'odd').'"'; ?>>
106 <td class="abookField" style="width:1%"><?php echo ($source['BackendWritable'] ? '<input type="checkbox" name="sel[]" value="'.$id.'" id="'.$id.'" />' : ''); ?></td>
107 <td class="abookField" style="width:15%"><label for=<?php echo '"'.$id.'"'; ?>><?php echo $contact['NickName']; ?></label></td>
108 <td class="abookField"><?php echo $contact['FullName']; ?></td>
109 <td class="abookField"><?php echo composeLink($contact); ?></td>
110 <td class="abookField"><?php echo $contact['Info']; ?></td>
111 <?php
112 if ($abook_has_extra_field) {
113 echo '<td class="abookField">'.$contact['Extra'].'</td>'."\n";
114 }
115 ?>
116 </tr>
117 <?php
118 $count++;
119 }
120 ?>
121 </table>
122 </div>