diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-08-17 19:27:03 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-08-17 19:27:03 +0000 |
commit | 12c5614599c0816d956858cc8f5aa05b6497702e (patch) | |
tree | 3514412a063bbfa3536ededbea8067cf1038f87e | |
parent | b14ae54d6224d85d89046a938622509ad533709a (diff) | |
download | brdo-12c5614599c0816d956858cc8f5aa05b6497702e.tar.gz brdo-12c5614599c0816d956858cc8f5aa05b6497702e.tar.bz2 |
- Alternative solution for #28721: expand "File attachments"-group on node edit form when files are attached.
-rw-r--r-- | modules/upload.module | 3 | ||||
-rw-r--r-- | modules/upload/upload.module | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/upload.module b/modules/upload.module index 9853032a4..bee42e198 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -380,12 +380,13 @@ function upload_form($node) { if (count($node->files)) { $output = theme('table', $header, $rows); } + if (user_access('upload files')) { $output .= form_file(t('Attach new file'), "upload", 40); $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) { diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 9853032a4..bee42e198 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -380,12 +380,13 @@ function upload_form($node) { if (count($node->files)) { $output = theme('table', $header, $rows); } + if (user_access('upload files')) { $output .= form_file(t('Attach new file'), "upload", 40); $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) { |