You are here

function _panels_edit in Panels 7.3

Same name and namespace in other branches
  1. 5.2 includes/display_edit.inc \_panels_edit()
  2. 6.3 includes/display-edit.inc \_panels_edit()
  3. 6.2 includes/display-edit.inc \_panels_edit()

Handle calling and processing of the form for editing display content.

Helper function for panels_edit().

See also

panels_edit() for details on the various behaviors of this function.

1 call to _panels_edit()
panels_edit in ./panels.module
Main API entry point to edit a panel display.

File

includes/display-edit.inc, line 17
Core Panels API include file containing various display-editing functions. This includes all the basic editing forms (content, layout, layout settings) as well as the ajax modal forms associated with them.

Code

function _panels_edit($display, $destination, $content_types, $title = FALSE) {
  $did = $display->did;
  if (!$did) {
    $display->did = $did = 'new';
  }

  // Load the display being edited from cache, if possible.
  if (!empty($_POST) && is_object($cache = panels_edit_cache_get($did))) {
    $display = $cache->display;
  }
  else {
    $cache = panels_edit_cache_get_default($display, $content_types, $title);
  }

  // Get a renderer.
  $renderer = panels_get_renderer_handler('editor', $display);
  $renderer->cache = $cache;
  $output = $renderer
    ->edit();
  if (is_object($output) && $destination) {
    return panels_goto($destination);
  }
  return $output;
}