Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1639)
+++ branches/2.8.x/CHANGELOG	(revision 1640)
@@ -12,6 +12,8 @@
 ===============================================================================
 
 
+22 Mar-2012 Build 1640 Dietmar Woellbrink (Luisehahne)
+! optimize modules WYSIWYG for editors
 22 Mar-2012 Build 1639 Dietmar Woellbrink (Luisehahne)
 + Installer add const DEBUG to config.php
 ! move const DEBUG and var $starttime from index.php to initialize.php
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1639)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1640)
@@ -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', '1639');
+if(!defined('REVISION')) define('REVISION', '1640');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/wysiwyg/save.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1639)
+++ branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1640)
@@ -33,7 +33,7 @@
 
 // Include the WB functions file
 require_once(WB_PATH.'/framework/functions.php');
-
+$aErrors = array();
 $sMediaUrl = WB_URL.MEDIA_DIRECTORY;
 // Update the mod_wysiwygs table with the contents
 if(isset($_POST['content'.$section_id])) {
@@ -50,7 +50,11 @@
 	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ';
 	$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' ';
 	$sql .= 'WHERE `section_id`='.(int)$section_id;
-	$database->query($sql);
+	if(!$database->query($sql)){
+		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$database->get_error() : '');
+	}
+} else {
+	$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : '');
 }
 
 $sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
@@ -61,10 +65,10 @@
 }
 
 // Check if there is a database error, otherwise say successful
-if($database->is_error()) {
-	$admin->print_error($database->get_error(), $js_back);
+if(sizeof($aErrors) ) {
+	$admin->print_error( implode('<br />',$aErrors), $edit_page);
 } else {
-	$admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page );
+	$admin->print_success($MESSAGE['GENERIC_UPGRADED'], $edit_page );
 }
 
 // Print admin footer
Index: branches/2.8.x/wb/modules/wysiwyg/modify.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1639)
+++ branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1640)
@@ -31,24 +31,17 @@
 }else {
 	$content = '';
 }
-if(!isset($wysiwyg_editor_loaded)) {
-	$wysiwyg_editor_loaded=true;
 
-	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
-		function show_wysiwyg_editor($name,$id,$content,$width,$height) {
+if(!function_exists('show_wysiwyg_editor'))
+{
+	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'))
+	{
+		function show_wysiwyg_editor($name,$id,$content,$width,$height)
+		{
 			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
 		}
 	} else {
-		$id_list = array();
-		$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` ';
-		$sql .= 'WHERE `page_id`='.(int)$page_id.' AND `module`=\'wysiwyg\'';
-		if (($query_wysiwyg = $database->query($sql))) {
-			while($wysiwyg_section = $query_wysiwyg->fetchRow()) {
-				$entry='content'.$wysiwyg_section['section_id'];
-				$id_list[] = $entry;
-			}
-			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
-		}
+		require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
 	}
 }
 
@@ -57,8 +50,8 @@
 	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
 	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
 <?php
-echo $admin->getFTAN()."\n"; 
-show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
+echo $admin->getFTAN()."\n";
+echo show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
 ?>
 	<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
 		<tr>
