You are here

function panels_page_import_form_submit in Panels 6.2

Same name and namespace in other branches
  1. 5.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 1005
panels_page.admin.inc

Code

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

    // 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.'));
  }
}