You are here

function filebrowser_form_upload in Filebrowser 7.4

Same name and namespace in other branches
  1. 8 filebrowser.module \filebrowser_form_upload()
  2. 6.2 filebrowser.form.upload.inc \filebrowser_form_upload()
  3. 7.2 filebrowser.module \filebrowser_form_upload()
  4. 7.3 filebrowser.module \filebrowser_form_upload()

upload form definition. @inheritdoc

1 string reference to 'filebrowser_form_upload'
filebrowser_view in ./filebrowser.module
Implements hook_init(). @inheritdoc

File

./filebrowser.module, line 568

Code

function filebrowser_form_upload($form, &$form_state, $node) {
  $form['filebrowser_uploads'] = array(
    '#type' => 'fieldset',
    '#title' => t('File Upload'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Uploaded file will be saved to the current directory.'),
    '#prefix' => '<div class="attachments">',
    '#suffix' => '</div>',
    '#weight' => 30,
  );
  $form['node'] = array(
    '#type' => 'value',
    '#value' => $node,
  );
  $form['#attributes'] = array(
    'enctype' => "multipart/form-data",
  );
  _filebrowser_load_files($node);
  $form['filebrowser_uploads']['file'] = array(
    '#type' => 'file',
    '#title' => t('Upload file'),
    '#size' => 40,
  );
  $form['submitted'] = array(
    '#tree' => TRUE,
  );
  $form['filebrowser_uploads']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Upload'),
  );
  $form['filebrowser_uploads']["description"] = array(
    '#type' => 'textarea',
    '#title' => t('Description'),
    '#size' => 255,
  );
  $form['filebrowser_uploads']["file_name"] = array(
    '#type' => 'textfield',
    '#description' => t('Just put filename with NO EXTENSION here if you want to rename the file you want to upload'),
    '#title' => t('New name'),
    '#size' => 40,
  );
  $form['#redirect'] = NULL;
  return $form;
}