You are here

function export_import_form in Node export 6

Same name and namespace in other branches
  1. 5.2 export.pages.inc \export_import_form()
  2. 5 export.module \export_import_form()

Import Form

1 string reference to 'export_import_form'
export_node_import in ./export.pages.inc
Import Node UI

File

./export.pages.inc, line 136

Code

function export_import_form($form_state) {
  $form['#prefix'] = t('<p>You may import a node by copy-and-pasting the results of an export node. </p>');
  $method = variable_get('export_method', 'prepopulate');
  if ($method == 'prepopulate') {
    $form['#prefix'] .= t('<p>You will be given a prepopulated node add form which you must save to create the node.</p>');
  }
  elseif ($method == 'save-edit') {
    $form['#prefix'] .= t('<p>The node will be created and you will then be taken to the node edit page.</p>');
  }
  $form['#prefix'] .= t('<p>To change this behaviour, <a href="/admin/settings/export">configure the settings</a>.</p>');
  $form['import_code'] = array(
    '#type' => 'textarea',
    '#title' => t('Import Code'),
    '#default_value' => '',
    '#required' => TRUE,
    '#rows' => 30,
    '#description' => t('Cut and paste the results of an <em>Export Node</em> here.'),
  );
  $form['#redirect'] = FALSE;
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
  );
  return $form;
}