You are here

function webfm_upload_form in Web File Manager 5.2

Same name and namespace in other branches
  1. 5 webfm.module \webfm_upload_form()
3 calls to webfm_upload_form()
webfm_form_alter in ./webfm.module
Implementation of hook_form_alter().
webfm_reload_upload in ./webfm.module
webfm_upload_fieldset in ./webfm.module
1 string reference to 'webfm_upload_form'
webfm_form_alter in ./webfm.module
Implementation of hook_form_alter().

File

./webfm.module, line 1393

Code

function webfm_upload_form($upload_url) {
  $form['#theme'] = 'webfm_upload_form';

  // This div is hidden when the user uploads through JS.
  $form['new'] = array(
    '#prefix' => '<div id="wfmatt-hide">',
    '#suffix' => '</div>',
  );

  // this following key used by file_check_upload(()
  $form['new']['webfm_upload'] = array(
    '#type' => 'file',
    '#title' => t('Upload file'),
    '#size' => 40,
  );
  $form['new']['wfmatt'] = array(
    '#type' => 'button',
    '#value' => t('Upload'),
    '#name' => 'attach',
    '#id' => 'wfmatt-button',
  );

  // Hidden input field for js to supply current directory value
  $form['webfmuploadpath'] = array(
    '#type' => 'hidden',
    '#value' => '',
  );

  // The class triggers the js upload behaviour.
  $form['wfmatt-url'] = array(
    '#type' => 'hidden',
    '#value' => url($upload_url, NULL, NULL, TRUE),
    '#attributes' => array(
      'class' => 'webfmupload',
    ),
  );
  return $form;
}