You are here

function export_settings in Node export 6

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

Menu callback to configure module settings.

1 string reference to 'export_settings'
export_menu in ./export.module
Implementation of hook_menu().

File

./export.pages.inc, line 7

Code

function export_settings() {
  $form['basic'] = array(
    '#type' => 'fieldset',
    '#title' => t('General settings'),
  );
  $form['basic']['export_method'] = array(
    '#type' => 'radios',
    '#title' => t('Method to use when importing a node'),
    '#options' => array(
      'prepopulate' => t('Pre-populate the node form fields'),
      'save-edit' => t('Save as a new node then edit'),
    ),
    '#default_value' => variable_get('export_method', 'prepopulate'),
  );
  $form['publishing'] = array(
    '#type' => 'fieldset',
    '#title' => t('Should the publishing options ( e.g. published, promoted, etc) be reset to the defaults?'),
  );
  $types = node_get_types('names');
  foreach ($types as $type => $name) {
    $form['publishing']['export_reset_' . $type] = array(
      '#type' => 'checkbox',
      '#title' => t('@s: reset publishing options when exported', array(
        '@s' => $name,
      )),
      '#default_value' => variable_get('export_reset_' . $type, FALSE),
    );
  }

  // Need the variable default key to be something that's never a valid node type.
  $form['omit'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content types that are not to be exported - omitted due to incompatibility'),
  );
  $form['omit']['export_omitted'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Omitted content types'),
    '#default_value' => variable_get('export_omitted', array()),
    '#options' => $types,
    '#description' => t('Select any node types which should <em>never</em> be exported. Typically you should will want to select here all node types for which importing fails (e.g. image nodes).'),
  );
  return system_settings_form($form);
}