diff -up pathfilter/pathfilter.info pathfilter-7.x-dev/pathfilter.info
--- pathfilter/pathfilter.info	2010-12-15 11:28:12.406250000 -0600
+++ pathfilter-7.x-dev/pathfilter.info	2011-02-22 10:28:17.141651100 -0600
@@ -1,11 +1,5 @@
-; $Id: pathfilter.info,v 1.1.2.2.2.1 2008/02/19 19:56:53 jbrown Exp $
+; $Id$
 name = Path Filter
 description = "Input filter to convert internal paths, such as &quot;internal:node/99&quot;, to their corresponding absolute URL or relative path."
-core = 6.x
-
-; Information added by drupal.org packaging script on 2008-02-19
-version = "6.x-1.0"
-core = "6.x"
-project = "pathfilter"
-datestamp = "1203451809"
-
+core = 7.x
+files[] = pathfilter.module
diff -up pathfilter/pathfilter.module pathfilter-7.x-dev/pathfilter.module
--- pathfilter/pathfilter.module	2010-12-15 11:28:12.406250000 -0600
+++ pathfilter-7.x-dev/pathfilter.module	2011-02-22 10:30:42.516651100 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pathfilter.module,v 1.5.2.1.2.1 2008/02/19 19:56:53 jbrown Exp $
+// $Id$
 
 /**
  * @file
@@ -15,82 +15,60 @@
  * [1] http://api.drupal.org/api/4.7/function/url
  *
  * Author:  Ray Zimmerman (drupal.org user "RayZ")
+ * Ported to D7: Brett Lischalk (drupal.org user "blischalk")
  *
  */
 
 /**
- * Implementation of hook_filter_tips().
- */
-function pathfilter_filter_tips($delta, $format, $long = FALSE) {
-  switch ($delta) {
-    case 0:
-      if ($long) {
-        return t('Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path. Given a site located at http://example.com/mysite, assuming clean URLs are enabled and "internal:admin/user" becomes "http://example.com/mysite/admin/user" and "internal:node/99" becomes "http://example.com/mysite/node/99". If \'node/99\' has a URL alias assigned, such as \'news/latest\' the alias will be substituted giving "http://example.com/mysite/news/latest".');
-      }
-      else {
-        return t('Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.');
-      }
-      break;
-  }
+* Implement hook_filter_info().
+*/
+function pathfilter_filter_info() {
+  $filters = array();
+  $filters['pathfilter'] = array(
+    'title' => t('URL Path Filter'),
+    'description' => t('Replaces "internal:node/nid" with the appropriate absolute url'),
+    'process callback' => '_pathfilter_filter_process',
+    'default settings' => array(
+      'pathfilter_link_type' => 'absolute',
+    ),
+    'settings callback' => '_pathfilter_settings',
+    'tips callback' => '_pathfilter_filter_tips',
+    );
+  return $filters;
 }
 
 /**
- * Implementation of hook_filter().
- */
-function pathfilter_filter($op, $delta = 0, $format = -1, $text = '') {
-  // The "list" operation provides the module an opportunity to declare both how
-  // many filters it defines and a human-readable name for each filter. Note that
-  // the returned name should be passed through t() for translation.
-  if ($op == 'list') {
-    return array(0 => t('Internal path filter'));
-  }
-
-  // All operations besides "list" provide a $delta argument so we know which
-  // filter they refer to.
-  switch ($delta) {
-    case 0:
-      switch ($op) {
-        // This description is shown in the administrative interface, unlike the
-        // filter tips which are shown in the content editing interface.
-        case 'description':
-          return t('Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.');
-
-        // We don't need the "prepare" operation for this filter, but it's required
-        // to at least return the input text as-is.
-        case 'prepare':
-          return $text;
-
-        // The actual filtering is performed here. The supplied text should be
-        // returned, once any necessary substitutions have taken place.
-        case 'process':
-          $absolute = (variable_get('pathfilter_link_type', 'absolute') == 'absolute' ? 'TRUE' : 'FALSE');
-          return preg_replace('/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e',
-              "'\"'. url('$1', array('query' => '$2' ? '$2' : NULL, 'fragment' => '$3' ? '$3' : NULL, 'absolute' => ". $absolute .")) .'\"'", $text);
-        // Filter settings for pathfilter.
-        case 'settings':
-          return _pathfilter_settings();
-      }
-      break;
-  }
+* pathfilter filter process callback
+*
+* The actual filtering is performed here. The supplied text should be
+* returned, once any necessary substitutions have taken place.
+*/
+function _pathfilter_filter_process($text, $filter, $format) {
+  $absolute = isset($filter->settings['pathfilter_link_type']) ? 'TRUE' : 'FALSE';
+  return preg_replace('/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e', "'\"'. url('$1', array('query' => '$2' ? '$2' : NULL, 'fragment' => '$3' ? '$3' : NULL, 'absolute' => ". $absolute .")) .'\"'", $text);
 }
 
 /**
+* Filter tips callback for creative juice filter.
+*
+* The tips callback allows filters to provide help text to users during the content
+* editing process. Short tips are provided on the content editing screen, while
+* long tips are provided on a separate linked page. Short tips are optional,
+* but long tips are highly recommended.
+*/
+function _pathfilter_filter_tips($filter, $format, $long = FALSE) {
+  return t('Replaces "internal:node/nid" with the appropriate absolute url');
+}
+/**
  * Helper settings function for hook_filter('settings').
  */
-function _pathfilter_settings() {
-  $form = array();
-  $form['pathfilter'] = array(
-    '#type' => 'fieldset', 
-    '#title' => t('Internal path filter'), 
-    '#collapsible' => TRUE, 
-    '#collapsed' => FALSE,
-  );
-  $form['pathfilter']['pathfilter_link_type'] = array(
+function _pathfilter_settings($form, $form_state, $filter, $format, $defaults) {
+  $settings['pathfilter_link_type'] = array(
     '#type' => 'radios',
     '#title' => t('Convert internal paths to'),
     '#options' => array('absolute' => t('Absolute links'), 'relative' => t('Relative links')),
-    '#default_value' => variable_get('pathfilter_link_type', 'absolute'),
+    '#default_value' => isset($filter->settings['pathfilter_link_type']) ? $filter->settings['pathfilter_link_type'] : $defaults['pathfilter_link_type'],
     '#description' => t('Should internal paths be transformed to absolute URLs, such as %absolute or relative paths, like %relative. Note that your changes may not appear until the cache has been cleared.', array('%absolute' => 'http://www.example.com/my-page', '%relative' => '/my-page')),
   );
-  return $form;
-}
\ No newline at end of file
+  return $settings;
+}
Only in pathfilter: po
Only in pathfilter: README.txt
