You are here

function data_export_import_export_nodes_form in Data export import 7

Function to create form to export nodes.

1 string reference to 'data_export_import_export_nodes_form'
data_export_import_callback_export_nodes in includes/profiles/nodes.inc
Callback function to export nodes.

File

includes/profiles/nodes.inc, line 18
Enables nodes to be exported and imported.

Code

function data_export_import_export_nodes_form($form_state) {
  $form['export_nodes'] = array(
    '#type' => 'fieldset',
    '#title' => t('Export nodes'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#tree' => TRUE,
  );
  $form['export_nodes']['description'] = array(
    '#type' => 'item',
    '#title' => t('Export all nodes to a dataset file'),
  );
  node_types_rebuild();
  $node_types = node_type_get_types();
  foreach ($node_types as $node_type) {
    $node_type_type = $node_type->type;
    $node_type_name = $node_type->name;
    $form['export_nodes']['content_types'][$node_type_type] = array(
      '#type' => 'checkbox',
      '#title' => check_plain($node_type_name),
    );
  }

  // Adds a simple submit button that refreshes the form and clears its
  // contents. This is the default behavior for forms.
  $form['export_nodes']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create dataset file'),
  );
  return $form;
}