You are here

function filebrowser_form_create_folder_validate in Filebrowser 6.2

Same name and namespace in other branches
  1. 8 filebrowser.module \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()

Implementation of hook_validate() for creating a folder

File

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

Code

function filebrowser_form_create_folder_validate($form, $form_state) {
  $node = $form['#node'];
  _filebrowser_load_files($node);
  $target = _filebrowser_convert_to_fs_encoding($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."));
  }
}