Skip to content
Snippets Groups Projects
Commit 12c56145 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Alternative solution for #28721: expand "File attachments"-group on node...

- Alternative solution for #28721: expand "File attachments"-group on node edit form when files are attached.
parent b14ae54d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -380,12 +380,13 @@ function upload_form($node) { ...@@ -380,12 +380,13 @@ function upload_form($node) {
if (count($node->files)) { if (count($node->files)) {
$output = theme('table', $header, $rows); $output = theme('table', $header, $rows);
} }
if (user_access('upload files')) { if (user_access('upload files')) {
$output .= form_file(t('Attach new file'), "upload", 40); $output .= form_file(t('Attach new file'), "upload", 40);
$output .= form_button(t('Attach'), 'fileop'); $output .= form_button(t('Attach'), 'fileop');
} }
return '<div class="attachments">'. form_group_collapsible(t('File attachments'), $output, TRUE, t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.')) .'</div>'; return '<div class="attachments">'. form_group_collapsible(t('File attachments'), $output, empty($node->files), t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.')) .'</div>';
} }
function upload_load($node) { function upload_load($node) {
......
...@@ -380,12 +380,13 @@ function upload_form($node) { ...@@ -380,12 +380,13 @@ function upload_form($node) {
if (count($node->files)) { if (count($node->files)) {
$output = theme('table', $header, $rows); $output = theme('table', $header, $rows);
} }
if (user_access('upload files')) { if (user_access('upload files')) {
$output .= form_file(t('Attach new file'), "upload", 40); $output .= form_file(t('Attach new file'), "upload", 40);
$output .= form_button(t('Attach'), 'fileop'); $output .= form_button(t('Attach'), 'fileop');
} }
return '<div class="attachments">'. form_group_collapsible(t('File attachments'), $output, TRUE, t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.')) .'</div>'; return '<div class="attachments">'. form_group_collapsible(t('File attachments'), $output, empty($node->files), t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.')) .'</div>';
} }
function upload_load($node) { function upload_load($node) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment