Allow plugins to provide their own view/download attachment links
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Jul 2020 07:08:51 +0000 (07:08 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Jul 2020 07:08:51 +0000 (07:08 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14870 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 313c2c8..cafd41c 100644 (file)
@@ -648,8 +648,14 @@ function buildAttachmentArray($message, $exclude_id, $mailbox, $id) {
         $this_attachment['ContentType'] = sm_encode_html_special_chars($type0 .'/'. $type1);
         $this_attachment['OtherLinks'] = array();
         foreach ($links as $val) {
-            if ($val['text']==_("Download") || $val['text'] == _("View"))
+            if ($val['text']==_("Download")) {
+                $this_attachment['DownloadHREF'] = $val['href'];
                 continue;
+            }
+            if ($val['text']==_("View")) {
+                $this_attachment['ViewHREF'] = $val['href'];
+                continue;
+            }
             if (empty($val['text']) && empty($val['extra']))
                 continue;