You are here

function tft_multiple_upload_create_node in Taxonomy File Tree 7.2

1 call to tft_multiple_upload_create_node()
tft_multiple_upload_files_submit in modules/tft_multiple_upload/tft_multiple_upload.module

File

modules/tft_multiple_upload/tft_multiple_upload.module, line 113
Hook implementations for TFT Opigno.

Code

function tft_multiple_upload_create_node($saved_file, $tid) {
  global $user;
  $node = new stdClass();
  $node->title = $saved_file->filename;
  $node->type = "tft_file";
  node_object_prepare($node);
  $node->language = LANGUAGE_NONE;
  $node->uid = $user->uid;
  $node->status = 1;
  $node->promote = 0;
  $node->comment = 0;
  if ($tid !== 0) {
    $node->tft_folder[LANGUAGE_NONE][]['tid'] = $tid;
  }
  $node->tft_file[LANGUAGE_NONE][] = array(
    'fid' => $saved_file->fid,
    'display' => 1,
    'description' => '',
  );
  node_save($node);
}