You are here

function video_preset_save in Video 7.2

Same name and namespace in other branches
  1. 7 modules/video_ui/video.preset.inc \video_preset_save()

Saves a new preset.

2 calls to video_preset_save()
video_preset_import_submit in modules/video_ui/video.preset.inc
Submit handler for the preset import form.
video_preset_submit in modules/video_ui/video.preset.inc
Submit handler for the preset form.

File

modules/video_ui/video.preset.inc, line 846
Administrative interface for maintaining video presets.

Code

function video_preset_save($preset) {

  // If they provide the pid, then this needs to be an update.
  $pid = isset($preset['pid']) && $preset['pid'] ? array(
    'pid',
  ) : array();
  $object = (object) $preset;

  // Save or update a preset.
  drupal_write_record('video_preset', $object, $pid);
  $preset['pid'] = $object->pid;
  return $preset;
}