You are here

function panels_page_import_form_submit in Panels 5.2

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

Handle the submit button on importing a panel page.

File

panels_page/panels_page.admin.inc, line 855
panels_page.admin.inc

Code

function panels_page_import_form_submit($form_id, $form) {
  ob_start();
  eval($form['panel_page']);
  ob_end_clean();
  if (isset($page)) {
    drupal_set_title(t('Import panel page "@s"', array(
      '@s' => $page->title,
    )));

    // Backwards-compatibility for exports that predate the new fetching system.
    if (!is_object($page->primary)) {
      $page->primary =& $page->display;
    }

    // As $page contains non-stdClass objects,
    // it needs to be serialized before being stored in the session variable.
    $_SESSION['pp_import'] = serialize($page);
    $output = drupal_get_form('panels_page_edit_form', $page);
    print theme('page', $output);
    exit;
  }
  else {
    drupal_set_message(t('Unable to get a panel page out of that.'));
  }
}