From f22a119906d92e5208313cddda22307a4fe83848 Mon Sep 17 00:00:00 2001
From: Alastair Turner <bell@ctrlf5.co.za>
Date: Sat, 26 Feb 2011 16:31:41 +0200
Subject: [PATCH] Issue #1073886 by bellHead : Basic token input filter.

---
 token.module |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/token.module b/token.module
index 560c534..ff8d93d 100644
--- a/token.module
+++ b/token.module
@@ -938,6 +938,28 @@ function token_clean_token_name($name) {
 }
 
 /**
+ * Implementation of hook_filter_info.
+ * 
+ * Adds the Token filter to the input format options.
+ */
+function token_filter_info() {
+  $filters['filter_tokens'] = array(
+    'title' => t('Token'),
+    'description' => t('Replaces tokens in managed content.'),
+    'process callback' => '_token_filter_tokens',
+    'cache' => FALSE,
+  );
+  return $filters;
+}
+
+/**
+ *  Process callback for the token input filter
+ */
+function _token_filter_tokens($text, $filter, $format, $langcode, $cache, $cache_id) {
+  return token_replace($text);
+}
+
+/**
  * Do not use this function yet. Its API has not been finalized.
  */
 function token_render_array(array $array, array $options = array()) {
-- 
1.7.0.4

