| 1 | <?php |
| 2 | /** |
| 3 | * vcard.tpl |
| 4 | * |
| 5 | * Template to display a vCard |
| 6 | * |
| 7 | * The following variables are available in this template: |
| 8 | * $view_message_link - URL to go back to the message |
| 9 | * $download_link - URL to download the vCard |
| 10 | * $nickname - Default nickname for the address book add form |
| 11 | * $firstname - First name for the address book add from |
| 12 | * $last name - Last name for the add form |
| 13 | * $email - Email for the add form |
| 14 | * $info - array of Additional info for the add form. May be |
| 15 | * empty if no additional info is provided by the |
| 16 | * card. Index of each element is the value for the |
| 17 | * option, value of each element is the name. |
| 18 | * $vcard - array containing vCard data, scrubbed and i-18-n'ed. |
| 19 | * Index of each element is the field name, value of |
| 20 | * each element is the field value. |
| 21 | * |
| 22 | * @copyright © 1999-2006 The SquirrelMail Project Team |
| 23 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
| 24 | * @version $Id$ |
| 25 | * @package squirrelmail |
| 26 | * @subpackage templates |
| 27 | */ |
| 28 | |
| 29 | /** add required includes **/ |
| 30 | |
| 31 | /** extract template variables **/ |
| 32 | extract($t); |
| 33 | |
| 34 | /** Begin template **/ |
| 35 | ?> |
| 36 | <div id="vCard"> |
| 37 | <table cellspacing="0" class="table1"> |
| 38 | <tr> |
| 39 | <td class="header1"> |
| 40 | <?php echo _("Viewing a Business Card") ; ?> - <a href="<?php echo $view_message_link; ?>"><?php echo _("View message"); ?></a> |
| 41 | </td> |
| 42 | </tr> |
| 43 | <tr> |
| 44 | <td> |
| 45 | <table cellspacing="0"> |
| 46 | <?php |
| 47 | foreach ($vcard as $field=>$value) { |
| 48 | ?> |
| 49 | <tr> |
| 50 | <td class="fieldName"> |
| 51 | <?php echo $field; ?>: |
| 52 | </td> |
| 53 | <td class="fieldValue"> |
| 54 | <?php echo $value; ?> |
| 55 | </td> |
| 56 | </tr> |
| 57 | <?php |
| 58 | } |
| 59 | ?> |
| 60 | </table> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <tr> |
| 64 | <td> |
| 65 | <a href="<?php echo $download_link; ?>"><?php echo _("Download this as a file"); ?></a> |
| 66 | </td> |
| 67 | </tr> |
| 68 | </table> |
| 69 | <form action="../src/addressbook.php" method="post" name="f_add"> |
| 70 | <input type="hidden" name="addaddr[firstname]" value="<?php echo $firstname; ?>" /> |
| 71 | <input type="hidden" name="addaddr[lastname]" value="<?php echo $lastname; ?>" /> |
| 72 | <table cellspacing="0" class="table1"> |
| 73 | <tr> |
| 74 | <td class="header1"> |
| 75 | <?php echo _("Add to address book"); ?> |
| 76 | </td> |
| 77 | </tr> |
| 78 | <tr> |
| 79 | <td> |
| 80 | <table cellspacing="0"> |
| 81 | <tr> |
| 82 | <td class="fieldName"> |
| 83 | <?php echo _("Nickname"); ?> |
| 84 | </td> |
| 85 | <td class="fieldValue"> |
| 86 | <input type="text" name="addaddr[nickname]" value="<?php echo $nickname; ?>" size="20" /> |
| 87 | </td> |
| 88 | </tr> |
| 89 | <tr> |
| 90 | <td class="fieldName"> |
| 91 | <?php echo _("Email"); ?> |
| 92 | </td> |
| 93 | <td class="fieldValue"> |
| 94 | <input type="text" name="addaddr[email]" value="<?php echo $email; ?>" size="20" /> |
| 95 | </td> |
| 96 | </tr> |
| 97 | <tr> |
| 98 | <td class="fieldName"> |
| 99 | <?php echo _("Additional Info"); ?> |
| 100 | </td> |
| 101 | <td class="fieldValue"> |
| 102 | <?php |
| 103 | if (count($info) == 0) { |
| 104 | ?> |
| 105 | <input type="text" name="addaddr[label]" value="" size="20" /> |
| 106 | <?php |
| 107 | } else { |
| 108 | ?> |
| 109 | <select name="addaddr[label]"> |
| 110 | <?php |
| 111 | foreach ($info as $value=>$field) { |
| 112 | ?> |
| 113 | <option value="<?php echo $value; ?>"><?php echo $field; ?></option> |
| 114 | <?php |
| 115 | } |
| 116 | ?> |
| 117 | </select> |
| 118 | <?php |
| 119 | } |
| 120 | ?> |
| 121 | </td> |
| 122 | </tr> |
| 123 | </table> |
| 124 | </td> |
| 125 | </tr> |
| 126 | <tr> |
| 127 | <td> |
| 128 | <input type="submit" value="<?php echo _("Add to address book"); ?>" name="addaddr[SUBMIT]" id="addaddr_SUBMIT_" /> |
| 129 | </td> |
| 130 | </tr> |
| 131 | </table> |
| 132 | </form> |
| 133 | </div> |