function mediafront_preset_save in MediaFront 7
Same name and namespace in other branches
- 6.2 includes/mediafront.preset.inc \mediafront_preset_save()
- 6 includes/mediafront.preset.inc \mediafront_preset_save()
- 7.2 includes/mediafront.preset.inc \mediafront_preset_save()
Saves a new preset.
5 calls to mediafront_preset_save()
- mediafront_create_preset_submit in includes/
mediafront.preset.inc - Submit handler for the preset form.
- mediafront_preset_import_submit in includes/
mediafront.preset.inc - Submit handler for the preset import form.
- mediafront_preset_submit in includes/
mediafront.preset.inc - Submit handler for the preset form.
- mediafront_update_7003 in ./
mediafront.install - Migrate the Preset module presets to the MediaFront module.
- mediafront_update_7006 in ./
mediafront.install - Change all the playerPath to be correct and delete the playerURL.
File
- includes/
mediafront.preset.inc, line 513
Code
function mediafront_preset_save($preset) {
// If they provide the pid, then this needs to be an update.
$pid = isset($preset['pid']) && $preset['pid'] ? array(
'pid',
) : array();
// Save or update a preset.
drupal_write_record('mediafront_preset', $preset, $pid);
// Tell the player about this preset save.
$player_save = $preset['player'] . '_mediafront_preset_save';
if (function_exists($player_save)) {
$preset['settings'] = isset($preset['settings']) ? $preset['settings'] : array();
$preset['settings'] = mediafront_get_settings($preset['player'], $preset['settings']);
$player_save($preset);
}
}