Use sqsession_* instead of session_*
[squirrelmail.git] / templates / default / addrbook_addedit.tpl
index 8164aa75d26e581751420002970b7eb63b4fdbb5..87f03ec3795b0561c5ac42d3e3dca6ef1c29075c 100644 (file)
@@ -5,6 +5,7 @@
  * Display the form elements to add/edit an entry in the address book
  * 
  * The following variables are available in this template:
+ *      $current_backend - integer containing backend currently displayed.
  *      $edit       - boolean TRUE if we are editing an existing address.
  *                    FALSE if the form is blank for adding a new address.
  *      $writable_backends - array of address book backends that can be written
@@ -20,7 +21,7 @@
  *                                 could be an array!
  *              $el['Info']      - Additional info about this contact
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2012 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -39,7 +40,7 @@ $formname = $edit ? 'editaddr' : 'addaddr';
 <table cellspacing="0">
  <tr>
   <td class="header" colspan="2">
-   <?php echo $edit ? _("Update address") : _("Add to address book"); ?>
+   <?php echo $edit ? _("Update Address") : _("Add to Address Book"); ?>
   </td>
  </tr>
  <tr>
@@ -60,6 +61,7 @@ $formname = $edit ? 'editaddr' : 'addaddr';
     if (is_array($values['Email'])) {
         echo '<select name="'.$formname.'[email]" id="email">'."\n";
         foreach ($values['Email'] as $email) {
+//FIXME: htmlspecialchars should not be needed inside any template files - I think values are already sanitized by the time they get here
             echo '<option value="'.htmlspecialchars($email).'">'.htmlspecialchars($email).'</option>'."\n";
         }
         echo '</select>'."\n";
@@ -105,7 +107,10 @@ $formname = $edit ? 'editaddr' : 'addaddr';
    <select name="backend" id="backend">
     <?php
         foreach ($writable_backends as $id=>$name) {
-            echo '<option value="'.$id.'">'.htmlspecialchars($name).'</option>'."\n";
+//FIXME: htmlspecialchars should not be needed inside any template files - I think values are already sanitized by the time they get here
+            echo '<option value="' . $id
+               . ($current_backend == $id ? '" selected="selected"' : '"')
+               . '>' . htmlspecialchars($name) . '</option>' . "\n";
         }
     ?>
    </select>
@@ -113,14 +118,15 @@ $formname = $edit ? 'editaddr' : 'addaddr';
  </tr>
             <?php
         } else {
-            echo '<input type="hidden" name="backend" value="1">'."\n";
+            echo '<input type="hidden" name="backend" value="1" />'."\n";
         }
     }
  ?>
  <tr>
   <td colspan="2" class="addButton">
-   <input type="submit" value=<?php echo '"'.($edit ? _("Update address") : _("Add address")).'"'; ?> name="<?php echo $formname; ?>[SUBMIT]" />
+   <input type="hidden" name="new_bnum" value="<?php echo $current_backend; ?>" />
+   <input type="submit" value=<?php echo '"'.($edit ? _("Update Address") : _("Add Address")).'"'; ?> name="<?php echo $formname; ?>[SUBMIT]" />
   </td>
  </tr>
 </table>
-</div>
\ No newline at end of file
+</div>