fsf changes, meant to be rebased on upstream
[squirrelmail.git] / templates / default / read_attachments.tpl
index f41f78616242608c753b6a54568049e249ee7f73..8984aec211739faaa47cdbede5bdda4357b959e2 100644 (file)
@@ -6,32 +6,32 @@
  * template is called from the function formatAttachments() in functions/mime.php.
  *
  * The following variables are available in this template:
+ *    $plugin_output  array  An array of extra output that may be added by plugin(s).
  *    $attachments - array containing info for all message attachments.  Each
  *                   element in the array represents a separate attachment and
  *                   contains the following elements:
- *       $el['Name']         - The name of the attachment
- *       $el['Description']  - Description of the attachment
- *       $el['DefaultHREF']  - URL to the action that should occur when the name is clicked
- *       $el['DownloadHREF'] - URL to download the attachment
- *       $el['ViewHREF']     - URL to view the attachment.  Empty if not available.
- *       $el['Size']         - Size of attachment in bytes.
- *       $el['ContentType']  - Content-Type of the attachment
- *       $el['OtherLinks']   - array containing links to any other actions
- *                             available for this attachment that might be
- *                             provided by plugins, for example.  Each element represents
- *                             a different action and contains the following elements:
- *            $link['HREF'] - URL to access the functionality
- *            $link['Text'] - Text representing the functionality.
+ *       $el['Name']          - The name of the attachment
+ *       $el['Description']   - Description of the attachment
+ *       $el['DefaultHREF']   - URL to the action that should occur when the name is clicked
+ *       $el['DownloadHREF']  - URL to download the attachment
+ *       $el['ViewHREF']      - URL to view the attachment.  Empty if not available.
+ *       $el['Size']          - Size of attachment in bytes.
+ *       $el['ContentType']   - Content-Type of the attachment
+ *       $el['OtherLinks']    - array containing links to any other actions
+ *                              available for this attachment that might be
+ *                              provided by plugins, for example.  Each element represents
+ *                              a different action and contains the following elements:
+ *            $link['HREF']  - URL to access the functionality
+ *            $link['Text']  - Text representing the functionality
+ *            $link['Extra'] - Any extra anchor tag attributes provided by a plugin
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2022 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  * @subpackage templates
  */
 
-/** add required includes **/
-include_once(SM_PATH . 'templates/util_global.php');
 
 /** extract template variables **/
 extract($t);
@@ -47,7 +47,10 @@ if (count($attachments)==0) {
 <table cellspacing="0" class="table2">
  <tr>
   <td class="header5" colspan="5">
-   <?php echo _("Attachments"); ?>
+   <?php
+      echo _("Attachments");
+      if (!empty($plugin_output['attachments_top'])) echo $plugin_output['attachments_top'];
+   ?>
   </td>
  </tr>
  <?php
@@ -78,10 +81,11 @@ if (count($attachments)==0) {
     }
 
     foreach ($attachment['OtherLinks'] as $link) {
-        ?>
-   &nbsp;|&nbsp;
-   <a href="<?php echo $link['HREF']; ?>"><?php echo $link['Text']; ?></a>
-        <?php
+        echo '&nbsp;|&nbsp;';
+        if (empty($link['HREF']))
+            echo '<span ' . $link['Extra'] . '>' . $link['Text'] . '</span>';
+        else
+            echo '<a href="' . $link['HREF'] . '" ' . $link['Extra'] . '>' . $link['Text'] . '</a>';
     }
    ?>
    </small>
@@ -99,4 +103,4 @@ if (count($attachments)==0) {
   </td>
  </tr>
 </table>
-</div>
\ No newline at end of file
+</div>