Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1874)
+++ branches/2.8.x/CHANGELOG	(revision 1875)
@@ -11,6 +11,10 @@
 ! = Update/Change
 ===============================================================================
 
+28 Feb-2013 Build 1875 Dietmar Woellbrink (Luisehahne)
+! wysgwyg, now check exitings table entries, otherwise script stop loading content in editor
+! typofix in groups
+! change constant DB_NAME to $database->DbName
 27 Feb-2013 Build 1874 Werner v.d.Decken(DarkViper)
 # some little typo fixes in initialize.php
 # readConfiguration() fixed in initialize.php
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1874)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1875)
@@ -19,10 +19,10 @@
 /**
  * 
  * 
- * @category     Module
- * @package      Module_bakery
- * @subpackage   Name of the subpackage if needed
- * @author       Dietmar Wöllbrink <dietmar.woellbrink@websitebaker.org>
+ * @category     Core
+ * @package      Core_package
+ * @subpackage   upgrade-script
+ * @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
@@ -234,21 +234,21 @@
 	$get_result = $database->query( 'SHOW TABLES LIKE "'.$search_for.'%"');
 
 	// $get_result = $database->query( "SHOW TABLES FROM ".DB_NAME);
-    $all_tables = array();
-    $aTable = array();
-    if($get_result->numRows() > 0)
-    {
-        while ($data = $get_result->fetchRow()) {
-            $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
-            if(in_array($tmp,$aPackage)) {
-                $all_tables[] = $tmp;
-            } else {
-                $aTable[] = $tmp;
-            }
-        }
-    }
+	$all_tables = array();
+	$aTable = array();
+	if($get_result->numRows() > 0)
+	{
+		while ($data = $get_result->fetchRow()) {
+		    $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
+		    if(in_array($tmp,$aPackage)) {
+		        $all_tables[] = $tmp;
+		    } else {
+		        $aTable[] = $tmp;
+		    }
+		}
+	}
 
-    return array_merge ( $all_tables, $aTable );
+	return array_merge ( $all_tables, $aTable );
 }
 
 // check existing tables
@@ -415,7 +415,7 @@
 
     if( (sizeof($all_tables) >= sizeof($aPackage)) && (sizeof($aTable) == sizeof($aPackage)) )
     {
-        echo '<h4 style="margin-left:0;">NOTICE: Your database '.DB_NAME.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
+        echo '<h4 style="margin-left:0;">NOTICE: Your database '.$database->DbName.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
     }
     else
     {
Index: branches/2.8.x/wb/admin/groups/languages/EN.php
===================================================================
--- branches/2.8.x/wb/admin/groups/languages/EN.php	(revision 1874)
+++ branches/2.8.x/wb/admin/groups/languages/EN.php	(revision 1875)
@@ -46,7 +46,7 @@
 $TEXT['CREATE_FOLDER'] = 'Create Folder';
 $TEXT['DELETE'] = 'Delete';
 $TEXT['DELETED'] = 'Deleted';
-$TEXT['FILESYSTEM_PERMISSIONS'] = 'Filesystem Permissions';
+$TEXT['FILESYSTEM_PERMISSIONS'] = 'Permissions';
 $TEXT['GROUP'] = 'Group';
 $TEXT['HIDE_ADVANCED'] = 'Hide Advanced Options';
 $TEXT['LANGUAGE'] = 'Language';
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1874)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1875)
@@ -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', '1874');
+if(!defined('REVISION')) define('REVISION', '1875');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/templates/wb_theme/css/screen.css
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/css/screen.css	(revision 1874)
+++ branches/2.8.x/wb/templates/wb_theme/css/screen.css	(revision 1875)
@@ -272,7 +272,7 @@
 div.page-settings-right div.content { border :solid 1px #a8bccb; min-width :10em; }
 div.page-settings-right div.page-settings-tab { border :solid 1px #a8bccb; padding :8px; margin-bottom :8px; }
 div.page-settings-rightcol { float :none; padding :0px; border :none; }
-h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.5em auto; padding-bottom :5px; }
+h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.4em auto; padding-bottom :5px; }
 h6 { font-size :100%; }
 /* end depending styles for /admin/pages_settings */
 div.page-settings-leftcol label { background-repeat :no-repeat; background-position :right; text-align :right; padding-right :17px; font-weight :bold; width :156px; }
Index: branches/2.8.x/wb/templates/argos_theme/css/screen.css
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/css/screen.css	(revision 1874)
+++ branches/2.8.x/wb/templates/argos_theme/css/screen.css	(revision 1875)
@@ -298,7 +298,7 @@
 div.page-settings-centercol div#viewers { border :solid 1px #a8bccb; width :210px; padding :5px; }
 div.page-settings-right div.page-settings-tab { border :solid 1px #a8bccb; padding :8px; margin-bottom :8px; }
 div.page-settings-rightcol { float :none; padding :0px; border :none; }
-h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.5em auto; padding-bottom :5px; }
+h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.4em auto; padding-bottom :5px; }
 h6 { font-size :105%; }
 /* end depending styles for /admin/pages_settings */
 div.page-settings-leftcol label { background-repeat :no-repeat; background-position :right; text-align :right; padding-right :17px; font-weight :bold; width :156px; }
Index: branches/2.8.x/wb/modules/wysiwyg/save.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1874)
+++ branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1875)
@@ -37,21 +37,21 @@
 $sMediaUrl = WB_URL.MEDIA_DIRECTORY;
 // Update the mod_wysiwygs table with the contents
 if(isset($_POST['content'.$section_id])) {
-    $content = $_POST['content'.$section_id];
+	$content = $_POST['content'.$section_id];
 	if(ini_get('magic_quotes_gpc')==true)
 	{
 		$content = $admin->strip_slashes($_POST['content'.$section_id]);
-	}
+	};
 	$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU';
-    $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
+	$content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
 	// searching in $text will be much easier this way
-    $content = WbDatabase::getInstance()->escapeString ($content);
+	$content = WbDatabase::getInstance()->escapeString ($content);
 	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
 	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ';
 	$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' ';
 	$sql .= 'WHERE `section_id`='.(int)$section_id;
-	if(!$database->query($sql)){
-		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$database->get_error() : '');
+	if(!WbDatabase::getInstance()->query($sql)){
+		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.WbDatabase::getInstance()->get_error() : '');
 	}
 } else {
 	$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : '');
@@ -59,9 +59,9 @@
 
 $sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR.$section_id : 'section_'.$section_id );
 if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){
-    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
+	$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
 } else {
-    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
+	$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
 }
 
 // Check if there is a database error, otherwise say successful
Index: branches/2.8.x/wb/modules/wysiwyg/modify.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1874)
+++ branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1875)
@@ -26,14 +26,14 @@
 $sMediaUrl = WB_URL.MEDIA_DIRECTORY;
 // Get page content
 $sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
-if ( ($content = $database->get_one($sql)) ) {
+if ( ($content = $database->get_one($sql)) !== null  ) {
 	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content));
-}else {
-	$content = '';
+} else {
+	throw new AppException('Database: missing entry in table \''.TABLE_PREFIX.'mod_wysiwyg\' for section_id='.$section_id);
 }
 
 if(!isset($wysiwyg_editor_loaded)) {
-    $wysiwyg_editor_loaded=true;
+	$wysiwyg_editor_loaded=true;
 	if(!function_exists('show_wysiwyg_editor'))
 	{
 		if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'))
Index: branches/2.8.x/wb/modules/wysiwyg/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/upgrade.php	(revision 1874)
+++ branches/2.8.x/wb/modules/wysiwyg/upgrade.php	(revision 1875)
@@ -24,64 +24,64 @@
 
 if(!function_exists('mod_wysiwyg_upgrade'))
 {
-    function mod_wysiwyg_upgrade () {
-        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;
+	function mod_wysiwyg_upgrade () {
+		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;
 
-        $msg = array();
-        $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\'';
-        			}
-        		} else {
-                 $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
-        		}
-        	} else {
-        		$msg[] = $database->get_error();
-        	}
-        }
+		$msg = array();
+		$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\'';
+					}
+				} else {
+					 $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
+				}
+			} else {
+				$msg[] = $database->get_error();
+			}
+		}
 
-        $sTable = TABLE_PREFIX.'mod_wysiwyg';
-        if($database->index_exists($sTable, 'PRIMARY')) {
-            $sql = 'ALTER TABLE `'.DB_NAME.'`.`'.$sTable.'` DROP PRIMARY KEY';
-            if(!$database->query($sql)) {
-                $msg[] = ''.$database->get_error().'';
-            }
-        }
+		$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().'';
+			}
+		}
 
-        if(!$database->index_add($sTable, '', 'section_id', 'PRIMARY')) {
-        	$msg[] = ''.$database->get_error().'';
-        } else {
-            $msg[] = 'Create PRIMARY KEY ( `section_id` )';
-        }
+		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 upgrade-script
-        if($globalStarted) {
-            if($bDebugModus) {
-                foreach($msg as $title) {
-                    echo '<strong>'.$title.'</strong><br />';
-                }
-            }
-        }
-        return $msg;
-    }
+		// 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 />';
+				}
+			}
+		}
+		return $msg;
+	}
 }
 // ------------------------------------
 
