You are here

function filebrowser_form_create_folder_validate in Filebrowser 8

Same name and namespace in other branches
  1. 6.2 filebrowser.form.create_folder.inc \filebrowser_form_create_folder_validate()
  2. 7.4 filebrowser.module \filebrowser_form_create_folder_validate()
  3. 7.2 filebrowser.module \filebrowser_form_create_folder_validate()
  4. 7.3 filebrowser.module \filebrowser_form_create_folder_validate()

Implements hook_validate() for creating a folder

1 string reference to 'filebrowser_form_create_folder_validate'
filebrowser_form_create_folder in ./filebrowser.module

File

./filebrowser.module, line 621
Validates file path input on node form

Code

function filebrowser_form_create_folder_validate($form, $form_state) {
  $node = $form_state['values']['node'];
  _filebrowser_load_files($node);
  $target = _filebrowser_encoding_to_fs($node, "{$node->file_listing['.']['full-path']}/{$form_state['values']['folder_name']}");
  if (file_exists($target)) {
    form_error($form['filebrowser_create_folder']['folder_name'], t("This folder already exists."));
  }
}