Happy New Year
[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:
4ed45b62 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 * $link['Extra'] - Any extra anchor tag attributes provided by a plugin
3cb5a0bb 27 *
77a1e3d1 28 * @copyright 1999-2022 The SquirrelMail Project Team
3cb5a0bb 29 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
30 * @version $Id$
31 * @package squirrelmail
32 * @subpackage templates
33 */
34
3cb5a0bb 35
36/** extract template variables **/
37extract($t);
38
39/** Begin template **/
40if (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">
b9a873d7 50 <?php
51 echo _("Attachments");
52 if (!empty($plugin_output['attachments_top'])) echo $plugin_output['attachments_top'];
53 ?>
3cb5a0bb 54 </td>
55 </tr>
56 <?php
57 foreach ($attachments as $count=>$attachment) {
58 ?>
59 <tr class="<?php echo ($count%2 ? 'odd' : 'even'); ?>">
60 <td class="attachName">
61 <a href="<?php echo $attachment['DefaultHREF']; ?>"><?php echo $attachment['Name']; ?></a>
62 </td>
63 <td class="attachType">
64 <small><?php echo $attachment['ContentType']; ?></small>
65 </td>
66 <td class="attachSize">
67 <small><?php echo humanReadableSize($attachment['Size']); ?></small>
68 </td>
69 <td class="attachDesc">
70 <small><?php echo $attachment['Description']; ?></small>
71 </td>
72 <td class="attachActions">
73 <small>
74 <a href="<?php echo $attachment['DownloadHREF']; ?>"><?php echo _("Download"); ?></a>
75 <?php
76 if (!empty($attachment['ViewHREF'])) {
77 ?>
78 &nbsp;|&nbsp;
79 <a href="<?php echo $attachment['ViewHREF']; ?>"><?php echo _("View"); ?></a>
80 <?php
81 }
98187795 82
3cb5a0bb 83 foreach ($attachment['OtherLinks'] as $link) {
00b933ad 84 echo '&nbsp;|&nbsp;';
85 if (empty($link['HREF']))
86 echo '<span ' . $link['Extra'] . '>' . $link['Text'] . '</span>';
87 else
88 echo '<a href="' . $link['HREF'] . '" ' . $link['Extra'] . '>' . $link['Text'] . '</a>';
3cb5a0bb 89 }
90 ?>
91 </small>
92 </td>
93 </tr>
94 <?php
95 }
98187795 96
3cb5a0bb 97 if (!empty($plugin_output['attachments_bottom'])) echo $plugin_output['attachments_bottom'];
98 ?>
99</table>
100<table cellspacing="0" class="spacer">
101 <tr>
102 <td>
103 </td>
104 </tr>
105</table>
d281e128 106</div>