You are here

function _background_video_file_save in Background Video 7

Callback function to save the file permanetly and file usage add.

1 call to _background_video_file_save()
background_video_settings_form_submit in ./background_video.admin.inc
Submit Handler for the configuration form.

File

./background_video.admin.inc, line 94
This file provides the configuration form for the Background Video module.

Code

function _background_video_file_save($type, $form_state) {
  $file = file_load($form_state['values']['background_video_source_' . $type]);
  if (is_object($file)) {
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);
    file_usage_add($file, 'background_video', 'background_video', 1);
  }
}