All pastes #468320 Raw Edit

ralex

public php v1 · immutable
·published 2007-05-03 00:57 UTC
rendered paste body
/************************************************************ * Node import wizard page 3: global options. ************************************************************/function _node_import_options(&$edit) {  $form = array();  $form[] = array(    '#type' => 'item',    '#title' => t('File'),    '#value' => $edit['filename'] .' ('. format_size($edit['file']->filesize) .') ',  );  $file_formats = _node_import_get_file_formats();  $form[] = array(    '#type' => 'item',    '#title' => t('File format'),    '#value' => $file_formats[$edit['file_format']],  );  $form[] = array(    '#type' => 'item',    '#title' => t('Type'),    '#value' => node_get_name($edit['type']),  );  if ($edit['type'] != 'node_import') {    // load the previously filled in values of the global fields    $global_values = array_merge((array) $_SESSION['node_import'], (array) $_POST['edit']);    $global_values = isset($global_values['global']) ? $global_values['global'] : array();    if ($global = module_invoke_all('node_import_global', $edit['type'], $global_values)) {      $form['global'] = $global;      $form['global']['#tree'] = TRUE;    }    else {      $form['global'] = array(        '#type' => 'markup',        '#value' => t('<p>There are no global options you can set.</p>'),      );    }  }  $form[] = array(    '#type' => 'submit',    '#value' => t('Back'),  );  $form[] = array(    '#type' => 'submit',    '#value' => t('Next (preview)'),  );  return drupal_get_form('node_import_options', $form);}function _node_import_options_validate($op, &$edit) {  if ($op == t('Back')) {    $_SESSION['node_import_page'] = '_node_import_mapping';  }  else if ($op == t('Next (preview)')) {    $_SESSION['node_import_page'] = '_node_import_preview';  }}