function video_preset_submit in Video 7
Same name and namespace in other branches
- 7.2 modules/video_ui/video.preset.inc \video_preset_submit()
Submit handler for the preset form.
1 string reference to 'video_preset_submit'
- video_preset_form in modules/
video_ui/ video.preset.inc - Preset form
File
- modules/
video_ui/ video.preset.inc, line 475
Code
function video_preset_submit($form, &$form_state) {
$preset = array();
if (isset($form_state['values']['pid'])) {
$preset['pid'] = $form_state['values']['pid'];
}
$preset['name'] = $form_state['values']['name'];
$preset['description'] = $form_state['values']['description'];
// unset unwanted values saved to database
unset($form_state['values']['pid'], $form_state['values']['name'], $form_state['values']['description'], $form_state['values']['submit'], $form_state['values']['delete'], $form_state['values']['form_build_id'], $form_state['values']['form_token'], $form_state['values']['form_id'], $form_state['values']['op']);
$preset['settings'] = video_preset_array_flatten($form_state['values']);
// Save this preset.
video_preset_save($preset);
drupal_set_message(t('Preset !preset successfully saved.', array(
'!preset' => $preset['name'],
)));
$form_state['redirect'] = 'admin/config/media/video/presets';
}