You are here

function panels_change_layout_submit in Panels 6.2

Same name and namespace in other branches
  1. 6.3 includes/display-layout.inc \panels_change_layout_submit()
  2. 7.3 includes/display-layout.inc \panels_change_layout_submit()

Handle submission of the change layout form.

This submit handler will move panes around and save the display.

2 string references to 'panels_change_layout_submit'
panels_change_layout in includes/display-layout.inc
Form definition for the display layout converter.
panels_panel_node_view_delegator_task_handlers in plugins/task_handlers/panel_node_view.inc

File

includes/display-layout.inc, line 240
Handle the forms for changing a display's layout.

Code

function panels_change_layout_submit($form, &$form_state) {
  $display =& $form_state['display'];
  if (!empty($form_state['values']['old'])) {
    foreach ($form_state['values']['old'] as $id => $new_id) {
      if (isset($display->panels[$id])) {
        if (!isset($content[$new_id])) {
          $content[$new_id] = array();
        }
        $content[$new_id] = array_merge($content[$new_id], $display->panels[$id]);
      }
      foreach ($content[$new_id] as $pid) {
        $display->content[$pid]->panel = $new_id;
      }
    }
    $display->panels = $content;
  }
  $display->layout = $form_state['layout'];
}