Index: includes/views_customfield_handler_field_markup.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_customfield/includes/Attic/views_customfield_handler_field_markup.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 views_customfield_handler_field_markup.inc
--- includes/views_customfield_handler_field_markup.inc	19 Nov 2008 13:53:47 -0000	1.1.2.5
+++ includes/views_customfield_handler_field_markup.inc	26 May 2010 18:53:17 -0000
@@ -13,15 +13,16 @@ class views_customfield_handler_field_ma
 
   function query() {
     $this->field_alias = 'customfield_markup_'. $this->position;
-    
+
     $value = db_escape_string($this->options['value']);
     $this->query->add_field('', "'$value'", $this->field_alias);
   }
-  
+
   function option_definition() {
     $options = parent::option_definition();
     $options['value'] = array('default' => '');
     $options['format'] = array('default' => FILTER_FORMAT_DEFAULT);
+    $options['alter_value'] = array('default' => FALSE);
     return $options;
   }
 
@@ -34,10 +35,35 @@ class views_customfield_handler_field_ma
       '#rows' => 5,
     );
     $form['format'] = filter_form($this->options['format'], NULL, array('options', 'format'));
+    $form['alter_value'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use replacement patterns'),
+      '#default_value' => $this->options['alter_value'],
+      '#description' => t('Check this to use replacement patterns in the value field, like in <em>Rewrite the output of this field</em>'),
+    );
+    $form['alter']['help']['#dependency']['edit-options-alter-value'] = array(1);
+    $form['alter_value_help'] = array(
+        '#type' => 'hidden',
+        '#id' => 'views-tokens-help-alter-value',
+        '#prefix' => '<div><fieldset id="views-tokens-help-alter-value"><legend>' . t('Replacement patterns') . '</legend>' . t('See above for specific values.') . '</fieldset></div>',
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-value' => array(1),
+        ),
+      );
   }
 
   function render($values) {
     $value = $values->{$this->field_alias};
+    if ($this->options['alter_value']) {
+      $alter = array(
+        'alter_text' => $this->options['alter_value'],
+        'text' => $value,
+      );
+      $tokens = $this->get_render_tokens($alter);
+      $value = $this->render_altered($alter, $tokens);
+    }
+
     return check_markup($value, $this->options['format'], FALSE);
   }
 }
