function mediafront_preset_save in MediaFront 6
Same name and namespace in other branches
- 6.2 includes/mediafront.preset.inc \mediafront_preset_save()
- 7.2 includes/mediafront.preset.inc \mediafront_preset_save()
- 7 includes/mediafront.preset.inc \mediafront_preset_save()
Saves a new preset.
4 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_6008 in ./
mediafront.install - Remove all cached CSS files and clean up the paths in the mediafront presets.
File
- includes/
mediafront.preset.inc, line 534
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);
}
// Rebuild Theme Registry
drupal_rebuild_theme_registry();
}