elseif ($was_defaulted ===
$is_defaulted) { // We're not changing which display these form values apply to.
// Run the regular submit handler for this form.
} elseif ($was_defaulted && !
$is_defaulted) { // We were using the default display's values, but we're now overriding
// the default display and saving values specific to this display.
$display = &
$this->
getExecutable()->displayHandlers->
get($display_id);
// optionsOverride toggles the override of this section.
$display->
optionsOverride($form,
$form_state);
$display->
submitOptionsForm($form,
$form_state);
} elseif (!
$was_defaulted &&
$is_defaulted) { // We used to have an override for this display, but the user now wants
// to go back to the default display.
// Overwrite the default display with the current form values, and make
// the current display use the new default values.
$display = &
$this->
getExecutable()->displayHandlers->
get($display_id);
// optionsOverride toggles the override of this section.
$display->
optionsOverride($form,
$form_state);
$display->
submitOptionsForm($form,
$form_state);
}