Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.148.2.3
diff -u -p -r1.148.2.3 upload.module
--- modules/upload/upload.module 7 Jan 2008 01:00:23 -0000 1.148.2.3
+++ modules/upload/upload.module 26 Feb 2008 06:54:13 -0000
@@ -794,17 +794,16 @@ function _upload_form($node) {
}
}
- if (user_access('upload files')) {
- // This div is hidden when the user uploads through JS.
- $form['new'] = array(
- '#prefix' => '
',
- '#suffix' => '
',
- );
- $form['new']['upload'] = array('#type' => 'file', '#title' => t('Attach new file'), '#size' => 40);
- $form['new']['attach'] = array('#type' => 'button', '#value' => t('Attach'), '#name' => 'attach', '#id' => 'attach-button');
- // The class triggers the js upload behaviour.
- $form['attach-url'] = array('#type' => 'hidden', '#value' => url('upload/js', NULL, NULL, TRUE), '#attributes' => array('class' => 'upload'));
- }
+ // This div is hidden when the user uploads through JS.
+ $form['#access'] = user_access('upload files');
+ $form['new'] = array(
+ '#prefix' => '',
+ '#suffix' => '
',
+ );
+ $form['new']['upload'] = array('#type' => 'file', '#title' => t('Attach new file'), '#size' => 40);
+ $form['new']['attach'] = array('#type' => 'button', '#value' => t('Attach'), '#name' => 'attach', '#id' => 'attach-button');
+ // The class triggers the js upload behaviour.
+ $form['attach-url'] = array('#type' => 'hidden', '#value' => url('upload/js', NULL, NULL, TRUE), '#attributes' => array('class' => 'upload'));
// Needed for JS
$form['current']['vid'] = array('#type' => 'hidden', '#value' => $node->vid);