1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 04:42:04 +02:00

[ticket/16888] Add the list of allowed files in the attachment tab

PHPBB3-16888
This commit is contained in:
3D-I 2021-10-10 07:05:43 +02:00
parent 59cece1a0a
commit 98f446df67
3 changed files with 7 additions and 0 deletions

View File

@ -818,6 +818,10 @@ function posting_gen_inline_attachments(&$attachment_data)
function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true)
{
global $template, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher;
global $cache, $request;
$forum_id = $request->variable('f', 0);
$allowed_attachments = array_keys($cache->obtain_attach_extensions($forum_id)['_allowed_']);
// Some default template variables
$template->assign_vars(array(
@ -826,6 +830,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
'FILESIZE' => $config['max_filesize'],
'FILE_COMMENT' => (isset($filename_data['filecomment'])) ? $filename_data['filecomment'] : '',
'MAX_ATTACHMENT_FILESIZE' => $config['max_filesize'] > 0 ? $user->lang('MAX_ATTACHMENT_FILESIZE', get_formatted_filesize($config['max_filesize'])) : '',
'ALLOWED_ATTACHMENTS' => implode(', ', $allowed_attachments),
));
if (count($attachment_data))

View File

@ -152,6 +152,7 @@ $lang = array_merge($lang, array(
'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum.',
'MAX_ATTACHMENT_FILESIZE' => 'Maximum filesize per attachment: %s.',
'ALLOWED_ATTACHMENTS' => 'Allowed files',
'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %d.',
'MAX_FLASH_HEIGHT_EXCEEDED' => array(
1 => 'Your flash files may only be up to %d pixel high.',

View File

@ -3,6 +3,7 @@
<p>{L_ADD_ATTACHMENT_EXPLAIN} <span class="hidden" id="drag-n-drop-message">{L_PLUPLOAD_DRAG_TEXTAREA}</span></p>
{% if MAX_ATTACHMENT_FILESIZE is not empty %}<p>{{ MAX_ATTACHMENT_FILESIZE }}</p>{% endif %}
{% if ALLOWED_ATTACHMENTS is not empty %}<p>{{ lang('ALLOWED_ATTACHMENTS') ~ lang('COLON') }} <em>{{ ALLOWED_ATTACHMENTS }}</em></p>{% endif %}
<fieldset class="fields2" id="attach-panel-basic">
<dl>