You are here

function webfm_insert_file in Web File Manager 5

Same name and namespace in other branches
  1. 5.2 webfm_file.inc \webfm_insert_file()

webfm_insert_file - inserts a file into the webfm_file table

Parameters

string $path - path relative to drupal root:

string &$err_arr - ref to error array for client feedback:

Return value

bool - TRUE if query executed successfully, otherwise FALSE

2 calls to webfm_insert_file()
webfm_ajax in ./webfm.module
Ajax post requests
webfm_insert_dir in ./webfm_file.inc
webfm_insert_dir - inserts files into the webfm_file table

File

./webfm_file.inc, line 219

Code

function webfm_insert_file($path, &$err_arr) {
  if (!webfm_get_fid($path)) {
    $file = new stdClass();
    $file->filepath = $path;
    if (webfm_enum_validate($file, $err_arr)) {
      if (($ret = webfm_dbinsert_file($file, $err)) === FALSE) {
        $err_arr[] = $err;
      }
      return $ret;
    }
  }
  else {
    $err_arr[] = $path . t(' already in db');
  }
  return FALSE;
}