function panels_edit_layout_settings_form_submit in Panels 6.2
Same name and namespace in other branches
- 5.2 includes/display_edit.inc \panels_edit_layout_settings_form_submit()
Store changes from the layout settings form.
1 string reference to 'panels_edit_layout_settings_form_submit'
- panels_panel_node_view_delegator_task_handlers in plugins/
task_handlers/ panel_node_view.inc
File
- includes/
display-layout-settings.inc, line 255 - Form and ajax handling for edit layout settings
Code
function panels_edit_layout_settings_form_submit($form, &$form_state) {
$display =& $form_state['display'];
if ($function = panels_plugin_get_function('layout', $form_state['layout'], 'settings submit')) {
$function($form_state['values']['layout_settings'], $display, $form_state['layout'], $display->layout_settings);
}
if (isset($form_state['values']['display_title']['title'])) {
$display->title = $form_state['values']['display_title']['title'];
$display->hide_title = $form_state['values']['display_title']['hide_title'];
}
// Remove buttons so they don't get written into the database:
if (isset($form_state['values']['panel_settings']['edit_style'])) {
unset($form_state['values']['panel_settings']['edit_style']);
}
if (isset($form_state['values']['panel_settings']['edit_style_destination'])) {
unset($form_state['values']['panel_settings']['edit_style_destination']);
}
foreach ($form_state['values']['panel_settings']['panel'] as $id => $info) {
if (isset($form_state['values']['panel_settings']['panel'][$id]['edit_style'])) {
unset($form_state['values']['panel_settings']['panel'][$id]['edit_style']);
}
if (isset($form_state['values']['panel_settings']['panel'][$id]['edit_style_destination'])) {
unset($form_state['values']['panel_settings']['panel'][$id]['edit_style_destination']);
}
}
// Since not all layouts have layout settings, check here in case of notices.
if (isset($form_state['values']['layout_settings'])) {
$display->layout_settings = $form_state['values']['layout_settings'];
}
$display->panel_settings = $form_state['values']['panel_settings'];
}