Index: transformations_ui.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/transformations/ui/transformations_ui.admin.inc,v
retrieving revision 1.8
diff -u -r1.8 transformations_ui.admin.inc
--- transformations_ui.admin.inc	23 Jun 2009 19:15:20 -0000	1.8
+++ transformations_ui.admin.inc	14 Jul 2009 12:13:21 -0000
@@ -23,6 +23,7 @@
     $action_links[] = l(t('Rename'), 'admin/build/transformations/' . $id .'/rename');
     $action_links[] = l(t('Execute'), 'admin/build/transformations/' . $id .'/execute');
     $action_links[] = l(t('Delete'), 'admin/build/transformations/' . $id . '/delete');
+    $action_links[] = l(t('Export'), 'admin/build/transformations/' . $id . '/export');
 
     $row = array($name, implode(' | ', $action_links));
     $rows[] = $row;
@@ -448,3 +449,115 @@
   $form_state['redirect'] = transformations_ui_pipeline_path($pipeline);
   drupal_set_message(t('The lock has been broken and you may now edit this pipeline.'));
 }
+
+/**
+ * Form to export multiple pipelines at once.
+ */
+function transformations_ui_pipeline_multiple_export($form_state) {
+	$form = array();
+  if (!isset($form_state['export'])) {
+		$form['export'] = array(
+	    '#type' => 'select',
+	    '#title' => t('Select the pipelines to export'),
+	    '#required' => TRUE,
+			'#multiple' => TRUE,
+			'#options' => transformations_ui_pipeline_options(),
+	  );
+
+	  $form['button'] = array(
+	    '#type' => 'submit',
+	    '#value' => t('Export'),
+	  );
+  }
+  else {
+    $form['result'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Exported rule configurations'),
+      '#description' => t('Copy these data and paste them into the import page, to import.'),
+      '#rows' => 15,
+      '#attributes' => array('readonly' => 'readonly'),
+      '#default_value' => var_export($form_state['export'], TRUE),
+    );
+  }
+
+  return $form;
+}
+
+/**
+ * Submit handler for the 'export multiple pipelines' form.
+ */
+function transformations_ui_pipeline_multiple_export_submit($form, &$form_state) {
+  foreach ($form_state['values']['export'] as $id) {
+  	$pipeline = TfPipeline::load($id);
+  	$export[$id] = $pipeline->export();
+  }
+  $form_state['export'] = $export;
+  $form_state['rebuild'] = TRUE;
+}
+
+/**
+ * Form that displays a single exported pipeline.
+ */
+function transformations_ui_pipeline_export(&$form_state, TfPipeline $pipeline) {
+  $pipeline = transformations_ui_persisted_pipeline_load($form['#pipeline_id']);
+  $form = array();
+  $pipelines = array();
+  $pipelines[$pipeline->id()] = $pipeline->export();
+	$form['export'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Pipeline export'),
+    '#default_value' => var_export($pipelines, TRUE),
+    '#description' => "Copy these data and paste them into the import page, to import.",
+    '#attributes' => array('readonly' => 'readonly'),
+    '#rows' => 15,
+  );
+  return $form;
+}
+
+/**
+ * Form that lets the user import pipelines.
+ */
+function transformations_ui_pipeline_import(&$form_state) {
+	$form = array();
+	$form['#validate'][] = 'transformations_ui_pipeline_rename_validate';
+
+	$form['pipeline'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Pipeline import'),
+    '#description' => "Just paste your exported configuration here.",
+    '#rows' => 15,
+    '#required' => TRUE,
+  );
+
+  $form['import'] = array(
+    '#type' => 'submit',
+    '#value' => t('Import'),
+    '#submit' => array('transformations_ui_pipeline_import_submit'),
+  );
+  return $form;
+}
+
+/**
+ * Submit handler for the 'import pipeline' form.
+ */
+function transformations_ui_pipeline_import_submit($form, &$form_state) {
+ 	@eval('$import = ' . $form_state['values']['pipeline'] .';');
+ 	$redirect = 'admin/build/transformations';
+
+ 	foreach ($import as $id => $blueprint){
+ 		$pipeline = TfPipeline::import($blueprint);
+ 		if (TfPipeline::existsName($pipeline->name())) {
+    	drupal_set_message(t('There already exists another pipeline with the name %name. Please rename one the pipelines.', 
+    		array('%name' => $pipeline->name())), 'error');
+    	$redirect = 'admin/build/transformations/import';
+ 		}
+ 		else {
+ 			transformations_ui_pipeline_save($pipeline);
+ 			drupal_set_message(t('The pipeline %name has been deleted.', array(
+    		'%name' => $pipeline->name(),
+ 			)));
+ 		}
+ 	}
+
+ 	$form_state['redirect'] = $redirect; 
+}
Index: transformations_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/transformations/ui/transformations_ui.module,v
retrieving revision 1.8
diff -u -r1.8 transformations_ui.module
--- transformations_ui.module	17 Jun 2009 23:43:30 -0000	1.8
+++ transformations_ui.module	14 Jul 2009 12:13:21 -0000
@@ -54,6 +54,20 @@
     'weight' => 5,
     'type' => MENU_LOCAL_TASK,
   ) + $base;
+  $items['admin/build/transformations/export'] = array(
+    'title' => 'Export',
+    'description' => 'Export multiple pipeline.',
+    'page arguments' => array('transformations_ui_pipeline_multiple_export'),
+    'weight' => 6,
+    'type' => MENU_LOCAL_TASK,
+  ) + $base;
+  $items['admin/build/transformations/import'] = array(
+    'title' => 'Import',
+    'description' => 'Import a pipeline.',
+    'page arguments' => array('transformations_ui_pipeline_import'),
+    'weight' => 7,
+    'type' => MENU_LOCAL_TASK,
+  ) + $base;
   $items['admin/build/transformations/%transformations_ui_persisted_pipeline'] = array(
     'title callback' => 'transformations_ui_pipeline_title_callback',
     'title arguments' => array(3),
@@ -107,6 +121,12 @@
     'page arguments' => array('transformations_ui_pipeline_delete_confirm', 3),
     'type' => MENU_CALLBACK,
   ) + $base;
+  $items['admin/build/transformations/%transformations_ui_persisted_pipeline/export'] = array(
+    'title' => 'Export pipeline',
+    'page arguments' => array('transformations_ui_pipeline_export', 3),
+    'weight' => 8,
+    'type' => MENU_LOCAL_TASK,
+  ) + $base;
 
   $items['transformations/slot-connect/%transformations_ui_persisted_pipeline/%/%/%/%'] = array(
     'title' => 'transformations_ajax_disconnect',
