Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1891)
+++ branches/2.8.x/CHANGELOG	(revision 1892)
@@ -13,6 +13,8 @@
 
 
 
+19 Mar-2013 Build 1892 Dietmar Woellbrink (Luisehahne)
+! update output_filter module set version to 0.4.1 
 19 Mar-2013 Build 1891 Dietmar Woellbrink (Luisehahne)
 ! update captcha_control module set version to 1.2.1 
 19 Mar-2013 Build 1890 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1891)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1892)
@@ -965,7 +965,7 @@
 	 * upgrade modules if newer version is available
 	 * $aModuleList list of proofed modules
 	 */
-	$aModuleList = array('wysiwyg','form','code','captcha_control');
+	$aModuleList = array('wysiwyg','form','code','captcha_control','output_filter');
 	if(sizeof($aModuleList)) 
 	{
 		echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1891)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1892)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '1891');
+if(!defined('REVISION')) define('REVISION', '1892');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/output_filter/sql/mod_output_filter.sql
===================================================================
--- branches/2.8.x/wb/modules/output_filter/sql/mod_output_filter.sql	(nonexistent)
+++ branches/2.8.x/wb/modules/output_filter/sql/mod_output_filter.sql	(revision 1892)
@@ -0,0 +1,24 @@
+-- phpMyAdmin SQL Dump
+-- Erstellungszeit: 15. Mrz 2013 um 18:21
+-- Server-Version: 5.5.27
+--
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+-- --------------------------------------------------------
+-- Database structure for WebsiteBaker core
+--
+-- Replacements: {TABLE_PREFIX}, {TABLE_ENGINE}, {TABLE_COLLATION}
+--
+-- --------------------------------------------------------
+--
+-- Tabellenstruktur für Tabelle `{TABLE_PREFIX}mod_output_filter`
+--
+DROP TABLE IF EXISTS `{TABLE_PREFIX}mod_output_filter`;
+CREATE TABLE IF NOT EXISTS `{TABLE_PREFIX}mod_output_filter` (
+  `sys_rel` int(11) NOT NULL DEFAULT '0',
+  `email_filter` int(11) NOT NULL DEFAULT '1',
+  `mailto_filter` int(11) NOT NULL DEFAULT '1',
+  `at_replacement` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '(at)',
+  `dot_replacement` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '(dot)'
+){TABLE_ENGINE};
+-- EndOfFile
\ No newline at end of file
Index: branches/2.8.x/wb/modules/output_filter/sql/data_output_filter.sql
===================================================================
--- branches/2.8.x/wb/modules/output_filter/sql/data_output_filter.sql	(nonexistent)
+++ branches/2.8.x/wb/modules/output_filter/sql/data_output_filter.sql	(revision 1892)
@@ -0,0 +1,18 @@
+-- phpMyAdmin SQL Dump
+-- Erstellungszeit: 15. Mrz 2013 um 18:21
+-- Server-Version: 5.5.27
+--
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+-- --------------------------------------------------------
+-- Database structure for WebsiteBaker core
+--
+-- Replacements: {TABLE_PREFIX}, {TABLE_ENGINE}, {TABLE_COLLATION}
+--
+-- --------------------------------------------------------
+--
+-- Default Daten für Tabelle `mod_output_filter`
+--
+
+INSERT INTO `{TABLE_PREFIX}mod_output_filter` VALUES('0', '1', '1', '{at}', '{dot}');
+-- EndOfFile
\ No newline at end of file
Index: branches/2.8.x/wb/modules/output_filter/info.php
===================================================================
--- branches/2.8.x/wb/modules/output_filter/info.php	(revision 1891)
+++ branches/2.8.x/wb/modules/output_filter/info.php	(revision 1892)
@@ -4,22 +4,22 @@
  * @category        modules
  * @package         output_filter
  * @author          WebsiteBaker Project
- * @copyright       2011, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
+ * @copyright       2012, WebsiteBaker Org. e.V.
+ * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.2
+ * @platform        WebsiteBaker 2.8.4
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
  */
 
-$module_directory = 'output_filter';
-$module_name = 'Frontend Output Filter';
-$module_function = 'tool';
-$module_version	= '0.4';
-$module_platform = '2.8.3';
-$module_author = 'Christian Sommer(doc), WB-Project, Werner v.d. Decken(DarkViper)';
-$module_license = 'GNU General Public License';
+$module_directory   = 'output_filter';
+$module_name        = 'Frontend Output Filter';
+$module_function    = 'tool';
+$module_version     = '0.4.1';
+$module_platform    = '2.8.4';
+$module_author      = 'Christian Sommer(doc), WB-Project, Werner v.d. Decken(DarkViper)';
+$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.';
Index: branches/2.8.x/wb/modules/output_filter/install.php
===================================================================
--- branches/2.8.x/wb/modules/output_filter/install.php	(revision 1891)
+++ branches/2.8.x/wb/modules/output_filter/install.php	(revision 1892)
@@ -4,34 +4,29 @@
  * @category        modules
  * @package         output_filter
  * @author          Christian Sommer, WB-Project, Werner v.d. Decken
- * @copyright       2011-, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
+ * @copyright       20096-2012, WebsiteBaker Org. e.V.
+ * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.2
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
  */
 /* -------------------------------------------------------- */
 // Must include code to stop this file being accessed directly
-require_once( dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
-if(!defined('WB_PATH')) { throw new IllegalFileException(); }
-/* -------------------------------------------------------- */
-
-$table = TABLE_PREFIX .'mod_output_filter';
-$database->query("DROP TABLE IF EXISTS `$table`");
-
-$database->query("CREATE TABLE IF NOT EXISTS `$table` (
-	`sys_rel` INT NOT NULL DEFAULT '0',
-	`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)'
-	) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"
-);
-
-// add default values to the module table
-$database->query("INSERT INTO ".TABLE_PREFIX
-	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0','1', '1', '(at)', '(dot)')");
+if(!defined('WB_PATH')) {
+	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
+	throw new IllegalFileException();
+} else {
+	$sError = array();
+// Create table
+	if(!$database->SqlImport(dirname(__FILE__).'/sql/mod_output_filter.sql','',false)){
+		$sError[] = $database->get_error();
+	}
+// Create table
+	if(!$database->SqlImport(dirname(__FILE__).'/sql/data_output_filter.sql','',false)){
+		$sError[] = $database->get_error();
+	}
+}
Index: branches/2.8.x/wb/modules/output_filter/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/output_filter/upgrade.php	(revision 1891)
+++ branches/2.8.x/wb/modules/output_filter/upgrade.php	(revision 1892)
@@ -4,53 +4,107 @@
  * @category        modules
  * @package         output_filter
  * @author          Christian Sommer, WB-Project, Werner v.d. Decken
- * @copyright       2009-2011, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
+ * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.2
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
  */
 // Must include code to stop this file being access directly
 /* -------------------------------------------------------- */
-if(defined('WB_PATH') == false)
-{
-	// Stop this file being access directly
-		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
+// Must include code to stop this file being accessed directly
+if(!defined('WB_URL')) {
+	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
+	throw new IllegalFileException();
 }
 /* -------------------------------------------------------- */
 
-$msg = '';
-$sTable = TABLE_PREFIX.'mod_output_filter';
-if(($sOldType = $database->getTableEngine($sTable))) {
-	if(('myisam' != strtolower($sOldType))) {
-		if(!$database->query('ALTER TABLE `'.$sTable.'` Engine = \'MyISAM\' ')) {
-			$msg = $database->get_error();
+	function mod_output_filter_upgrade($bDebug=false) {
+		global $OK ,$FAIL;
+		$database=WbDatabase::getInstance();
+		$msg = array();
+		$callingScript = $_SERVER["SCRIPT_NAME"];
+		// check if upgrade startet by upgrade-script to echo a message
+		$tmp = 'upgrade-script.php';
+		$globalStarted = substr_compare($callingScript, $tmp,(0-strlen($tmp)),strlen($tmp)) === 0;
+// check for missing tables, if true stop the upgrade
+		$aTable = array('mod_output_filter');
+		$aPackage = UpgradeHelper::existsAllTables($aTable);
+		if( sizeof($aPackage) > 0){
+			$msg[] =  'TABLE '.implode(' missing! '.$FAIL.'<br />TABLE ',$aPackage).' missing! '.$FAIL;
+			$msg[] = 'Output_filter upgrade failed'." $FAIL";
+			if($globalStarted) {
+				echo '<strong>'.implode('<br />',$msg).'</strong><br />';
+			}
+			return ( ($globalStarted==true ) ? $globalStarted : $msg);
+		} else {
+			for($x=0; $x<sizeof($aTable);$x++) {
+				if(($sOldType = $database->getTableEngine($database->TablePrefix.$aTable[$x]))) {
+					if(('myisam' != strtolower($sOldType))) {
+						if(!$database->query('ALTER TABLE `'.$database->TablePrefix.$aTable[$x].'` Engine = \'MyISAM\' ')) {
+							$msg[] = $database->get_error();
+						} else{
+							$msg[] = 'TABLE `'.$database->TablePrefix.$aTable[$x].'` changed to Engine = \'MyISAM\''." $OK";
+						}
+					} else {
+						$msg[] = 'TABLE `'.$database->TablePrefix.$aTable[$x].'` has Engine = \'MyISAM\''." $OK";
+					}
+				} else {
+					$msg[] = $database->get_error();
+				}
+			}
+			$table_name = $database->TablePrefix.'mod_output_filter';
+			$field_name = 'sys_rel';
+			$description = 'INT(11) NOT NULL DEFAULT \'0\' FIRST';
+			if(!$database->field_exists($table_name,$field_name)) {
+				$database->field_add($table_name, $field_name, $description);
+				$msg[] = 'Add field `sys_rel` FIRST'." $OK";
+			} else {
+				$msg[] = 'Field `sys_rel` already exists'." $OK";
+			}
+// change table structure
+			$sTable = $database->TablePrefix.'mod_output_filter';
+			$sDescription = 'int(11) NOT NULL DEFAULT \'0\'';
+			$sFieldName = 'sys_rel';
+			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Field ( `sys_rel` ) description has been changed successfully'." $OK";
+			}
+			$sDescription = 'int(11) NOT NULL DEFAULT \'1\'';
+			$sFieldName = 'email_filter';
+			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Field ( `email_filter` ) description has been changed successfully'." $OK";
+			}
+			$sFieldName = 'mailto_filter';
+			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Field ( `mailto_filter` ) description has been changed successfully'." $OK";
+			}
+// only for upgrade-script
+			if($globalStarted) {
+				if($bDebug) {
+					echo '<strong>'.implode('<br />',$msg).'</strong><br />';
+				}
+			}
 		}
+		$msg[] = 'Output_filter upgrade successfull finished '." $OK";
+		if($globalStarted) {
+			echo "<strong>Output_filter upgrade successfull finished $OK</strong><br />";
+		}
+		return ( ($globalStarted==true ) ? $globalStarted : $msg);
 	}
-} else {
-	$msg = $database->get_error();
+// ------------------------------------
+
+$bDebugModus = ((isset($bDebugModus)) ? $bDebugModus : false);
+// Don't show the messages twice
+if( is_array($msg = mod_output_filter_upgrade($bDebugModus)) ) {
+	echo '<strong>'.implode('<br />',$msg).'</strong><br />';
 }
-// ------------------------------------global $i;
-$table_name = TABLE_PREFIX .'mod_output_filter';
-$field_name = 'sys_rel';
-$i = (!isset($i) ? 1 : $i);
-print "<div style=\"margin:1em auto;font-size:1.1em;\">";
-print "<h4>Step $i: Updating Output Filter</h4>\n";
-$i++;
-$OK   = "<span class=\"ok\">OK</span>";
-$FAIL = "<span class=\"error\">FAILED</span>";
-if ( ($database->field_exists($table_name,$field_name) )) {
-		print "<br /><strong>'Output Filter already updated'</strong> $OK<br />\n";
-} else {
-	$description = 'INT NOT NULL DEFAULT \'0\' FIRST';
-	if( ($database->field_add($table_name,$field_name,$description )) ) {
-		print "<br /><strong>Updating Output Filter</strong> $OK<br />\n";
-	} else {
-			print "<br /><strong>Updating Output Filter</strong> $FAIL<br />\n";
-	}
-}
-print "</div>";
