You are here

function panels_mini_import_form_submit in Panels 5.2

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

Handle the submit button on importing a mini panel.

File

panels_mini/panels_mini.module, line 398
panels_mini.module

Code

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

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