Index: pathfilter.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathfilter/pathfilter.module,v retrieving revision 1.5.2.1 diff -u -F^ -r1.5.2.1 pathfilter.module --- pathfilter.module 25 Dec 2006 00:11:44 -0000 1.5.2.1 +++ pathfilter.module 28 Jan 2008 02:47:41 -0000 @@ -63,13 +63,15 @@ // 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', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, ". $absolute .") .'\"'", $text); - + return preg_replace( + '/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e', + "'\"'. url('$1', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, ". variable_get("pathfilter_link_type_$format", 1) .") .'\"'", + $text + ); + // Filter settings for pathfilter. case 'settings': - return _pathfilter_settings(); + return _pathfilter_settings($format); } break; } @@ -78,7 +80,7 @@ /** * Helper settings function for hook_filter('settings'). */ -function _pathfilter_settings() { +function _pathfilter_settings($format) { $form = array(); $form['pathfilter'] = array( '#type' => 'fieldset', @@ -86,12 +88,16 @@ '#title' => t('Internal path filter' '#collapsible' => TRUE, '#collapsed' => FALSE, ); - $form['pathfilter']['pathfilter_link_type'] = array( + $form['pathfilter']["pathfilter_link_type_$format"] = 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'), + '#options' => array( + 1 => t('Absolute URLs'), + 0 => t('Relative paths') + ), + '#default_value' => variable_get("pathfilter_link_type_$format", 1), '#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 +}