You are here

function panels_page_edit_content in Panels 5.2

Same name and namespace in other branches
  1. 6.2 panels_page/panels_page.admin.inc \panels_page_edit_content()

Pass through to the panels content editor.

1 string reference to 'panels_page_edit_content'
panels_page_admin_menu_items in panels_page/panels_page.module
Helper function to add a menu item for a panel.

File

panels_page/panels_page.admin.inc, line 760
panels_page.admin.inc

Code

function panels_page_edit_content($panel_page, $did = NULL) {
  if (!is_object($panel_page)) {
    $panel_page = panels_page_load($panel_page);
  }
  panels_page_fetch_display($panel_page, $did);
  $display = $panel_page->display;

  // Collect a list of contexts required by the arguments on this page.
  $contexts = panels_context_load_contexts($panel_page);
  $display->context = $contexts;
  $display->args = array();

  // Get a list of available content.
  panels_load_include('common');
  $content_types = panels_common_get_allowed_types('panels_page', $contexts);
  $output = panels_edit($display, NULL, $content_types);
  if (is_object($output)) {
    $panel_page->display = $output;
    panels_page_save_display($panel_page);

    // And do the drupal_goto that a submit function ordinarily would have.
    $dest = "admin/panels/panel-page/{$panel_page->name}/edit/content";
    if ($did) {
      $dest .= "/{$did}";
    }
    drupal_goto($dest);
  }

  // Print this with theme('page') so that blocks are disabled while editing a display.
  // This is important because negative margins in common block layouts (i.e, Garland)
  // messes up the drag & drop.
  drupal_set_title(check_plain(panels_page_get_title($panel_page)));
  print theme('page', $output, FALSE);
}