Index: transformations.transformations.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/transformations/transformations/transformations.transformations.inc,v
retrieving revision 1.6
diff -u -r1.6 transformations.transformations.inc
--- transformations.transformations.inc	23 Jun 2009 19:21:34 -0000	1.6
+++ transformations.transformations.inc	3 Jul 2009 09:43:42 -0000
@@ -78,6 +78,12 @@
     'parent' => 'TfDumpData',
     'file' => 'operations.debug.inc',
   );
+  $operations['TfFileSavefromStrings'] = array(
+    'file' => 'operations.strings.inc',
+  );
+  $operations['TfStringReplace'] = array(
+    'file' => 'operations.strings.inc',
+  );
 
   return $operations;
 }
Index: operations.strings.inc
===================================================================
RCS file: operations.strings.inc
diff -N operations.strings.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ operations.strings.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,177 @@
+<?php
+// $Id: operations.file.inc,v 1.5 2009/06/23 19:15:19 jpetso Exp $
+
+
+/**
+ * Implementation of [module]_operation_[class]().
+ */
+function transformations_operation_TfFileSavefromStrings() {
+  return array(
+    'category' => t('String Operations'),
+    'label' => t('Save string to file'),
+    'description' => t('This operation saves a string to a file'),
+  );
+}
+
+class TfFileSavefromStrings extends TfOperation {
+  /**
+   * Implementation of TfOperation::inputs().
+   */
+  protected function inputs() {
+    return array('string', 'filepath');
+  }
+
+  /**
+   * Implementation of TfOperation::inputInfo().
+   */
+  protected function inputInfo($inputKey, $propertyKey) {
+    if ($inputKey == 'string') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('String');
+
+        case 'expectedType':
+          return 'php:type:string';
+      }
+    }
+    if ($inputKey == 'filepath') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('File path');
+  
+        case 'description':
+          return t('The path in the local file system where the file is located.');
+  
+        case 'expectedType':
+          return 'php:type:string';
+      }
+    }
+  }
+
+  /**
+   * Implementation of TfOperation::outputs().
+   */
+  protected function outputs() {
+    return array('Error');
+  }
+
+  /**
+   * Implementation of TfOperation::outputInfo().
+   */
+  protected function outputInfo($outputKey, $propertyKey) {
+    if ($outputKey == 'Error') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('Error');
+      case 'description':
+        return t('Returns true if there was a error while writing the File.');
+
+        case 'expectedType':
+          return 'php:type:boolean';
+      }
+    }
+  }
+
+  /**
+   * Implementation of TfOperation::execute().
+   */
+  protected function execute(TfOutput $output) {
+    $string = $this->input('string')->data();
+    $filename = trim($this->input('filepath')->data());
+    $file = fopen($filename,'x');
+    if($file){
+      fwrite($file, $string);
+      fclose($file);
+      $output->set('Error', false);
+    }
+    else {
+      $output->set('Error', true);
+    }
+  }
+}
+
+
+/**
+ * Implementation of [module]_operation_[class]().
+ */
+function transformations_operation_TfStringReplace() {
+  return array(
+    'category' => t('String Operations'),
+    'label' => t('String Replacement'),
+    'description' => t('Replaces one String by another just likes php str_place function.'),
+  );
+}
+
+class TfStringReplace extends TfOperation {
+  /**
+   * Implementation of TfOperation::inputs().
+   */
+  protected function inputs() {
+    return array('Search', 'Replace', 'Subject');
+  }
+
+  /**
+   * Implementation of TfOperation::inputInfo().
+   */
+  protected function inputInfo($inputKey, $propertyKey) {
+    if ($inputKey == 'Search') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('Search');
+        case 'expectedType':
+          return 'php:type:string';
+      }
+    }
+    if ($inputKey == 'Replace') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('Replace');
+        case 'expectedType':
+          return 'php:type:string';
+      }
+    }
+    if ($inputKey == 'Subject') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('Subject');
+        case 'expectedType':
+          return 'php:type:string';
+      }
+    }
+  }
+
+  /**
+   * Implementation of TfOperation::outputs().
+   */
+  protected function outputs() {
+    return array('Result');
+  }
+
+  /**
+   * Implementation of TfOperation::outputInfo().
+   */
+  protected function outputInfo($outputKey, $propertyKey) {
+    if ($outputKey == 'Result') {
+      switch ($propertyKey) {
+        case 'label':
+          return t('Result');
+      case 'description':
+        return t('Returns true if there was a error while writing the File.');
+
+        case 'expectedType':
+          return 'php:type:boolean';
+      }
+    }
+  }
+
+  /**
+   * Implementation of TfOperation::execute().
+   */
+  protected function execute(TfOutput $output) {
+    $search = $this->input('Search')->data();
+    $replace = $this->input('Replace')->data();
+    $subject = $this->input('Subject')->data();
+    
+    $output->set('Result', str_replace($search, $replace, $subject));
+  }
+}
\ No newline at end of file
