5 * Display the form elements to add/edit an entry in the address book
7 * The following variables are available in this template:
8 * $current_backend - integer containing backend currently displayed.
9 * $edit - boolean TRUE if we are editing an existing address.
10 * FALSE if the form is blank for adding a new address.
11 * $writable_backends - array of address book backends that can be written
12 * to. This will be NULL if $edit is TRUE.
13 * $values - array containing values for each field. If $edit is TRUE,
14 * elements will contains the current values for each field
15 * of the entry. If $edit is FALSE, each element will be
16 * empty. The following elements will be present:
17 * $el['FirstName'] - The entry's first name
18 * $el['LastName'] - The entry's last name (surname)
19 * $el['NickName'] - The entry's nickname
20 * $el['Email'] - The entry's email. Note that this field
22 * $el['Info'] - Additional info about this contact
24 * @copyright 1999-2014 The SquirrelMail Project Team
25 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
27 * @package squirrelmail
28 * @subpackage templates
31 /** add required includes **/
33 /** extract template variables **/
36 /** Begin template **/
37 $formname = $edit ? 'editaddr' : 'addaddr';
39 <div id="addrAddEdit">
40 <table cellspacing="0">
42 <td class="header" colspan="2">
43 <?php echo $edit ? _("Update Address") : _("Add to Address Book"); ?>
47 <td class="fieldName">
48 <label for="nickname"><?php echo _("Nickname"); ?>:</label>
51 <input type="text" name="<?php echo $formname; ?>[nickname]" id="nickname" value=<?php echo '"'.$values['NickName'].'"'; ?> size="15" />
52 <small><?php echo _("Must be unique"); ?></small>
56 <td class="fieldName">
57 <label for="email"><?php echo _("E-mail"); ?>:</label>
61 if (is_array($values['Email'])) {
62 echo '<select name="'.$formname.'[email]" id="email">'."\n";
63 foreach ($values['Email'] as $email) {
64 //FIXME: sm_encode_html_special_chars should not be needed inside any template files - I think values are already sanitized by the time they get here
65 echo '<option value="'.sm_encode_html_special_chars($email).'">'.sm_encode_html_special_chars($email).'</option>'."\n";
67 echo '</select>'."\n";
69 echo '<input type="text" name="'.$formname.'[email]" id="email" value="'.$values['Email'].'" size="45" />'."\n";
75 <td class="fieldName">
76 <label for="firstname"><?php echo _("First name"); ?>:</label>
79 <input type="text" name="<?php echo $formname; ?>[firstname]" id="firstname" value=<?php echo '"'.$values['FirstName'].'"'; ?> size="45" />
83 <td class="fieldName">
84 <label for="lastname"><?php echo _("Last name"); ?>:</label>
87 <input type="text" name="<?php echo $formname; ?>[lastname]" id="lastname" value=<?php echo '"'.$values['LastName'].'"'; ?> size="45" />
91 <td class="fieldName">
92 <label for="info"><?php echo _("Additional info"); ?>:</label>
95 <input type="text" name="<?php echo $formname; ?>[label]" id="info" value=<?php echo '"'.$values['Info'].'"'; ?> size="45" />
100 if (count($writable_backends) > 1) {
103 <td class="fieldName">
104 <label for="backend"><?php echo _("Add to:"); ?></label>
107 <select name="backend" id="backend">
109 foreach ($writable_backends as $id=>$name) {
110 //FIXME: sm_encode_html_special_chars should not be needed inside any template files - I think values are already sanitized by the time they get here
111 echo '<option value="' . $id
112 . ($current_backend == $id ? '" selected="selected"' : '"')
113 . '>' . sm_encode_html_special_chars($name) . '</option>' . "\n";
121 echo '<input type="hidden" name="backend" value="1" />'."\n";
126 <td colspan="2" class="addButton">
127 <input type="hidden" name="new_bnum" value="<?php echo $current_backend; ?>" />
128 <input type="submit" value=<?php echo '"'.($edit ? _("Update Address") : _("Add Address")).'"'; ?> name="<?php echo $formname; ?>[SUBMIT]" />