Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 672)
+++ trunk/CHANGELOG	(revision 673)
@@ -10,11 +10,14 @@
 # = Bugfix
 ! = Update/Change
 
-------------------------------------- 2.7.0 -------------------------------------
-08-Feb-2008 Thomas Hornik
--	Removed unused function is_access_denied() from search
-04-Feb-2008 Thomas Hornik
-!	email-addresses are excluded from search-results page.
+------------------------------------- 2.7.0 -------------------------------------
+08-Feb-2008 Christian Sommer
+-	Removed admin module mail_filter
++	Added revised version of the output filter module
+08-Feb-2008 Thomas Hornik
+-	Removed unused function is_access_denied() from search
+04-Feb-2008 Thomas Hornik
+!	email-addresses are excluded from search-results page.
 #	Fixed possible XSS in account/login.php and forgot-form.php
 04-Feb-2008 Christian Sommer
 #	allowed usage of tags in settings fields: website_header, website_footer
Index: trunk/wb/framework/frontend.functions.php
===================================================================
--- trunk/wb/framework/frontend.functions.php	(revision 672)
+++ trunk/wb/framework/frontend.functions.php	(revision 673)
@@ -370,8 +370,8 @@
 			}
     	}
   		// include the Javascript email protection function
-  		if($file_id != 'css' && file_exists(WB_PATH .'/modules/mail_filter/js/mdcr.js')) {
-			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/mail_filter/js/mdcr.js"></script>' ."\n";
+  		if($file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js')) {
+			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/output_filter/js/mdcr.js"></script>' ."\n";
 		}
   		
 		// write out links with all external module javascript/CSS files, remove last line feed
Index: trunk/wb/index.php
===================================================================
--- trunk/wb/index.php	(revision 672)
+++ trunk/wb/index.php	(revision 673)
@@ -79,24 +79,22 @@
 	}
 }
 
-if(file_exists(WB_PATH .'/modules/mail_filter/filter-routines.php')) {
-	// include the filter routines
-	require_once(WB_PATH .'/modules/mail_filter/filter-routines.php');
+if(file_exists(WB_PATH .'/modules/output_filter/filter-routines.php')) {
+	// include the output filter module routines
+	@require_once(WB_PATH .'/modules/output_filter/filter-routines.php');
 	
-	// get the mail filter settings from the database 
-	$mail_filter_settings = get_mail_filter_settings();
-	// check if we should filter emails before displaying them
-	if($mail_filter_settings['email_filter'] == '1') {
-		// filter email addresses before displaying them
+	if(function_exists('filter_frontend_output')) {
+		// store output in variable for filtering
 		ob_start();
 		require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
 		$frontend_output = ob_get_contents();
 		ob_end_clean();
-		$frontend_output = filter_email_links($frontend_output);
-		echo $frontend_output;
+		// Display the filtered output on the frontend
+		echo filter_frontend_output($frontend_output);
 		die;
 	}
-}
+}	
+
 // Display the template (no output filtering)
 require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
 
Index: trunk/wb/modules/mail_filter/uninstall.php
===================================================================
--- trunk/wb/modules/mail_filter/uninstall.php	(revision 672)
+++ trunk/wb/modules/mail_filter/uninstall.php	(nonexistent)
@@ -1,32 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// prevent this file from being accessed directly
-if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
-
-$table = TABLE_PREFIX .'mod_mail_filter';
-$database->query("DROP TABLE `$table`");
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/uninstall.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/install.php
===================================================================
--- trunk/wb/modules/mail_filter/install.php	(revision 672)
+++ trunk/wb/modules/mail_filter/install.php	(nonexistent)
@@ -1,45 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// prevent this file from being accessed directly
-if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
-
-$table = TABLE_PREFIX .'mod_mail_filter';
-$database->query("DROP TABLE IF EXISTS `$table`");
-
-$database->query("CREATE TABLE `$table` (
-	`email_filter` VARCHAR(1) NOT NULL DEFAULT '0',
-	`mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0',
-	`at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)',
-	`dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)'
-	)"
-);
-
-// add new row using the table default values defined above
-//$database->query("INSERT INTO ".TABLE_PREFIX."mod_mail_filter");
-$database->query("INSERT INTO ".TABLE_PREFIX."mod_mail_filter (email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0', '0', '(at)', '(dot)')");
-
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/install.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/index.php
===================================================================
--- trunk/wb/modules/mail_filter/index.php	(revision 672)
+++ trunk/wb/modules/mail_filter/index.php	(nonexistent)
@@ -1,28 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header('Location: ../index.php');
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/index.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/js/mdcr.js
===================================================================
--- trunk/wb/modules/mail_filter/js/mdcr.js	(revision 672)
+++ trunk/wb/modules/mail_filter/js/mdcr.js	(nonexistent)
@@ -1,23 +0,0 @@
-/*
---------------------------------------------------------------------------------
-  MDCR (Mail DeCrypt Routine) for Website Baker v2.6.x
-  Licencsed under GNU, written by Christian Sommer (Doc)
---------------------------------------------------------------------------------
-*/
-
-function mdcr(s) {
-  location.href=dcstr(s);
-}
-
-function dcstr(s) {
-  var m = unescape(s);
-  var x = m.charCodeAt(7)-97;
-  var c = m.substr(0,7) + m.substr(8);
-  var n=0;
-  var r="";
-
-  for(var i=0; i<c.length; i++) {
-    r+=String.fromCharCode(c.charCodeAt(i) - x);
-  }
-  return r;
-}
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/js/mdcr.js
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/js/index.php
===================================================================
--- trunk/wb/modules/mail_filter/js/index.php	(revision 672)
+++ trunk/wb/modules/mail_filter/js/index.php	(nonexistent)
@@ -1,28 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/js/index.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/tool.php
===================================================================
--- trunk/wb/modules/mail_filter/tool.php	(revision 672)
+++ trunk/wb/modules/mail_filter/tool.php	(nonexistent)
@@ -1,111 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// direct access prevention
-defined('WB_PATH') OR die(header('Location: ../index.php'));
-
-// check if module language file exists for the language set by the user (e.g. DE, EN)
-if(!file_exists(WB_PATH .'/modules/mail_filter/languages/'.LANGUAGE .'.php')) {
-	// no module language file exists for the language set by the user, include default module language file EN.php
-	require_once(WB_PATH .'/modules/mail_filter/languages/EN.php');
-} else {
-	// a module language file exists for the language defined by the user, load it
-	require_once(WB_PATH .'/modules/mail_filter/languages/'.LANGUAGE .'.php');
-}
-// check if data was submitted
-if(isset($_POST['save_settings'])) {
-	// get configuration settings
-	$email_filter = ($_POST['email_filter'] == '1') ? '1' : '0';
-	$mailto_filter = ($_POST['mailto_filter'] == '1') ? '1' : '0';
-	
-	// get replacement settings
-	$at_replacement = strip_tags($_POST['at_replacement']);
-	$at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)';
-	$dot_replacement = strip_tags($_POST['dot_replacement']);
-	$dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)';
-	
-	// update database settings
-	$database->query("UPDATE " .TABLE_PREFIX ."mod_mail_filter SET email_filter = '$email_filter', 
-		mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'");
-
-	// check if there is a database error, otherwise say successful
-	if($database->is_error()) {
-		$admin->print_error($database->get_error(), $js_back);
-	} else {
-		$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=mail_filter');
-	}
-
-} else {
-	// write out heading
-	echo '<h2>' .$MOD_MAIL_FILTER['HEADING'] .'</h2>';
-
-	// include filter functions
-	require_once(WB_PATH .'/modules/mail_filter/filter-routines.php');
-	
-	// read the mail filter settings from the database 
-	$data = get_mail_filter_settings();
-	
-	// output the form with values from the database
-	echo '<p>' .$MOD_MAIL_FILTER['HOWTO'] .'</p>';
-?>
-<form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
-	<table width="98%" cellspacing="0" cellpadding="5px" class="row_a">
-	<tr><td colspan="2"><strong><?php echo $MOD_MAIL_FILTER['BASIC_CONF'];?>:</strong></td></tr>
-	<tr>
-		<td width="35%"><?php echo $MOD_MAIL_FILTER['EMAIL_FILTER'];?>:</td>
-		<td>
-			<input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?> 
-				name="email_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
-			<input type="radio" <?php echo ($data['email_filter']=='0') ?'checked="checked"' :'';?> 
-				name="email_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
-		</td>
-	</tr>
-	<tr>
-		<td><?php echo $MOD_MAIL_FILTER['MAILTO_FILTER'];?>:</td>
-		<td>
-			<input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?>
-				name="mailto_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
-			<input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?>
-				name="mailto_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
-		</td>
-	</tr>
-	<tr><td colspan="2"><br /><strong><?php echo $MOD_MAIL_FILTER['REPLACEMENT_CONF'];?>:</strong></td></tr>
-	<tr>
-		<td><?php echo $MOD_MAIL_FILTER['AT_REPLACEMENT'];?>:</td>
-		<td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>" 
-			name="at_replacement"/></td>
-	</tr>
-	<tr>
-		<td><?php echo $MOD_MAIL_FILTER['DOT_REPLACEMENT'];?>:</td>
-		<td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>" 
-			name="dot_replacement"/></td>
-	</tr>
-	</table>
-	<input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" />
-</form>
-<?php
-}
-
-?>

Property changes on: trunk/wb/modules/mail_filter/tool.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/info.php
===================================================================
--- trunk/wb/modules/mail_filter/info.php	(revision 672)
+++ trunk/wb/modules/mail_filter/info.php	(nonexistent)
@@ -1,42 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
- -----------------------------------------------------------------------------------------
-  Email Output Filter tool for Website Baker v2.7
-  Licencsed under GNU, written by Christian Sommer (Doc)
- -----------------------------------------------------------------------------------------
-   v0.10  (doc; 21 Jan, 2008)
-    + initial module release (Note: requires WB 2.7 core file changes to work)
-
-*/
-
-$module_directory 	= 'mail_filter';
-$module_name 			= 'Email Output Filter';
-$module_function 		= 'tool';
-$module_version 		= '0.10';
-$module_platform 		= '2.7.x';
-$module_author 		= 'Christian Sommer (doc)';
-$module_license 		= 'GNU General Public License';
-$module_description 	= 'This module allows you to define rewrite rules for emails (e.g. <em>name@mail.com</em> --> <em>name(at)mail(dot).com</em>).';
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/info.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/languages/DE.php
===================================================================
--- trunk/wb/modules/mail_filter/languages/DE.php	(revision 672)
+++ trunk/wb/modules/mail_filter/languages/DE.php	(nonexistent)
@@ -1,47 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
- -----------------------------------------------------------------------------------------
-  DEUTSCHE SPRACHDATEI FUER DAS MODUL: MAIL_FILTER
- -----------------------------------------------------------------------------------------
-*/
-
-// Deutsche Modulbeschreibung
-$module_description 	= 'Dieses Modul erlaubt Emailfilterung vor der Ausgabe (z.B. <em>name@email.de</em> --> <em>name(at)email(dot).de</em>).';
-
-// Überschriften und Textausgaben
-$MOD_MAIL_FILTER['HEADING']				= 'Email Ausgabe Filterung';
-$MOD_MAIL_FILTER['HOWTO']					= 'Mit nachfolgenden Optionen kann die Emailfilterung ein- und ausgeschaltet werden. Um die Javascript mailto: Verschl&uuml;sselung zu aktivieren, muss die PHP Funktion <em>register_frontend_modfiles(\'js\')</em> in der index.php des Templates eingebunden werden.';
-
-// Text and captions of form elements
-$MOD_MAIL_FILTER['BASIC_CONF']			= 'Grundeinstellungen';
-$MOD_MAIL_FILTER['EMAIL_FILTER']			= 'Textmail Filterung';
-$MOD_MAIL_FILTER['MAILTO_FILTER']		= 'Mailto Filterung (Javascript)';
-$MOD_MAIL_FILTER['ENABLED']				= 'Aktiviert';
-$MOD_MAIL_FILTER['DISABLED']				= 'Ausgeschaltet';
-
-$MOD_MAIL_FILTER['REPLACEMENT_CONF']	= 'Email Ersetzungen';
-$MOD_MAIL_FILTER['AT_REPLACEMENT']		= 'Ersetzte "@" durch';
-$MOD_MAIL_FILTER['DOT_REPLACEMENT']		= 'Ersetze "." durch';
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/languages/DE.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/languages/EN.php
===================================================================
--- trunk/wb/modules/mail_filter/languages/EN.php	(revision 672)
+++ trunk/wb/modules/mail_filter/languages/EN.php	(nonexistent)
@@ -1,44 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
- -----------------------------------------------------------------------------------------
-  ENGLISH LANGUAGE FILE FOR THE ADDON: MAIL FILTER
- -----------------------------------------------------------------------------------------
-*/
-
-// Headings and text outputs
-$MOD_MAIL_FILTER['HEADING']				= 'Email Output Filter';
-$MOD_MAIL_FILTER['HOWTO']					= 'You can enable/disable the output filtering of emails with the options below. For Javascript mailto: encryption you need to add the <em>register_frontend_modfiles(\'js\')</em> PHP function call to the index.php of your template.';
-
-// Text and captions of form elements
-$MOD_MAIL_FILTER['BASIC_CONF']			= 'Basic Configuration';
-$MOD_MAIL_FILTER['EMAIL_FILTER']			= 'Email Output Filter';
-$MOD_MAIL_FILTER['MAILTO_FILTER']		= 'Javascript Encryption (mailto)';
-$MOD_MAIL_FILTER['ENABLED']				= 'Enabled';
-$MOD_MAIL_FILTER['DISABLED']				= 'Disabled';
-
-$MOD_MAIL_FILTER['REPLACEMENT_CONF']	= 'Email Replacements';
-$MOD_MAIL_FILTER['AT_REPLACEMENT']		= 'Replace "@" by';
-$MOD_MAIL_FILTER['DOT_REPLACEMENT']		= 'Replace "." by';
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/languages/EN.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/languages/index.php
===================================================================
--- trunk/wb/modules/mail_filter/languages/index.php	(revision 672)
+++ trunk/wb/modules/mail_filter/languages/index.php	(nonexistent)
@@ -1,28 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/modules/mail_filter/languages/index.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/mail_filter/filter-routines.php
===================================================================
--- trunk/wb/modules/mail_filter/filter-routines.php	(revision 672)
+++ trunk/wb/modules/mail_filter/filter-routines.php	(nonexistent)
@@ -1,179 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// direct access prevention
-defined('WB_PATH') OR die(header('Location: ../index.php'));
-
-
-// function to read the current filter settings
-if (!function_exists('get_mail_filter_settings')) {
-	function get_mail_filter_settings() {
-		global $database, $admin;
-		// connect to database and read out filter settings
-		$result = $database->query("SELECT * FROM " .TABLE_PREFIX ."mod_mail_filter");
-		if($result->numRows() > 0) {
-			// get all data
-			$data = $result->fetchRow();
-			$filter_settings['email_filter'] = $admin->strip_slashes($data['email_filter']);
-			$filter_settings['mailto_filter'] = $admin->strip_slashes($data['mailto_filter']);
-			$filter_settings['at_replacement'] = $admin->strip_slashes($data['at_replacement']);
-			$filter_settings['dot_replacement'] = $admin->strip_slashes($data['dot_replacement']);
-		} else {
-			// something went wrong, use dummy value
-			$filter_settings['email_filter'] = '0';
-			$filter_settings['mailto_filter'] = '0';
-			$filter_settings['at_replacement'] = '(at)';
-			$filter_settings['dot_replacement'] = '(dot)';
-		}
-		
-		// return array with filter settings
-		return $filter_settings;
-	}
-}
-
-
-// function to rewrite email before beeing displayed the frontend
-if (!function_exists('filter_email_links')) {
-	function filter_email_links($content) {
-		// get the mailer settings from the global variable defined in /wb/index.php
-		global $mail_filter_settings;
-
-		// check if there is anything to do
-		global $mail_filter_settings;
-		if(!isset($mail_filter_settings['email_filter']) || $mail_filter_settings['email_filter'] !=='1' ||
-			!isset($mail_filter_settings['mailto_filter']) || !isset($mail_filter_settings['at_replacement']) || 
-			!isset($mail_filter_settings['dot_replacement'])) {
-			return $content;
-		}
-
-		// search pattern to find all mail addresses embedded in the frontend content (both text and mailto emails)
-		$pattern = '#(<a href="mailto:)?(\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,})([^">]*">)?([^<]*</a>)?#i';
-		/*
-			exp 1:  (<a href=mailto:)?	-> Optional: search for <a href=mailto:
-			exp 2a: (\w[\w|\.|\-]+@ 	 	-> 1st char word element, one ore more (+) word elements, or (|) . or (|) - followed by @
-			exp 2b: \w[\w|\.|\-]+ 		-> see exp 2 for explanation
-			exp 2c: \.[a-zA-Z]{2,})  	-> dot followed by at least 2 characters (TLD filter: .de, .com, .info) 
-			exp 3: ([^">]*">)?  			-> Optional: all characters except > followed by ">; could contain ?subject=...&body=...
-			exp 4: ([^<]*</a>)?  			-> Optional: all characters except <; email link message
-			? 1 or 0 matches, # encapsulate regex, () subpattern as additional array element, i.. inherent (not case sensitive)
-		*/
-
-		// find all email addresses embedded in the content and encrypt them via callback function encrypt_emails
-		$content = preg_replace_callback($pattern, 'encrypt_emails', $content);
-		return $content;
-	}
-}
-
-
-// function to encrypt mailto links before beeing displayed at the frontend
-if (!function_exists('encrypt_emails')) {
-	function encrypt_emails($match) { 
-		// get the mailer settings from the global variable defined in /wb/index.php
-		global $mail_filter_settings;
-
-		// check if there is anything to do
-		if(!isset($mail_filter_settings['email_filter']) || $mail_filter_settings['email_filter'] !=='1' ||
-			!isset($mail_filter_settings['mailto_filter']) || !isset($mail_filter_settings['at_replacement']) || 
-			!isset($mail_filter_settings['dot_replacement'])) {
-			return $match[0];
-		}
-		
-		// work out replacements
-		$at_replace = strip_tags($mail_filter_settings['at_replacement']);
-		$dot_replace = strip_tags($mail_filter_settings['dot_replacement']);
-
-		// check if extracted email address is mailto or text ($match[0] contains entire regexp pattern)
-		if (strpos($match[0], "mailto:") > 0) {
-			// mailto email
-
-			// do we need to consider mailto links
-			if($mail_filter_settings['mailto_filter'] !='1') {
-				// do not touch mailto links
-				return $match[0];
-			}
-			
-			// email sub parts: [<a href="mailto:] [name@domain.com] [?subject=blubb&Body=text">] [Mail description</a>]
-			$email_href			= $match[1];	// a href part
-			$email_address		= $match[2];	// email address
-			$email_options 	= $match[3];	// optional: subject or body text for mail clients
-			$email_link_text 	= $match[4];	// optional: mail description
-
-			// do some cleaning
-			$email_options 	= str_replace("\">", "", $email_options);					// strip off '">'
-			$email_link_text 	= str_replace("</a>", "", trim($email_link_text));		// strip off closing </a>
-
-			// make sure that all emails have a description
-			if(strlen($email_link_text) == 0 ) {
-				$email_link_text = $email_address;
-			}
-
-			// replace "@" and "." within top level domain (TLD) if link text is a valid email address
-			if(preg_match('#\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,}#i', $email_link_text, $email)) {
-				$email_link_text = str_replace("@", $at_replace, $email_address);		// replace @
-				// remove "." from top level domain (TLD) part
-				if (preg_match('#\.[a-zA-Z]{2,}$#im', $email_link_text, $tld) !==0) {
-					$tld_replace =  str_replace(".", $dot_replace, $tld[0]);
-					$email_link_text = str_replace($tld[0], $tld_replace, $email_link_text);				// replace . in email TLD part
-				}
-			}
-		
-			//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-			// encrypt the email address
-			//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-			// create random encryption key
-			mt_srand((double)microtime()*1000000);			// initialize the randomizer (PHP < 4.2.0)
-			$char_shift = mt_rand(1, 5);						// shift:=1; a->b, shift:=5; a-->f
-			$decryption_key = chr($char_shift+97);			// ASCII a:=97
-		
-			// prepare mailto string for encryption (mail protocol, decryption key, mail address)
-			$email_address = "mailto:" .$decryption_key .$email_address;
-		
-			// encrypt email address by shifting characters
-		  	$encrypted_email = "";
-			for($i=0; $i<strlen($email_address); $i++) {
-				$encrypted_email .= chr(ord($email_address[$i]) + $char_shift);
-			}
-			$encrypted_email[7] = $decryption_key;			// replace first character after mailto: with decryption key 
-			$encrypted_email = rawurlencode($encrypted_email);
-
-			// return encrypted javascript mailto link
-			$mailto_link  = "<a href=\"javascript:mdcr('";		// a href part with javascript function to decrypt the email address
-			$mailto_link .= "$encrypted_email')\">";				// add encrypted email address as paramter to JS function mdcr
-			$mailto_link .= $email_link_text ."</a>";				// add email link text and closing </a> tag
-			return $mailto_link;
-		
-		} else {
-			// text email (e.g. name@domain.com)
-			$match[0] = str_replace("@", $at_replace, $match[0]);		// replace @
-			// remove "." from top level domain (TLD) part
-			if (preg_match('#\.[a-zA-Z]{2,}$#im', $match[0], $tld) !==0) {
-				$tld_replace =  str_replace(".", $dot_replace, $tld[0]);
-				return str_replace($tld[0], $tld_replace, $match[0]);							// replace . in email TLD part
-			}
-		}
-	}
-}
-
-?>

Property changes on: trunk/wb/modules/mail_filter/filter-routines.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/output_filter/uninstall.php
===================================================================
--- trunk/wb/modules/output_filter/uninstall.php	(nonexistent)
+++ trunk/wb/modules/output_filter/uninstall.php	(revision 673)
@@ -0,0 +1,32 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// prevent this file from being accessed directly
+if(!defined('WB_PATH')) die(header('Location: ../index.php'));
+
+$table = TABLE_PREFIX .'mod_output_filter';
+$database->query("DROP TABLE IF EXISTS `$table`");
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/filter-routines.php
===================================================================
--- trunk/wb/modules/output_filter/filter-routines.php	(nonexistent)
+++ trunk/wb/modules/output_filter/filter-routines.php	(revision 673)
@@ -0,0 +1,194 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// prevent this file from being accessed directly
+if(!defined('WB_PATH')) die(header('Location: ../index.php'));
+
+// function to read the current filter settings
+if (!function_exists('get_output_filter_settings')) {
+	function get_output_filter_settings() {
+		global $database, $admin;
+		// connect to database and read out filter settings
+		$result = $database->query("SELECT * FROM " .TABLE_PREFIX ."mod_output_filter");
+		if($result->numRows() > 0) {
+			// get all data
+			$data = $result->fetchRow();
+			$filter_settings['email_filter'] = $admin->strip_slashes($data['email_filter']);
+			$filter_settings['mailto_filter'] = $admin->strip_slashes($data['mailto_filter']);
+			$filter_settings['at_replacement'] = $admin->strip_slashes($data['at_replacement']);
+			$filter_settings['dot_replacement'] = $admin->strip_slashes($data['dot_replacement']);
+		} else {
+			// something went wrong, use default values
+			$filter_settings['email_filter'] = '0';
+			$filter_settings['mailto_filter'] = '0';
+			$filter_settings['at_replacement'] = '(at)';
+			$filter_settings['dot_replacement'] = '(dot)';
+		}
+		
+		// return array with filter settings
+		return $filter_settings;
+	}
+}
+
+// function to filter the output before displaying it on the frontend
+if (!function_exists('filter_frontend_output')) {
+	function filter_frontend_output($content) {
+		// get output filter settings from database
+		$filter_settings = get_output_filter_settings();
+		
+		// work out the defined output filter mode: possible output filter modes: [0], 1, 2, 3, 6, 7
+		// 2^0 * (0.. disable, 1.. enable) filtering of mail addresses in text
+		// 2^1 * (0.. disable, 1.. enable) filtering of mail addresses in mailto links
+		// 2^2 * (0.. disable, 1.. enable) Javascript mailto encryption (only if mailto filtering enabled)
+
+		// only filter output if we are supposed to
+		if($filter_settings['email_filter'] != '1' && $filter_settings['mailto_filter'] != '1'){
+			// nothing to do ...
+			return $content;
+		}
+
+		// check if non mailto mail addresses needs to be filtered
+		$output_filter_mode = ($filter_settings['email_filter'] == '1') ? 1 : 0;		// 0|1
+		
+		// check if mailto mail addresses needs to be filtered
+		if($filter_settings['mailto_filter'] == '1') {
+			$output_filter_mode = $output_filter_mode + 2;														// 0|2
+						
+			// check if Javascript mailto encryption is enabled (call register_frontend_functions in the template)
+			$search = '<script type="text/javascript" src="' .WB_URL .'/modules/output_filter/js/mdcr.js"></script>';
+			if(strpos($content, $search) !== false) { 
+				$output_filter_mode = $output_filter_mode + 4;													// 0|4
+			}
+		}
+		
+		// define some constants so we do not call the database in the callback function again
+		define('OUTPUT_FILTER_MODE', (int) $output_filter_mode);
+		define('OUTPUT_FILTER_AT_REPLACEMENT', $filter_settings['at_replacement']);
+		define('OUTPUT_FILTER_DOT_REPLACEMENT', $filter_settings['dot_replacement']);
+		
+		// first search part to find all mailto email addresses
+		$pattern = '#(<a.*?href\s*?=\s*?"\s*?mailto\s*?:\s*?)([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})([^"]*?)"([^>]*>)(.*?)</a>';
+		// second part to find all non mailto email addresses
+		$pattern .= '|\b([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})\b#i';
+		/*
+		Sub 1:(<a.*?href\s*?=\s*?"\s*?mailto\s*?:\s*?)					-->	"<a id="yyy" class="xxx" href = " mailto :" ignoring white spaces
+		Sub 2:([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})			-->	the email address in the mailto: part of the mail link
+		Sub 3:([^"]*?)"																					--> possible ?Subject&cc... stuff attached to the mail address
+		Sub 4:([^>]*>)																					--> all class or id statements after the mailto but before closing ..>
+		Sub 5:(.*?)</a>																					--> the mailto text; all characters between >xxxxx</a>
+		Sub 6:|\b([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})\b	--> email addresses which may appear in the text (require word boundaries)
+		*/
+			
+		// find all email addresses embedded in the content and filter them using a callback function
+		$content = preg_replace_callback($pattern, 'filter_mail_addresses', $content);
+		return $content;
+	}
+}		
+
+
+// function to filter mail addresses embedded in text or mailto links before outputing them on the frontend
+if (!function_exists('filter_mail_addresses')) {
+	function filter_mail_addresses($match) { 
+		
+		// check if required output filter mode is defined
+		if(!(defined('OUTPUT_FILTER_MODE') && defined('OUTPUT_FILTER_MODE') && defined('OUTPUT_FILTER_MODE'))) {
+			return $match[0];
+		}
+		
+		$search = array('@', '.');
+		$replace = array(OUTPUT_FILTER_AT_REPLACEMENT ,OUTPUT_FILTER_DOT_REPLACEMENT);
+		
+		// check if the match contains the expected number of subpatterns (6|7)
+		if(count($match) == 7) {
+			/**
+				OUTPUT FILTER FOR EMAIL ADDRESSES EMBEDDED IN TEXT
+			**/
+			
+			// 1.. text mails only, 3.. text mails + mailto (no JS), 7 text mails + mailto (JS)
+			if(!in_array(OUTPUT_FILTER_MODE, array(1,3,7))) return $match[0];
+			
+			// filtering of non mailto email addresses enabled
+			return str_replace($search, $replace, $match[0]);
+				
+		} elseif(count($match) == 6) {
+			/**
+				OUTPUT FILTER FOR EMAIL ADDRESSES EMBEDDED IN MAILTO LINKS
+			**/
+
+			// 2.. mailto only (no JS), 3.. text mails + mailto (no JS), 6.. mailto only (JS), 7.. all filters active
+			if(!in_array(OUTPUT_FILTER_MODE, array(2,3,6,7))) return $match[0];
+			
+			// check if last part of the a href link: >xxxx</a> contains a email address we need to filter
+			$pattern = '#\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b#i';
+			if(preg_match($pattern, $match[5])) {
+				$match[5] = str_replace($search, $replace, $match[5]);
+			}
+
+			// check if Javascript encryption routine is enabled
+			if(in_array(OUTPUT_FILTER_MODE, array(6,7))) {
+				/** USE JAVASCRIPT ENCRYPTION FOR MAILTO LINKS **/
+
+				// create random encryption key
+				mt_srand((double)microtime()*1000000);						// initialize the randomizer (PHP < 4.2.0)
+				$char_shift = mt_rand(1, 5);											// shift:=1; a->b, shift:=5; a-->f
+				$decryption_key = chr($char_shift+97);						// ASCII a:=97
+		
+				// prepare mailto string for encryption (mail protocol, decryption key, mail address)
+				$email_address = "mailto:" .$decryption_key .$match[2] .$match[3];
+		
+				// encrypt email address by shifting characters
+		  	$encrypted_email = "";
+				for($i=0; $i<strlen($email_address); $i++) {
+					$encrypted_email .= chr(ord($email_address[$i]) + $char_shift);
+				}
+				$encrypted_email[7] = $decryption_key;						// replace first character after mailto: with decryption key 
+				$encrypted_email = rawurlencode($encrypted_email);
+
+				// return encrypted javascript mailto link
+				$mailto_link  = "<a href=\"javascript:mdcr('";		// a href part with javascript function to decrypt the email address
+				$mailto_link .= "$encrypted_email')\">";					// add encrypted email address as paramter to JS function mdcr
+				$mailto_link .= $match[5] ."</a>";								// add email link text and closing </a> tag
+				return $mailto_link;	
+
+			} else {
+				/** DO NOT USE JAVASCRIPT ENCRYPTION FOR MAILTO LINKS **/
+
+				// as minimum protection, replace replace @ in the mailto part by (at)
+				// dots are not transformed as this would required as my.name@domain.com would look like: my(dot)name(at)domain(dot)com
+				
+				// rebuild the mailto link from the subpatterns (at the missing characters " and </a>")
+				return $match[1] .str_replace('@', OUTPUT_FILTER_AT_REPLACEMENT, $match[2]) .$match[3] .'"' .$match[4] .$match[5] .'</a>';
+				// if you want to protect both, @ and dots, comment out the line above and remove the comment from the line below
+				// return $match[1] .str_replace($search, $replace, $match[2]) .$match[3] .'"' .$match[4] .$match[5] .'</a>';
+			}
+		
+		}
+		
+		// number of subpatterns do not match the requirements ... do nothing
+		return $match[0];
+	}		
+}
+
+?>
Index: trunk/wb/modules/output_filter/info.php
===================================================================
--- trunk/wb/modules/output_filter/info.php	(nonexistent)
+++ trunk/wb/modules/output_filter/info.php	(revision 673)
@@ -0,0 +1,45 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+ -----------------------------------------------------------------------------------------
+  Output Filter tool for Website Baker v2.7
+  Licencsed under GNU, written by Christian Sommer (Doc)
+ -----------------------------------------------------------------------------------------
+   v0.11  (Chritian Sommer; 06 Feb, 2008)
+    ~ renamed module to output filter, splitted email filter in two functions (text emails, mailto links)
+
+   v0.10  (Christian Sommer; 21 Jan, 2008)
+    ~ initial module release (Note: requires WB 2.7 core file changes to work)
+
+*/
+
+$module_directory 	= 'output_filter';
+$module_name 				= 'Frontend Output Filter';
+$module_function 		= 'tool';
+$module_version 		= '0.11';
+$module_platform 		= '2.7.x';
+$module_author 			= 'Christian Sommer (doc)';
+$module_license 		= 'GNU General Public License';
+$module_description = 'This module allows to filter the output before displaying it on the frontend. Support for filtering mailto links and mail addresses in strings.';
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/tool.php
===================================================================
--- trunk/wb/modules/output_filter/tool.php	(nonexistent)
+++ trunk/wb/modules/output_filter/tool.php	(revision 673)
@@ -0,0 +1,111 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// prevent this file from being accessed directly
+if(!defined('WB_PATH')) die(header('Location: ../index.php'));
+
+// check if module language file exists for the language set by the user (e.g. DE, EN)
+if(!file_exists(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php')) {
+	// no module language file exists for the language set by the user, include default module language file EN.php
+	require_once(WB_PATH .'/modules/output_filter/languages/EN.php');
+} else {
+	// a module language file exists for the language defined by the user, load it
+	require_once(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php');
+}
+// check if data was submitted
+if(isset($_POST['save_settings'])) {
+	// get overall output filter settings
+	$email_filter = (isset($_POST['email_filter']) && $_POST['email_filter'] == '1') ? '1' : '0';
+	$mailto_filter = (isset($_POST['mailto_filter']) && $_POST['mailto_filter'] == '1') ? '1' : '0';
+	
+	// get email replacement settings
+	$at_replacement = isset($_POST['at_replacement']) ?strip_tags($_POST['at_replacement']) : '';
+	$at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)';
+	$dot_replacement = isset($_POST['dot_replacement']) ?strip_tags($_POST['dot_replacement']) : '';
+	$dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)';
+	
+	// update database settings
+	$database->query("UPDATE " .TABLE_PREFIX ."mod_output_filter SET email_filter = '$email_filter', 
+		mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'");
+
+	// check if there is a database error, otherwise say successful
+	if($database->is_error()) {
+		$admin->print_error($database->get_error(), $js_back);
+	} else {
+		$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=output_filter');
+	}
+
+} else {
+	// write out heading
+	echo '<h2>' .$MOD_MAIL_FILTER['HEADING'] .'</h2>';
+
+	// include filter functions
+	require_once(WB_PATH .'/modules/output_filter/filter-routines.php');
+	
+	// read the mail filter settings from the database 
+	$data = get_output_filter_settings();
+	
+	// output the form with values from the database
+	echo '<p>' .$MOD_MAIL_FILTER['HOWTO'] .'</p>';
+?>
+<form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post">
+	<table width="98%" cellspacing="0" cellpadding="5px" class="row_a">
+	<tr><td colspan="2"><strong><?php echo $MOD_MAIL_FILTER['BASIC_CONF'];?>:</strong></td></tr>
+	<tr>
+		<td width="35%"><?php echo $MOD_MAIL_FILTER['EMAIL_FILTER'];?>:</td>
+		<td>
+			<input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?>
+				name="email_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
+			<input type="radio" <?php echo (($data['email_filter'])=='0') ?'checked="checked"' :'';?>
+				name="email_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
+		</td>
+	</tr>
+	<tr>
+		<td><?php echo $MOD_MAIL_FILTER['MAILTO_FILTER'];?>:</td>
+		<td>
+			<input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?>
+				name="mailto_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
+			<input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?>
+				name="mailto_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
+		</td>
+	</tr>
+	<tr><td colspan="2"><br /><strong><?php echo $MOD_MAIL_FILTER['REPLACEMENT_CONF'];?>:</strong></td></tr>
+	<tr>
+		<td><?php echo $MOD_MAIL_FILTER['AT_REPLACEMENT'];?>:</td>
+		<td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>" 
+			name="at_replacement"/></td>
+	</tr>
+	<tr>
+		<td><?php echo $MOD_MAIL_FILTER['DOT_REPLACEMENT'];?>:</td>
+		<td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>" 
+			name="dot_replacement"/></td>
+	</tr>
+	</table>
+	<input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" />
+</form>
+<?php
+}
+
+?>
Index: trunk/wb/modules/output_filter/languages/EN.php
===================================================================
--- trunk/wb/modules/output_filter/languages/EN.php	(nonexistent)
+++ trunk/wb/modules/output_filter/languages/EN.php	(revision 673)
@@ -0,0 +1,44 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+ -----------------------------------------------------------------------------------------
+  ENGLISH LANGUAGE FILE FOR THE ADDON: OUTPUT_FILTER
+ -----------------------------------------------------------------------------------------
+*/
+
+// Headings and text outputs
+$MOD_MAIL_FILTER['HEADING']				= 'Options: Output Filter';
+$MOD_MAIL_FILTER['HOWTO']						= 'You can configure the output filtering with the options below.<p style="line-height:1.5em;"><strong>Tip: </strong>Mailto links can be encrypted by a Javascript function. To make use of this option, one needs to add the PHP code <code style="background:#FFA;color:#900;">&lt;?php register_frontend_modfiles(\'js\');?&gt;</code> into the &lt;head&gt; section of the index.php of your template. Without this modification, only the @ character in the mailto part will be replaced.</p>';
+
+// Text and captions of form elements
+$MOD_MAIL_FILTER['BASIC_CONF']			= 'Basic Email Configuration';
+$MOD_MAIL_FILTER['EMAIL_FILTER']		= 'Filter Email addresses in text';
+$MOD_MAIL_FILTER['MAILTO_FILTER']		= 'Filter Email addresses in mailto links';
+$MOD_MAIL_FILTER['ENABLED']					= 'Enabled';
+$MOD_MAIL_FILTER['DISABLED']				= 'Disabled';
+
+$MOD_MAIL_FILTER['REPLACEMENT_CONF']= 'Email Replacements';
+$MOD_MAIL_FILTER['AT_REPLACEMENT']	= 'Replace "@" by';
+$MOD_MAIL_FILTER['DOT_REPLACEMENT']	= 'Replace "." by';
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/languages/index.php
===================================================================
--- trunk/wb/modules/output_filter/languages/index.php	(nonexistent)
+++ trunk/wb/modules/output_filter/languages/index.php	(revision 673)
@@ -0,0 +1,28 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+header("Location: ../../../index.php");
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/languages/DE.php
===================================================================
--- trunk/wb/modules/output_filter/languages/DE.php	(nonexistent)
+++ trunk/wb/modules/output_filter/languages/DE.php	(revision 673)
@@ -0,0 +1,47 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+ -----------------------------------------------------------------------------------------
+  DEUTSCHE SPRACHDATEI FUER DAS MODUL: OUTPUT_FILTER
+ -----------------------------------------------------------------------------------------
+*/
+
+// Deutsche Modulbeschreibung
+$module_description 								= 'Dieses Modul erlaubt die Filterung von Inhalten vor der Anzeige im Frontendbereich. Unterst&uuml;zt die Filterung von Emailadressen in mailto Links und Text.';
+
+// Überschriften und Textausgaben
+$MOD_MAIL_FILTER['HEADING']					= 'Optionen: Ausgabe Filterung';
+$MOD_MAIL_FILTER['HOWTO']						= '&Uuml;ber nachfolgende Optionen kann die Ausgabefilterung konfiguriert werden.<p style="line-height:1.5em;"><strong>Tipp: </strong>Mailto Links k&ouml;nnen mit einer Javascript Routine verschl&uuml;sselt werden. Um diese Option zu aktivieren muss der PHP Befehl <code style="background:#FFA;color:#900;">&lt;?php register_frontend_modfiles(\'js\');?&gt;</code> im &lt;head&gt; Bereich der index.php Ihres Templates eingebunden werden. Ohne diese &Auml;nderungen wird nur das @ Zeichen im mailto: Teil ersetzt.</p>';
+
+// Text von form Elementen
+$MOD_MAIL_FILTER['BASIC_CONF']			= 'Grundeinstellungen';
+$MOD_MAIL_FILTER['EMAIL_FILTER']		= 'Filtere E-Mail Adressen im Text';
+$MOD_MAIL_FILTER['MAILTO_FILTER']		= 'Filtere E-Mail Adressen in mailto Links';
+$MOD_MAIL_FILTER['ENABLED']					= 'Aktiviert';
+$MOD_MAIL_FILTER['DISABLED']				= 'Ausgeschaltet';
+
+$MOD_MAIL_FILTER['REPLACEMENT_CONF']= 'Email Ersetzungen';
+$MOD_MAIL_FILTER['AT_REPLACEMENT']	= 'Ersetzte "@" durch';
+$MOD_MAIL_FILTER['DOT_REPLACEMENT']	= 'Ersetze "." durch';
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/install.php
===================================================================
--- trunk/wb/modules/output_filter/install.php	(nonexistent)
+++ trunk/wb/modules/output_filter/install.php	(revision 673)
@@ -0,0 +1,44 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// prevent this file from being accessed directly
+if(!defined('WB_PATH')) die(header('Location: ../index.php'));
+
+$table = TABLE_PREFIX .'mod_output_filter';
+$database->query("DROP TABLE IF EXISTS `$table`");
+
+$database->query("CREATE TABLE `$table` (
+	`email_filter` VARCHAR(1) NOT NULL DEFAULT '0',
+	`mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0',
+	`at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)',
+	`dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)'
+	)"
+);
+
+// add default values to the module table
+$database->query("INSERT INTO ".TABLE_PREFIX
+	."mod_output_filter (email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0', '0', '(at)', '(dot)')");
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/js/mdcr.js
===================================================================
--- trunk/wb/modules/output_filter/js/mdcr.js	(nonexistent)
+++ trunk/wb/modules/output_filter/js/mdcr.js	(revision 673)
@@ -0,0 +1,26 @@
+
+// $Id$
+
+/*
+--------------------------------------------------------------------------------
+  JAVASCRIPT ROUTINE FOR THE WEBSITE BAKER 2.7 OUTPUT FILTER MODULE
+  Licencsed under GNU, written by Christian Sommer (Doc)
+--------------------------------------------------------------------------------
+*/
+
+function mdcr(s) {
+  location.href=dcstr(s);
+}
+
+function dcstr(s) {
+  var m = unescape(s);
+  var x = m.charCodeAt(7)-97;
+  var c = m.substr(0,7) + m.substr(8);
+  var n=0;
+  var r="";
+
+  for(var i=0; i<c.length; i++) {
+    r+=String.fromCharCode(c.charCodeAt(i) - x);
+  }
+  return r;
+}
\ No newline at end of file
Index: trunk/wb/modules/output_filter/js/index.php
===================================================================
--- trunk/wb/modules/output_filter/js/index.php	(nonexistent)
+++ trunk/wb/modules/output_filter/js/index.php	(revision 673)
@@ -0,0 +1,28 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+header("Location: ../../../index.php");
+
+?>
\ No newline at end of file
Index: trunk/wb/modules/output_filter/index.php
===================================================================
--- trunk/wb/modules/output_filter/index.php	(nonexistent)
+++ trunk/wb/modules/output_filter/index.php	(revision 673)
@@ -0,0 +1,28 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+header('Location: ../index.php');
+
+?>
\ No newline at end of file
