function ds_sync_copy_form_submit in Display Suite 6.2
Same name and namespace in other branches
- 6.3 includes/ds.display.inc \ds_sync_copy_form_submit()
- 6 includes/ds.display.inc \ds_sync_copy_form_submit()
Copy / sync settings.
Parameters
array $form The display form.:
array $form_state The submitted values of the form.:
array $display_settings Current display settings being saved.:
1 call to ds_sync_copy_form_submit()
- ds_display_overview_form_submit in includes/
ds.display.inc - Save fields & plugins for a build mode.
File
- includes/
ds.display.inc, line 626 - Display overview form.
Code
function ds_sync_copy_form_submit($form, $form_state, &$display_settings) {
$sync_copy = _ds_get_sync_copy($form, $form_state);
if (!empty($sync_copy)) {
$current_build_mode = $form['#build_mode'];
foreach ($sync_copy['copy'] as $key => $value) {
if ($key === $value || $sync_copy['sync'][$key] === $key) {
// Copy.
$display_settings[$key] = $display_settings[$current_build_mode];
// Keep in sync ?
if (isset($sync_copy['sync'][$key])) {
$display_settings[$current_build_mode]['sync'][$key] = $key;
}
}
}
}
}