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