3cb5a0bb |
1 | <?php |
2 | /** |
3 | * read_attachments.tpl |
4 | * |
5 | * Template used to generate the attachment list while reading a message. This |
6 | * template is called from the function formatAttachments() in functions/mime.php. |
98187795 |
7 | * |
3cb5a0bb |
8 | * The following variables are available in this template: |
9 | * $attachments - array containing info for all message attachments. Each |
10 | * element in the array represents a separate attachment and |
11 | * contains the following elements: |
12 | * $el['Name'] - The name of the attachment |
13 | * $el['Description'] - Description of the attachment |
14 | * $el['DefaultHREF'] - URL to the action that should occur when the name is clicked |
15 | * $el['DownloadHREF'] - URL to download the attachment |
16 | * $el['ViewHREF'] - URL to view the attachment. Empty if not available. |
17 | * $el['Size'] - Size of attachment in bytes. |
18 | * $el['ContentType'] - Content-Type of the attachment |
19 | * $el['OtherLinks'] - array containing links to any other actions |
20 | * available for this attachment that might be |
21 | * provided by plugins, for example. Each element represents |
22 | * a different action and contains the following elements: |
23 | * $link['HREF'] - URL to access the functionality |
24 | * $link['Text'] - Text representing the functionality. |
25 | * |
26 | * @copyright © 1999-2006 The SquirrelMail Project Team |
27 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
28 | * @version $Id$ |
29 | * @package squirrelmail |
30 | * @subpackage templates |
31 | */ |
32 | |
3cb5a0bb |
33 | |
34 | /** extract template variables **/ |
35 | extract($t); |
36 | |
37 | /** Begin template **/ |
38 | if (count($attachments)==0) { |
39 | # If there are no attachments, display nothing. |
40 | return ''; |
41 | } |
42 | |
43 | ?> |
44 | <div class="readAttachments"> |
45 | <table cellspacing="0" class="table2"> |
46 | <tr> |
47 | <td class="header5" colspan="5"> |
48 | <?php echo _("Attachments"); ?> |
49 | </td> |
50 | </tr> |
51 | <?php |
52 | foreach ($attachments as $count=>$attachment) { |
53 | ?> |
54 | <tr class="<?php echo ($count%2 ? 'odd' : 'even'); ?>"> |
55 | <td class="attachName"> |
56 | <a href="<?php echo $attachment['DefaultHREF']; ?>"><?php echo $attachment['Name']; ?></a> |
57 | </td> |
58 | <td class="attachType"> |
59 | <small><?php echo $attachment['ContentType']; ?></small> |
60 | </td> |
61 | <td class="attachSize"> |
62 | <small><?php echo humanReadableSize($attachment['Size']); ?></small> |
63 | </td> |
64 | <td class="attachDesc"> |
65 | <small><?php echo $attachment['Description']; ?></small> |
66 | </td> |
67 | <td class="attachActions"> |
68 | <small> |
69 | <a href="<?php echo $attachment['DownloadHREF']; ?>"><?php echo _("Download"); ?></a> |
70 | <?php |
71 | if (!empty($attachment['ViewHREF'])) { |
72 | ?> |
73 | | |
74 | <a href="<?php echo $attachment['ViewHREF']; ?>"><?php echo _("View"); ?></a> |
75 | <?php |
76 | } |
98187795 |
77 | |
3cb5a0bb |
78 | foreach ($attachment['OtherLinks'] as $link) { |
79 | ?> |
80 | | |
81 | <a href="<?php echo $link['HREF']; ?>"><?php echo $link['Text']; ?></a> |
82 | <?php |
83 | } |
84 | ?> |
85 | </small> |
86 | </td> |
87 | </tr> |
88 | <?php |
89 | } |
98187795 |
90 | |
3cb5a0bb |
91 | if (!empty($plugin_output['attachments_bottom'])) echo $plugin_output['attachments_bottom']; |
92 | ?> |
93 | </table> |
94 | <table cellspacing="0" class="spacer"> |
95 | <tr> |
96 | <td> |
97 | </td> |
98 | </tr> |
99 | </table> |
d281e128 |
100 | </div> |