a88fa973 |
1 | <?php |
2 | /** |
3 | * vcard.tpl |
4 | * |
2ba2e2b8 |
5 | * Template to display a vCard |
a88fa973 |
6 | * |
7 | * The following variables are available in this template: |
2ba2e2b8 |
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. |
a88fa973 |
21 | * |
ae5dddc0 |
22 | * @copyright 1999-2011 The SquirrelMail Project Team |
a88fa973 |
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"> |
199a9ab8 |
70 | <input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" /> |
a88fa973 |
71 | <input type="hidden" name="addaddr[firstname]" value="<?php echo $firstname; ?>" /> |
72 | <input type="hidden" name="addaddr[lastname]" value="<?php echo $lastname; ?>" /> |
73 | <table cellspacing="0" class="table1"> |
74 | <tr> |
75 | <td class="header1"> |
76 | <?php echo _("Add to address book"); ?> |
77 | </td> |
78 | </tr> |
79 | <tr> |
80 | <td> |
81 | <table cellspacing="0"> |
82 | <tr> |
83 | <td class="fieldName"> |
84 | <?php echo _("Nickname"); ?> |
85 | </td> |
86 | <td class="fieldValue"> |
87 | <input type="text" name="addaddr[nickname]" value="<?php echo $nickname; ?>" size="20" /> |
88 | </td> |
89 | </tr> |
90 | <tr> |
91 | <td class="fieldName"> |
92 | <?php echo _("Email"); ?> |
93 | </td> |
94 | <td class="fieldValue"> |
95 | <input type="text" name="addaddr[email]" value="<?php echo $email; ?>" size="20" /> |
96 | </td> |
97 | </tr> |
98 | <tr> |
99 | <td class="fieldName"> |
100 | <?php echo _("Additional Info"); ?> |
101 | </td> |
102 | <td class="fieldValue"> |
103 | <?php |
104 | if (count($info) == 0) { |
105 | ?> |
106 | <input type="text" name="addaddr[label]" value="" size="20" /> |
107 | <?php |
108 | } else { |
109 | ?> |
110 | <select name="addaddr[label]"> |
111 | <?php |
112 | foreach ($info as $value=>$field) { |
113 | ?> |
114 | <option value="<?php echo $value; ?>"><?php echo $field; ?></option> |
115 | <?php |
116 | } |
117 | ?> |
118 | </select> |
119 | <?php |
120 | } |
121 | ?> |
122 | </td> |
123 | </tr> |
124 | </table> |
125 | </td> |
126 | </tr> |
127 | <tr> |
128 | <td> |
129 | <input type="submit" value="<?php echo _("Add to address book"); ?>" name="addaddr[SUBMIT]" id="addaddr_SUBMIT_" /> |
130 | </td> |
131 | </tr> |
132 | </table> |
133 | </form> |
199a9ab8 |
134 | </div> |