From 770ab13cb082b8f7102b9205e1aa5e1bad0a6cc5 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 25 Apr 2014 11:26:49 -0700 Subject: [PATCH] [ticket/12332] Fix displaying attachments with long file names PHPBB3-12332 --- phpBB/adm/style/acp_logs.html | 10 +++++----- phpBB/adm/style/admin.css | 5 +++++ phpBB/includes/acp/acp_attachments.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- .../prosilver/template/posting_attach_body.html | 4 ++-- phpBB/styles/prosilver/template/ucp_attachments.html | 2 +- phpBB/styles/prosilver/theme/content.css | 11 +++++++++++ phpBB/styles/prosilver/theme/plupload.css | 5 +++++ 8 files changed, 31 insertions(+), 10 deletions(-) diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index 9343b9b509..b3b5fe3394 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -22,15 +22,15 @@

- +
- - - + + + - + diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 6f2d65afc0..7f15c162a5 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -911,6 +911,11 @@ table.styles td.users, table td.mark { text-align: center; } +table.fixed-width-table { + table-layout: fixed; + width: 100%; +} + @media only screen and (max-width: 700px), only screen and (max-device-width: 700px) { table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index d8d382b2bd..8eef2da24b 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1058,7 +1058,7 @@ class acp_attachments $template->assign_block_vars('orphan', array( 'FILESIZE' => get_formatted_filesize($row['filesize']), 'FILETIME' => $user->format_date($row['filetime']), - 'REAL_FILENAME' => utf8_basename($row['real_filename']), + 'REAL_FILENAME' => utf8_wordwrap(utf8_basename((string) $row['real_filename']), 40, '
', true), 'PHYSICAL_FILENAME' => utf8_basename($row['physical_filename']), 'ATTACH_ID' => $row['attach_id'], 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '', diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index a720334ed2..289672cdc3 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2082,7 +2082,7 @@ class acp_users } $template->assign_block_vars('attach', array( - 'REAL_FILENAME' => $row['real_filename'], + 'REAL_FILENAME' => utf8_wordwrap(utf8_basename((string) $row['real_filename']), 40, '
', true), 'COMMENT' => nl2br($row['attach_comment']), 'EXTENSION' => $row['extension'], 'SIZE' => get_formatted_filesize($row['filesize']), diff --git a/phpBB/styles/prosilver/template/posting_attach_body.html b/phpBB/styles/prosilver/template/posting_attach_body.html index b6f4d13804..4ad66656b2 100644 --- a/phpBB/styles/prosilver/template/posting_attach_body.html +++ b/phpBB/styles/prosilver/template/posting_attach_body.html @@ -35,7 +35,7 @@
{L_USERNAME}{L_IP}{L_TIME}{L_USERNAME}{L_IP}{L_TIME} {L_ACTION} {L_MARK}{L_MARK}
- +   @@ -58,7 +58,7 @@
- {attach_row.FILENAME} + {attach_row.FILENAME}   diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index ed39e80c12..4731683a80 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -38,7 +38,7 @@
- {attachrow.FILENAME} ({attachrow.SIZE})
+ {attachrow.FILENAME} ({attachrow.SIZE})
{L_PM}{L_COLON} {L_TOPIC}{L_COLON} {attachrow.TOPIC_TITLE}
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index d27fb81fee..31f5fa36f7 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -779,6 +779,17 @@ div.dl_links { display: inline-block; } +.attachment-filename { + width: 100%; +} + +.ellipsis-text { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + /* Show scrollbars for items with overflow on iOS devices ----------------------------------------*/ .postbody .content::-webkit-scrollbar, #topicreview::-webkit-scrollbar, #post_details::-webkit-scrollbar, .codebox code::-webkit-scrollbar, .attachbox dd::-webkit-scrollbar, .attach-image::-webkit-scrollbar, .dropdown-extended ul::-webkit-scrollbar { diff --git a/phpBB/styles/prosilver/theme/plupload.css b/phpBB/styles/prosilver/theme/plupload.css index 8569eca662..f81064dbe6 100644 --- a/phpBB/styles/prosilver/theme/plupload.css +++ b/phpBB/styles/prosilver/theme/plupload.css @@ -74,3 +74,8 @@ height: 16px; width: 16px; } + +.file-name { + max-width: 65%; + vertical-align: bottom; +}