You are here

function panels_panel_context_edit_move in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/task_handlers/panel_context.inc \panels_panel_context_edit_move()

When a layout is changed, the user is given the opportunity to move content.

1 string reference to 'panels_panel_context_edit_move'
panel_context.inc in plugins/task_handlers/panel_context.inc
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

File

plugins/task_handlers/panel_context.inc, line 672
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

Code

function panels_panel_context_edit_move($form, &$form_state) {
  $form_state['display'] =& panels_panel_context_get_display($form_state['handler']);
  $form_state['layout'] = $form_state['handler']->conf['temp_layout'];
  $form_state['cache_key'] = panels_panel_context_cache_key($form_state['task_name'], $form_state['handler_id'], array());
  ctools_include('common', 'panels');
  ctools_include('display-layout', 'panels');
  ctools_include('plugins', 'panels');

  // Tell the Panels form not to display buttons.
  $form_state['no buttons'] = TRUE;

  // Change the #id of the form so the CSS applies properly.
  $form = panels_change_layout($form, $form_state);

  // Change the 'back' button to just go directly to the previous form
  //  $task_id = $form_state['task']['name'];
  //  $handler_id = $form_state['handler']->handler;
  //  $name = $form_state['handler']->name;
  // This form is outside the normal wizard list, so we need to specify the
  // previous/next forms.
  $form['buttons']['previous']['#next'] = 'layout';
  $form['buttons']['next']['#next'] = 'content';
  $form_state['form_info']['return path'] = page_manager_edit_url($form_state['page']->task_name, array(
    'handlers',
    $form_state['handler_id'],
    'content',
  ));
  return $form;
}