소스 검색

Allow plugins to provide their own view/download attachment links

pdontthink 5 년 전
부모
커밋
2c5c97b38e
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      functions/mime.php

+ 7 - 1
functions/mime.php

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