You are here

function filebrowser_form_create_folder_submit in Filebrowser 7.2

Same name and namespace in other branches
  1. 8 filebrowser.module \filebrowser_form_create_folder_submit()
  2. 6.2 filebrowser.form.create_folder.inc \filebrowser_form_create_folder_submit()
  3. 7.4 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.module

File

./filebrowser.module, line 692

Code

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

  // Later we can have multi-upload
  $node = $form_state['values']['node'];
  $target = _filebrowser_encoding_to_fs($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());
}