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 | |
33 | /** add required includes **/ |
98187795 |
34 | include_once(SM_PATH . 'templates/util_global.php'); |
3cb5a0bb |
35 | |
36 | /** extract template variables **/ |
37 | extract($t); |
38 | |
39 | /** Begin template **/ |
40 | if (count($attachments)==0) { |
41 | # If there are no attachments, display nothing. |
42 | return ''; |
43 | } |
44 | |
45 | ?> |
46 | <div class="readAttachments"> |
47 | <table cellspacing="0" class="table2"> |
48 | <tr> |
49 | <td class="header5" colspan="5"> |
50 | <?php echo _("Attachments"); ?> |
51 | </td> |
52 | </tr> |
53 | <?php |
54 | foreach ($attachments as $count=>$attachment) { |
55 | ?> |
56 | <tr class="<?php echo ($count%2 ? 'odd' : 'even'); ?>"> |
57 | <td class="attachName"> |
58 | <a href="<?php echo $attachment['DefaultHREF']; ?>"><?php echo $attachment['Name']; ?></a> |
59 | </td> |
60 | <td class="attachType"> |
61 | <small><?php echo $attachment['ContentType']; ?></small> |
62 | </td> |
63 | <td class="attachSize"> |
64 | <small><?php echo humanReadableSize($attachment['Size']); ?></small> |
65 | </td> |
66 | <td class="attachDesc"> |
67 | <small><?php echo $attachment['Description']; ?></small> |
68 | </td> |
69 | <td class="attachActions"> |
70 | <small> |
71 | <a href="<?php echo $attachment['DownloadHREF']; ?>"><?php echo _("Download"); ?></a> |
72 | <?php |
73 | if (!empty($attachment['ViewHREF'])) { |
74 | ?> |
75 | | |
76 | <a href="<?php echo $attachment['ViewHREF']; ?>"><?php echo _("View"); ?></a> |
77 | <?php |
78 | } |
98187795 |
79 | |
3cb5a0bb |
80 | foreach ($attachment['OtherLinks'] as $link) { |
81 | ?> |
82 | | |
83 | <a href="<?php echo $link['HREF']; ?>"><?php echo $link['Text']; ?></a> |
84 | <?php |
85 | } |
86 | ?> |
87 | </small> |
88 | </td> |
89 | </tr> |
90 | <?php |
91 | } |
98187795 |
92 | |
3cb5a0bb |
93 | if (!empty($plugin_output['attachments_bottom'])) echo $plugin_output['attachments_bottom']; |
94 | ?> |
95 | </table> |
96 | <table cellspacing="0" class="spacer"> |
97 | <tr> |
98 | <td> |
99 | </td> |
100 | </tr> |
101 | </table> |
102 | </div> |