5 * Display the form elements to add/edit an entry in the address book
7 * The following variables are available in this template:
8 * $edit - boolean TRUE if we are editing an existing address.
9 * FALSE if the form is blank for adding a new address.
10 * $writable_backends - array of address book backends that can be written
11 * to. This will be NULL if $edit is TRUE.
12 * $values - array containing values for each field. If $edit is TRUE,
13 * elements will contains the current values for each field
14 * of the entry. If $edit is FALSE, each element will be
15 * empty. The following elements will be present:
16 * $el['FirstName'] - The entry's first name
17 * $el['LastName'] - The entry's last name (surname)
18 * $el['NickName'] - The entry's nickname
19 * $el['Email'] - The entry's email. Note that this field
21 * $el['Info'] - Additional info about this contact
23 * @copyright © 1999-2006 The SquirrelMail Project Team
24 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
26 * @package squirrelmail
27 * @subpackage templates
30 /** add required includes **/
32 /** extract template variables **/
35 /** Begin template **/
36 $formname = $edit ? 'editaddr' : 'addaddr';
38 <div id="addrAddEdit">
39 <table cellspacing="0">
41 <td class="header" colspan="2">
42 <?php echo $edit ? _("Update address") : _("Add to address book"); ?>
46 <td class="fieldName">
47 <label for="nickname"><?php echo _("Nickname"); ?>:</label>
50 <input type="text" name="<?php echo $formname; ?>[nickname]" id="nickname" value=<?php echo '"'.$values['NickName'].'"'; ?> size="15" />
51 <small><?php echo _("Must be unique"); ?></small>
55 <td class="fieldName">
56 <label for="email"><?php echo _("E-mail"); ?>:</label>
60 if (is_array($values['Email'])) {
61 echo '<select name="'.$formname.'[email]" id="email">'."\n";
62 foreach ($values['Email'] as $email) {
63 echo '<option value="'.htmlspecialchars($email).'">'.htmlspecialchars($email).'</option>'."\n";
65 echo '</select>'."\n";
67 echo '<input type="text" name="'.$formname.'[email]" id="email" value="'.$values['Email'].'" size="45" />'."\n";
73 <td class="fieldName">
74 <label for="firstname"><?php echo _("First name"); ?>:</label>
77 <input type="text" name="<?php echo $formname; ?>[firstname]" id="firstname" value=<?php echo '"'.$values['FirstName'].'"'; ?> size="45" />
81 <td class="fieldName">
82 <label for="lastname"><?php echo _("Last name"); ?>:</label>
85 <input type="text" name="<?php echo $formname; ?>[lastname]" id="lastname" value=<?php echo '"'.$values['LastName'].'"'; ?> size="45" />
89 <td class="fieldName">
90 <label for="info"><?php echo _("Additional info"); ?>:</label>
93 <input type="text" name="<?php echo $formname; ?>[label]" id="info" value=<?php echo '"'.$values['Info'].'"'; ?> size="45" />
98 if (count($writable_backends) > 1) {
101 <td class="fieldName">
102 <label for="backend"><?php echo _("Add to:"); ?></label>
105 <select name="backend" id="backend">
107 foreach ($writable_backends as $id=>$name) {
108 echo '<option value="'.$id.'">'.htmlspecialchars($name).'</option>'."\n";
116 echo '<input type="hidden" name="backend" value="1" />'."\n";
121 <td colspan="2" class="addButton">
122 <input type="submit" value=<?php echo '"'.($edit ? _("Update address") : _("Add address")).'"'; ?> name="<?php echo $formname; ?>[SUBMIT]" />