function _ds_get_sync_copy in Display Suite 6.2
Same name and namespace in other branches
- 6.3 includes/ds.display.inc \_ds_get_sync_copy()
- 6 includes/ds.display.inc \_ds_get_sync_copy()
Helper function to get build modes which need to be synced / copied.
1 call to _ds_get_sync_copy()
- ds_sync_copy_form_submit in includes/
ds.display.inc - Copy / sync settings.
File
- includes/
ds.display.inc, line 648 - Display overview form.
Code
function _ds_get_sync_copy($form, $form_state) {
static $checked = FALSE;
static $sync_copy = array();
if (isset($form_state['values']['sync_copy']) && $checked == FALSE) {
$checked = TRUE;
$current_build_mode = $form['#build_mode'];
$values = $form_state['values']['sync_copy'];
foreach ($values['copy'] as $key => $value) {
if ($key === $value || $values['sync'][$key] === $key) {
// Copy.
$sync_copy['copy'][$key] = $key;
// Keep in sync ?
if ($values['sync'][$key] === $key) {
$sync_copy['sync'][$key] = $key;
}
}
}
}
return $sync_copy;
}