Happy New Year
[squirrelmail.git] / templates / default / read_attachments.tpl
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.
7 *
8 * The following variables are available in this template:
9 * $plugin_output array An array of extra output that may be added by plugin(s).
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 *
27 * @copyright 1999-2020 The SquirrelMail Project Team
28 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
29 * @version $Id$
30 * @package squirrelmail
31 * @subpackage templates
32 */
33
34
35 /** extract template variables **/
36 extract($t);
37
38 /** Begin template **/
39 if (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">
49 <?php
50 echo _("Attachments");
51 if (!empty($plugin_output['attachments_top'])) echo $plugin_output['attachments_top'];
52 ?>
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 }
81
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 }
94
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>
104 </div>