Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1889)
+++ branches/2.8.x/CHANGELOG	(revision 1890)
@@ -13,6 +13,10 @@
 
 
 
+19 Mar-2013 Build 1890 Dietmar Woellbrink (Luisehahne)
+# bugfix and update form module set version to 2.9.1 
+! update code module set version to 2.8.4 
+! update wysiwyg module set version to 2.9.1 
 19 Mar-2013 Build 1889 Dietmar Woellbrink (Luisehahne)
 # bugfix solved sections block update
 ! update sections table change some varchar to int(11)
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1889)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1890)
@@ -691,31 +691,17 @@
     if($bDebugModus) {
         echo implode(PHP_EOL,$aDebugMessage);
     }
+    echo '</div>';
+}
 
-	$aDebugMessage = array();
-	/**********************************************************
-     *   `confirm_code` VARCHAR(32) NOT NULL DEFAULT '',
-     *   `confirm_timeout` INT(11) NOT NULL DEFAULT '0',
-     */
-	echo "<h4>Change field structure on table users</h4>";
-	$table_name = TABLE_PREFIX.'users';
-	$field_name = 'confirm_code';
-	$description = "VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `password` ";
-    add_modify_field_in_database($table_name,$field_name,$description);
-
-	$table_name = TABLE_PREFIX.'users';
-	$field_name = 'confirm_timeout';
-	$description = "INT(11) NOT NULL DEFAULT '0' AFTER `confirm_code` ";
-    add_modify_field_in_database($table_name,$field_name,$description);
-
-    if($bDebugModus) {
-        echo implode(PHP_EOL,$aDebugMessage);
-    }
-
+if(version_compare(WB_REVISION, REVISION, '<='))
+{
     $aDebugMessage = array();
+    echo '<h3>Step '.(++$stepID).': Updating structure in table users/groups</h3>';
 	/**********************************************************
-     * Modify Administrator on groups table
-     */
+	 * Modify Administrator on groups table
+	 */
+	echo '<div style="margin-left:2em;">';
 	echo "<h4>Update group Administrator on table groups</h4>";
 	$aDebugMessage[] = "<span>Modify Administrator on groups table</span>";
 	$sModulePermissions = '';
@@ -741,16 +727,35 @@
     }
     echo '</div>';
 
-}
+    /**********************************************************
+	$aDebugMessage = array();
+	/**********************************************************
+ *   `confirm_code` VARCHAR(32) NOT NULL DEFAULT '',
+ *   `confirm_timeout` INT(11) NOT NULL DEFAULT '0',
+ */
+	echo '<div style="margin-left:2em;">';
+	echo "<h4>Change field structure on table users</h4>";
+	$table_name = TABLE_PREFIX.'users';
+	$field_name = 'confirm_code';
+	$description = "VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `password` ";
+    add_modify_field_in_database($table_name,$field_name,$description);
 
-if(version_compare(WB_REVISION, REVISION, '<'))
-{
+	$table_name = TABLE_PREFIX.'users';
+	$field_name = 'confirm_timeout';
+	$description = "INT(11) NOT NULL DEFAULT '0' AFTER `confirm_code` ";
+    add_modify_field_in_database($table_name,$field_name,$description);
+
+    if($bDebugModus) {
+        echo implode(PHP_EOL,$aDebugMessage);
+    }
+    echo '</div>';
     $aDebugMessage = array();
-    echo '<h3>Step '.(++$stepID).': Updating group_id in table users</h3>';
-    /**********************************************************
+
+   /**********************************************************
     * Updating group_id in table users
     */
-        echo '<div style="margin-left:2em;">';
+	echo '<div style="margin-left:2em;">';
+	echo "<h4>Change field structure on table users</h4>";
         $aUsers = array();
 		// Get existing values
         $sql  = 'SELECT * FROM `'.TABLE_PREFIX.'users` ' ;
@@ -784,7 +789,6 @@
                 $aDebugMessage[] = $database->is_error()==false ? $sMessage." $OK<br />" : $sMessage." $FAIL!<br />";
         }
         unset($aUsers);
-
     $aDebugMessage[] = '</div>';
 
     if($bDebugModus) {
@@ -966,10 +970,10 @@
 	 * $aModuleList list of proofed modules
 	 */
 //	$aModuleList = array('wysiwyg','news','form','captcha_control','output_filter');
-	$aModuleList = array('wysiwyg','form');
+	$aModuleList = array('wysiwyg','form','code');
 	if(sizeof($aModuleList)) 
 	{
-	    echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
+		echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
 		foreach($aModuleList as $sModul) {
 			if(file_exists(WB_PATH.'/modules/'.$sModul.'/upgrade.php')) {
 				$currModulVersion = get_modul_version ($sModul, false);
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1889)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1890)
@@ -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', '1889');
+if(!defined('REVISION')) define('REVISION', '1890');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/wysiwyg/info.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/info.php	(revision 1889)
+++ branches/2.8.x/wb/modules/wysiwyg/info.php	(revision 1890)
@@ -4,13 +4,13 @@
  * @category        modules
  * @package         wysiwyg
  * @author          WebsiteBaker Project
- * @copyright       2009-2012, 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.3
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
  */
@@ -24,8 +24,8 @@
 $module_directory = 'wysiwyg';
 $module_name = 'WYSIWYG';
 $module_function = 'page';
-$module_version = '2.9.0';
-$module_platform = '2.8.2';
+$module_version = '2.9.1';
+$module_platform = '2.8.4';
 $module_author = 'Ryan Djurovich';
 $module_license = 'GNU General Public License';
 $module_description = 'This module allows you to edit the contents of a page using a graphical editor';

Property changes on: branches/2.8.x/wb/modules/wysiwyg/info.php
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/modules/wysiwyg/install.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/install.php	(revision 1889)
+++ branches/2.8.x/wb/modules/wysiwyg/install.php	(revision 1890)
@@ -22,7 +22,7 @@
 } else {
 	// Create table
 
-$database->SqlImport(dirname(__FILE__).'/sql/mod_wysiwyg.sql',TABLE_PREFIX,false);
+$database->SqlImport(dirname(__FILE__).'/sql/mod_wysiwyg.sql','',false);
 
 // remove old version of search (deprecated)
 
Index: branches/2.8.x/wb/modules/wysiwyg/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/upgrade.php	(revision 1889)
+++ branches/2.8.x/wb/modules/wysiwyg/upgrade.php	(revision 1890)
@@ -5,12 +5,12 @@
  * @package         wysiwyg
  * @author          WebsiteBaker Project
  * @copyright       2009-2012, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
+ * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.3
  * @requirements    PHP 5.2.2 and higher
- * @version      	$Id$
- * @filesource		$HeadURL$
+ * @version         $Id$
+ * @filesource      $HeadURL$
  * @lastmodified    $Date$
  *
  */
@@ -22,67 +22,92 @@
 }
 /* -------------------------------------------------------- */
 
-if(!function_exists('mod_wysiwyg_upgrade'))
-{
-	function mod_wysiwyg_upgrade () {
-		global $database,$bDebugModus;
+	function mod_wysiwyg_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;
-
-		$msg = array();
+// check for missing tables, if true stop the upgrade
 		$aTable = array('mod_wysiwyg');
-		for($x=0; $x<sizeof($aTable);$x++) {
-			if(($sOldType = $database->getTableEngine(TABLE_PREFIX.$aTable[$x]))) {
-				if(('myisam' != strtolower($sOldType))) {
-					if(!$database->query('ALTER TABLE `'.TABLE_PREFIX.$aTable[$x].'` Engine = \'MyISAM\' ')) {
-						$msg[] = $database->get_error();
-					} else{
-						$msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` changed to Engine = \'MyISAM\'';
+		$aPackage = UpgradeHelper::existsAllTables($aTable);
+		if( sizeof($aPackage) > 0){
+			$msg[] =  'TABLE '.implode(' missing! '.$FAIL.'<br />TABLE ',$aPackage).' missing! '.$FAIL;
+			$msg[] = 'WYSIWYG 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[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
+					$msg[] = $database->get_error();
 				}
+			}
+// add change or missing index
+			$sTable = $database->TablePrefix.'mod_wysiwyg';
+			if($database->index_exists($sTable, 'PRIMARY')) {
+				$sql = 'ALTER TABLE `'.$database->DbName.'`.`'.$sTable.'` DROP PRIMARY KEY';
+				if(!$database->query($sql)) {
+					$msg[] = ''.$database->get_error();
+				}
+			}
+			if(!$database->index_add($sTable, '', 'section_id', 'PRIMARY')) {
+				$msg[] = ''.$database->get_error();
 			} else {
-				$msg[] = $database->get_error();
+				$msg[] = 'Create PRIMARY KEY ( `section_id` )'." $OK";
 			}
-		}
-
-		$sTable = TABLE_PREFIX.'mod_wysiwyg';
-		if($database->index_exists($sTable, 'PRIMARY')) {
-			$sql = 'ALTER TABLE `'.$database->DbName.'`.`'.$sTable.'` DROP PRIMARY KEY';
-			if(!$database->query($sql)) {
-			    $msg[] = ''.$database->get_error().'';
+// change table structure
+			$sTable = $database->TablePrefix.'mod_wysiwyg';
+			$sDescription = 'LONGTEXT NOT NULL';
+			$sFieldName = 'text';
+			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Field ( `text` ) description has been changed successfully'." $OK";
 			}
-		}
-
-		if(!$database->index_add($sTable, '', 'section_id', 'PRIMARY')) {
-			$msg[] = ''.$database->get_error().'';
-		} else {
-		    $msg[] = 'Create PRIMARY KEY ( `section_id` )';
-		}
-
-		// change internal absolute links into relative links
-		$sTable = TABLE_PREFIX.'mod_wysiwyg';
-		$sql  = 'UPDATE `'.$sTable.'` ';
-		$sql .= 'SET `content` = REPLACE(`content`, \'"'.WB_URL.MEDIA_DIRECTORY.'\', \'"{SYSVAR:MEDIA_REL}\')';
-		if (!$database->query($sql)) {
-			$msg[] = ''.$database->get_error().'';
-		} else {
-		    $msg[] = 'Change internal absolute links into relative links';
-		}
-		// only for $callingScript upgrade-script.php
-		if($globalStarted) {
-			if($bDebugModus) {
-				foreach($msg as $title) {
-				    echo '<strong>'.$title.'</strong><br />';
+			$sFieldName = 'content';
+			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Field ( `content` ) description has been changed successfully'." $OK";
+			}
+// change internal absolute links into relative links
+			$sTable = $database->TablePrefix.'mod_wysiwyg';
+			$sql  = 'UPDATE `'.$sTable.'` ';
+			$sql .= 'SET `content` = REPLACE(`content`, \'"'.WB_URL.MEDIA_DIRECTORY.'\', \'"{SYSVAR:MEDIA_REL}\')';
+			if (!$database->query($sql)) {
+				$msg[] = ''.$database->get_error();
+			} else {
+				$msg[] = 'Change internal absolute links into relative links'." $OK";
+			}
+// only for $callingScript upgrade-script.php
+			if($globalStarted) {
+				if($bDebug) {
+					echo '<strong>'.implode('<br />',$msg).'</strong><br />';
 				}
 			}
 		}
-		return $msg;
+		$msg[] = 'WYSIWYG upgrade successfull finished'." $OK";
+		if($globalStarted) {
+			echo "<strong>WYSIWYG upgrade successfull finished $OK</strong><br />";
+		}
+		return ( ($globalStarted==true ) ? $globalStarted : $msg);
 	}
+// ------------------------------------
+$bDebugModus = ((isset($bDebugModus)) ? $bDebugModus : false);
+if( is_array($msg = mod_wysiwyg_upgrade($bDebugModus)) ) {
+	echo '<strong>'.implode('<br />',$msg).'</strong><br />';
 }
-// ------------------------------------
-
-$msg = mod_wysiwyg_upgrade();

Property changes on: branches/2.8.x/wb/modules/wysiwyg/upgrade.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: svn:keywords
## -1 +1,4 ##
-Date Author Id Revision HeadURL
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/modules/form/info.php
===================================================================
--- branches/2.8.x/wb/modules/form/info.php	(revision 1889)
+++ branches/2.8.x/wb/modules/form/info.php	(revision 1890)
@@ -24,7 +24,7 @@
 $module_directory = 'form';
 $module_name = 'Form';
 $module_function = 'page';
-$module_version = '2.9.1';
+$module_version = '2.9.2';
 $module_platform = '2.8.4';
 $module_author = 'Ryan Djurovich & Rudolph Lartey - additions John Maats - PCWacht, dev-team';
 $module_license = 'GNU General Public License';

Property changes on: branches/2.8.x/wb/modules/form/info.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/modules/form/install.php
===================================================================
--- branches/2.8.x/wb/modules/form/install.php	(revision 1889)
+++ branches/2.8.x/wb/modules/form/install.php	(revision 1890)
@@ -21,5 +21,9 @@
 	throw new IllegalFileException();
 } else {
 // Create tables
-$database->SqlImport(dirname(__FILE__).'/sql/form284db.sql',TABLE_PREFIX,false);
+	$sError = array();
+	// Create table
+	if(!$database->SqlImport(dirname(__FILE__).'/sql/form284db.sql','',false)){
+		$sError[] = $database->get_error();
+	}
 }
Index: branches/2.8.x/wb/modules/form/sql/form284db.sql
===================================================================
--- branches/2.8.x/wb/modules/form/sql/form284db.sql	(revision 1889)
+++ branches/2.8.x/wb/modules/form/sql/form284db.sql	(revision 1890)
@@ -37,7 +37,7 @@
   `footer` text{TABLE_COLLATION} NOT NULL,
   `email_to` text{TABLE_COLLATION} NOT NULL,
   `email_from` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '',
-  `email_fromname` varchar(255{TABLE_COLLATION}) NOT NULL DEFAULT '',
+  `email_fromname` varchar(255){TABLE_COLLATION}) NOT NULL DEFAULT '',
   `email_subject` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '',
   `success_page` text{TABLE_COLLATION} NOT NULL,
   `success_email_to` text{TABLE_COLLATION} NOT NULL,
Index: branches/2.8.x/wb/modules/form/view.php
===================================================================
--- branches/2.8.x/wb/modules/form/view.php	(revision 1889)
+++ branches/2.8.x/wb/modules/form/view.php	(revision 1890)
@@ -151,7 +151,7 @@
 	}
 
 // do not use sec_anchor, can destroy some layouts
-$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$fetch_settings['section_id'] : 'section_'.$section_id );
+//$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$fetch_settings['section_id'] : 'section_'.$section_id );
 
 	// Get list of fields
 	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_fields` ';

Property changes on: branches/2.8.x/wb/modules/form/view.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/modules/form/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/form/upgrade.php	(revision 1889)
+++ branches/2.8.x/wb/modules/form/upgrade.php	(revision 1890)
@@ -1,75 +1,109 @@
 <?php
 /**
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * @category        module
- * @package         Form
- * @author          WebsiteBaker Project
- * @copyright       2009-2012, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
- * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.x
- * @requirements    PHP 5.2.2 and higher
- * @version         $Id$
- * @filesource		$HeadURL$
- * @lastmodified    $Date$
- * @description
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+/**
+ * upgrade.php
+ * 
+ * @category     Module
+ * @package      Module_form
+ * @subpackage   upgrade
+ * @author       Dietmar Wöllbrink <dietmar.woellbrink@websitebaker.org>
+ * @author       Werner v.d.Decken <wkl@isteam.de>
+ * @copyright    Werner v.d.Decken <wkl@isteam.de>
+ * @license      http://www.gnu.org/licenses/gpl.html   GPL License
+ * @version      0.0.1
+ * @revision     $Revision$
+ * @link         $HeadURL$
+ * @lastmodified $Date$
+ * @since        File available since 17.01.2013
+ * @description  xyz
+ * 
+ */
+
 /* -------------------------------------------------------- */
 // Must include code to stop this file being accessed directly
-if(!defined('WB_PATH')) {
+if(!defined('WB_URL')) {
 	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
 	throw new IllegalFileException();
 }
 /* -------------------------------------------------------- */
 
-if(!function_exists('mod_form_upgrade'))
-{
-    function mod_form_upgrade() {
-        $msg = array();
-        global $database,$bDebugModus;
-        $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;
-        $aTable = array('mod_form_fields','mod_form_settings','mod_form_submissions');
-        for($x=0; $x<sizeof($aTable);$x++) {
-        	if(($sOldType = $database->getTableEngine(TABLE_PREFIX.$aTable[$x]))) {
-        		if(('myisam' != strtolower($sOldType))) {
-        			if(!$database->query('ALTER TABLE `'.TABLE_PREFIX.$aTable[$x].'` Engine = \'MyISAM\' ')) {
-        				$msg[] = $database->get_error();
-        			} else{
-                        $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` changed to Engine = \'MyISAM\'';
-        			}
-        		} else {
-                 $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
-        		}
-        	} else {
-        		$msg[] = $database->get_error();
-        	}
-        }
+//if(!function_exists('mod_form_upgrade')){
+	function mod_form_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_form_fields','mod_form_settings','mod_form_submissions');
+		$aPackage = UpgradeHelper::existsAllTables($aTable);
+		if( sizeof($aPackage) > 0){
+			$msg[] =  'TABLE '.implode(' missing! '.$FAIL.'<br />TABLE ',$aPackage).' missing! '.$FAIL;
+			$msg[] = 'Form 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_form_settings';
+			$field_name = 'perpage_submissions';
+			$description = "INT NOT NULL DEFAULT '10' AFTER `max_submissions`";
+			if(!$database->field_exists($table_name,$field_name)) {
+				$database->field_add($table_name, $field_name, $description);
+				$msg[] = 'Add field `perpage_submissions` AFTER `max_submissions`';
+			} else {
+				$msg[] = 'Field `perpage_submissions` already exists'." $OK";
+			}
+// only for upgrade-script
+			if($globalStarted) {
+				if($bDebug) {
+					echo '<strong>'.implode('<br />',$msg).'</strong><br />';
+				}
+			}
+		}
+		$msg[] = 'Form upgrade successfull finished ';
+		if($globalStarted) {
+			echo "<strong>Form upgrade successfull finished $OK</strong><br />";
+		}
+		return ( ($globalStarted==true ) ? $globalStarted : $msg);
+	}
+//}
+// ------------------------------------
 
-        $table_name = TABLE_PREFIX.'mod_form_settings';
-        $field_name = 'perpage_submissions';
-        $description = "INT NOT NULL DEFAULT '10' AFTER `max_submissions`";
-        if(!$database->field_exists($table_name,$field_name)) {
-        	$database->field_add($table_name, $field_name, $description);
-            $msg[] = 'Add field `perpage_submissions` AFTER `max_submissions`';
-        } else {
-            $msg[] = 'Field `perpage_submissions` already exists';
-        }
-
-        // only for upgrade-script
-        if($globalStarted) {
-            if($bDebugModus) {
-                foreach($msg as $title) {
-                    echo '<strong>'.$title.'</strong><br />';
-                }
-            }
-        }
-        return $msg;
-    }
+$bDebugModus = ((isset($bDebugModus)) ? $bDebugModus : false);
+if( is_array($msg = mod_form_upgrade($bDebugModus))) {
+	echo '<strong>'.implode('<br />',$msg).'</strong><br />';
 }
-// ------------------------------------
-
-$msg = mod_form_upgrade();

Property changes on: branches/2.8.x/wb/modules/form/upgrade.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: svn:keywords
## -1 +1,4 ##
-Date Author Id Revision HeadURL
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/modules/code/sql/mod_code.sql
===================================================================
--- branches/2.8.x/wb/modules/code/sql/mod_code.sql	(nonexistent)
+++ branches/2.8.x/wb/modules/code/sql/mod_code.sql	(revision 1890)
@@ -0,0 +1,23 @@
+-- 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_code`
+--
+DROP TABLE IF EXISTS `{TABLE_PREFIX}mod_code`;
+CREATE TABLE IF NOT EXISTS `{TABLE_PREFIX}mod_code` (
+  `section_id` int(11) NOT NULL DEFAULT '0',
+  `page_id` int(11) NOT NULL DEFAULT '0',
+  `content` text{TABLE_COLLATION} NOT NULL DEFAULT '',
+  PRIMARY KEY (`section_id`)
+){TABLE_ENGINE};
+-- EndOfFile
\ No newline at end of file
Index: branches/2.8.x/wb/modules/code/info.php
===================================================================
--- branches/2.8.x/wb/modules/code/info.php	(revision 1889)
+++ branches/2.8.x/wb/modules/code/info.php	(revision 1890)
@@ -4,7 +4,7 @@
  * @category        modules
  * @package         code
  * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -24,12 +24,11 @@
 }
 /* -------------------------------------------------------- */
 
-$module_directory	= 'code';
-$module_name		= 'Code';
-$module_function	= 'page';
-$module_version		= '2.8.3';
-$module_platform	= '2.7 | 2.8.x';
-$module_author		= 'Ryan Djurovich';
-$module_license		= 'GNU General Public License';
-$module_description	= 'This module allows you to execute PHP commands (limit access to users you trust!!)';
-
+$module_directory   = 'code';
+$module_name        = 'Code';
+$module_function    = 'page';
+$module_version     = '2.8.4';
+$module_platform    = '2.8.4';
+$module_author      = 'Ryan Djurovich';
+$module_license     = 'GNU General Public License';
+$module_description = 'This module allows you to execute PHP commands (limit access to users you trust!!)';
Index: branches/2.8.x/wb/modules/code/save.php
===================================================================
--- branches/2.8.x/wb/modules/code/save.php	(revision 1889)
+++ branches/2.8.x/wb/modules/code/save.php	(revision 1890)
@@ -4,7 +4,7 @@
  * @category        modules
  * @package         code
  * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -32,10 +32,14 @@
 $admin->print_header();
 // Update the mod_wysiwygs table with the contents
 if(isset($_POST['content'])) {
+
+
 	$tags = array('<?php', '?>' , '<?', '<?=');
 	$content = $admin->add_slashes(str_replace($tags, '', $_POST['content']));
+
 	$query = "UPDATE ".TABLE_PREFIX."mod_code SET content = '$content' WHERE section_id = '$section_id'";
 	$database->query($query);	
+
 }
 
 // Check if there is a database error, otherwise say successful
@@ -42,7 +46,7 @@
 if($database->is_error()) {
 	$admin->print_error($database->get_error(), $js_back);
 } else {
-	$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+	$admin->print_success($MESSAGE['PAGES_SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
 }
 
 // Print admin footer
Index: branches/2.8.x/wb/modules/code/search.php
===================================================================
--- branches/2.8.x/wb/modules/code/search.php	(nonexistent)
+++ branches/2.8.x/wb/modules/code/search.php	(revision 1890)
@@ -0,0 +1,67 @@
+<?php
+/**
+ *
+ * @category        frontend
+ * @package         search
+ * @author          WebsiteBaker Project
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
+ * @link			http://www.websitebaker2.org/
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @platform        WebsiteBaker 2.8.3
+ * @requirements    PHP 5.2.2 and higher
+ * @version         $Id: search.php 1652 2012-03-27 10:35:26Z Luisehahne $
+ * @filesource		$HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/admin/users/save.php $
+ * @lastmodified    $Date: 2011-01-10 13:21:47 +0100 (Mo, 10. Jan 2011) $
+ *
+ */
+/* -------------------------------------------------------- */
+// Must include code to stop this file being accessed directly
+if(!defined('WB_PATH')) {
+	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
+	throw new IllegalFileException();
+}
+/* -------------------------------------------------------- */
+
+function code_search($func_vars) {
+	extract($func_vars, EXTR_PREFIX_ALL, 'func');
+	static $search_sql = FALSE;
+	if(function_exists('search_make_sql_part')) {
+		if($search_sql===FALSE)
+			$search_sql = search_make_sql_part($func_search_url_array, $func_search_match, array('`content`'));
+	} else {
+		$search_sql = '1=1';
+	}
+	
+	// how many lines of excerpt we want to have at most
+	$max_excerpt_num = $func_default_max_excerpt;
+	$divider = ".";
+	$result = false;
+	
+	// we have to get 'content' instead of 'text', because strip_tags() dosen't remove scripting well.
+	// scripting will be removed later on automatically
+	$table = TABLE_PREFIX."mod_code";
+	$query = $func_database->query("
+		SELECT content
+		FROM $table
+		WHERE section_id='$func_section_id'
+	");
+
+	if($query->numRows() > 0) {
+		if($res = $query->fetchRow()) {
+			$mod_vars = array(
+				'page_link' => $func_page_link,
+				'page_link_target' => "#wb_section_$func_section_id",
+				'page_title' => $func_page_title,
+				'page_description' => $func_page_description,
+				'page_modified_when' => $func_page_modified_when,
+				'page_modified_by' => $func_page_modified_by,
+				'text' => $res['content'].$divider,
+				'max_excerpt_num' => $max_excerpt_num
+			);
+			if(print_excerpt2($mod_vars, $func_vars)) {
+				$result = true;
+			}
+		}
+	}
+	return $result;
+}
Index: branches/2.8.x/wb/modules/code/install.php
===================================================================
--- branches/2.8.x/wb/modules/code/install.php	(revision 1889)
+++ branches/2.8.x/wb/modules/code/install.php	(revision 1890)
@@ -4,65 +4,27 @@
  * @category        modules
  * @package         code
  * @author          WebsiteBaker Project
- * @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.x
  * @requirements    PHP 5.2.2 and higher
- * @version      	$Id: install.php 1374 2011-01-10 12:21:47Z Luisehahne $
- * @filesource		$HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/modules/code/install.php $
+ * @version         $Id: install.php 1374 2011-01-10 12:21:47Z Luisehahne $
+ * @filesource      $HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/modules/code/install.php $
  * @lastmodified    $Date: 2011-01-10 13:21:47 +0100 (Mo, 10. Jan 2011) $
  *
  */
 
 /* -------------------------------------------------------- */
-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>');
-}
-/* -------------------------------------------------------- */
-
-if(defined('WB_URL'))
-{
-
+// Must include code to stop this file being accessed directly
+if(!defined('WB_PATH')) {
+	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
+	throw new IllegalFileException();
+} else {
+	$database = WbDatabase::getInstance();
+	$sError = '';
 	// Create table
-	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_code`");
-	$mod_code = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_code` ('
-		. ' `section_id` INT NOT NULL DEFAULT \'0\','
-		. ' `page_id` INT NOT NULL DEFAULT \'0\','
-		. ' `content` TEXT NOT NULL,'
-		. ' PRIMARY KEY ( `section_id` )'
-		. ' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci';
-	$database->query($mod_code);
-
-    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search  WHERE value = 'code'";
-    $insert_search = $database->query($mod_search);
-    if( $insert_search->numRows() == 0 )
-    {
-    	// Insert info into the search table
-    	// Module query info
-    	$field_info = array();
-    	$field_info['page_id'] = 'page_id';
-    	$field_info['title'] = 'page_title';
-    	$field_info['link'] = 'link';
-    	$field_info['description'] = 'description';
-    	$field_info['modified_when'] = 'modified_when';
-    	$field_info['modified_by'] = 'modified_by';
-    	$field_info = serialize($field_info);
-    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'code', '$field_info')");
-    	// Query start
-    	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_code, [TP]pages WHERE ";
-    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'code')");
-    	// Query body
-    	$query_body_code = " [TP]pages.page_id = [TP]mod_code.page_id AND [TP]mod_code.content [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";
-    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'code')");
-    	// Query end
-    	$query_end_code = "";
-    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'code')");
-
-    	// Insert blank row (there needs to be at least on row for the search to work)
-    	$database->query("INSERT INTO ".TABLE_PREFIX."mod_code (page_id,section_id) VALUES ('0','0')");
-
-    }
+	if(!$database->SqlImport(dirname(__FILE__).'/sql/mod_code.sql','',false)){
+		$sError = $database->get_error();
+	}
 }
Index: branches/2.8.x/wb/modules/code/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/code/upgrade.php	(revision 1889)
+++ branches/2.8.x/wb/modules/code/upgrade.php	(revision 1890)
@@ -4,7 +4,7 @@
  * @category        modules
  * @package         code
  * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -16,22 +16,64 @@
  */
 // 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_code';
-if(($sOldType = $database->getTableEngine($sTable))) {
-	if(('myisam' != strtolower($sOldType))) {
-		if(!$database->query('ALTER TABLE `'.$sTable.'` Engine = \'MyISAM\' ')) {
-			$msg = $database->get_error();
+	function mod_code_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_code');
+		$aPackage = UpgradeHelper::existsAllTables($aTable);
+		if( sizeof($aPackage) > 0){
+			$msg[] =  'TABLE '.implode(' missing! '.$FAIL.'<br />TABLE ',$aPackage).' missing! '.$FAIL;
+			$msg[] = 'Code 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();
+				}
+			}
+// only for upgrade-script
+			if($globalStarted) {
+				if($bDebug) {
+					echo '<strong>'.implode('<br />',$msg).'</strong><br />';
+				}
+			}
 		}
+		$msg[] = 'Code upgrade successfull finished '." $OK";
+		if($globalStarted) {
+			echo "<strong>Code 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_code_upgrade($bDebugModus)) ) {
+	echo '<strong>'.implode('<br />',$msg).'</strong><br />';
 }
-// ------------------------------------
\ No newline at end of file
Index: branches/2.8.x/wb/modules/code/add.php
===================================================================
--- branches/2.8.x/wb/modules/code/add.php	(revision 1889)
+++ branches/2.8.x/wb/modules/code/add.php	(revision 1890)
@@ -15,13 +15,12 @@
  *
  */
 
-// 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_PATH')) {
+	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
+	throw new IllegalFileException();
+} else {
 // Insert an extra row into the database
 $database->query("INSERT INTO ".TABLE_PREFIX."mod_code (page_id,section_id) VALUES ('$page_id','$section_id')");
+}
