You are here

function filebrowser_form_create_folder_submit in Filebrowser 6.2

Same name and namespace in other branches
  1. 8 filebrowser.module \filebrowser_form_create_folder_submit()
  2. 7.4 filebrowser.module \filebrowser_form_create_folder_submit()
  3. 7.2 filebrowser.module \filebrowser_form_create_folder_submit()
  4. 7.3 filebrowser.module \filebrowser_form_create_folder_submit()

create folder submition.

1 string reference to 'filebrowser_form_create_folder_submit'
filebrowser_form_create_folder in ./filebrowser.form.create_folder.inc

File

./filebrowser.form.create_folder.inc, line 76

Code

function filebrowser_form_create_folder_submit($form, &$form_state) {
  $i = 1;

  // Later we can have multi-upload
  $node = $form['#node'];
  $target = _filebrowser_convert_to_fs_encoding($node, "{$node->file_listing['.']['full-path']}/{$form_state['values']['folder_name']}");
  $success = mkdir($target, 0777);
  if (!$success) {
    drupal_set_message(t("Unable to create this folder, do you have filesystem right to do that ?"), 'error');
  }
  else {
    _filebrowser_load_files($node, NULL, TRUE);

    // force listing rebuild
    if (!empty($form_state['values']["description"])) {
      $file = $node->file_listing[_filebrowser_safe_basename($target)];
      module_invoke_all('filebrowser_metadata_set', $file, array(
        'description' => $form_state['values']["description"],
      ));
    }
  }
  drupal_goto("node/{$node->nid}/{$node->file_listing['.']['fid']}", _filebrowser_url_query());
}