diff options
author | Fyorl <gaelreth@gmail.com> | 2012-08-14 13:19:56 +0100 |
---|---|---|
committer | Fyorl <gaelreth@gmail.com> | 2012-08-14 13:21:00 +0100 |
commit | 39676d513e653132916b9c0cf6c9cc6ee5ebe96a (patch) | |
tree | 48a08fe05bf5571c62dea58fa786e53b5d8caad3 | |
parent | 5c9b3208f5095c585548e9882c322e40d0f8883e (diff) | |
download | forums-39676d513e653132916b9c0cf6c9cc6ee5ebe96a.tar forums-39676d513e653132916b9c0cf6c9cc6ee5ebe96a.tar.gz forums-39676d513e653132916b9c0cf6c9cc6ee5ebe96a.tar.bz2 forums-39676d513e653132916b9c0cf6c9cc6ee5ebe96a.tar.xz forums-39676d513e653132916b9c0cf6c9cc6ee5ebe96a.zip |
[feature/attach-dl] Added multiple attachment downloads to PMs
PHPBB3-11042
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 7 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/ucp_pm_viewmessage.html | 24 |
2 files changed, 25 insertions, 6 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index c55e8850a6..16fa7d630e 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -257,6 +257,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, + 'S_HAS_MULTIPLE_ATTACHMENTS' => (sizeof($attachments) > 1), 'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'], 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), @@ -282,6 +283,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Display not already displayed Attachments for this post, we already parsed them. ;) if (isset($attachments) && sizeof($attachments)) { + $methods = phpbb_gen_download_links('post_id', $msg_id, $phpbb_root_path, $phpEx); + foreach ($methods as $method) + { + $template->assign_block_vars('dl_method', $method); + } + foreach ($attachments as $attachment) { $template->assign_block_vars('attachment', array( diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 2e7a7c4ac9..b022bcd979 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -41,12 +41,24 @@ <div class="content">{MESSAGE}</div> <!-- IF S_HAS_ATTACHMENTS --> - <dl class="attachbox"> - <dt>{L_ATTACHMENTS}</dt> - <!-- BEGIN attachment --> - <dd>{attachment.DISPLAY_ATTACHMENT}</dd> - <!-- END attachment --> - </dl> + <dl class="attachbox"> + <dt> + {L_ATTACHMENTS} + <!-- IF S_HAS_MULTIPLE_ATTACHMENTS --> + <div class="dl_links"> + <strong>{L_DOWNLOAD_ALL}:</strong> + <ul> + <!-- BEGIN dl_method --> + <li>[ <a href="{dl_method.LINK}">{dl_method.TYPE}</a> ]</li> + <!-- END dl_method --> + </ul> + </div> + <!-- ENDIF --> + </dt> + <!-- BEGIN attachment --> + <dd>{attachment.DISPLAY_ATTACHMENT}</dd> + <!-- END attachment --> + </dl> <!-- ENDIF --> <!-- IF S_DISPLAY_NOTICE --> |