Index: /trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.common.inc.php	(revision 2857)
+++ /trunk/phpgwapi/inc/class.common.inc.php	(revision 2876)
@@ -403,4 +403,5 @@
 						. '</script>';
 
+					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'ckeditor', 'ckeditor', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'wz_dragdrop', 'wz_dragdrop', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'expressoAjax', NULL, true );
Index: /trunk/admin/inc/class.uimainscreen.inc.php
===================================================================
--- /trunk/admin/inc/class.uimainscreen.inc.php	(revision 2802)
+++ /trunk/admin/inc/class.uimainscreen.inc.php	(revision 2876)
@@ -23,5 +23,5 @@
 		{
 
-			$html = createObject('phpgwapi.html');
+			//$html = createObject('phpgwapi.html');
 			$section     = addslashes($_REQUEST['section']);
 			$select_lang = addslashes($_REQUEST['select_lang']);
@@ -95,11 +95,9 @@
 			if (empty($section))
 			{
+				$GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin');
+				//$GLOBALS['phpgw']->common->phpgw_header();
+				//echo parse_navbar();
 
-			   $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin');
-			   //$GLOBALS['phpgw']->common->phpgw_header();
-			   //echo parse_navbar();
-				  
-			   
-			   $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'));
+				$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'));
 				$GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
 				$GLOBALS['phpgw']->template->set_var('value','&nbsp;');
@@ -140,71 +138,46 @@
 				$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
 				$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
-				$GLOBALS['phpgw']->template->set_var('value','<input type="button" value="' . lang('Edit')
-					. '" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' )
-					. '\' + \'&section=\' + escape( this.form.section.item( 1 ).value ) + \'&select_lang=\' + escape( this.form.select_lang.item( 1 ).value ) )'
-					. '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) . '\' )">');
+				$GLOBALS['phpgw']->template->set_var('value',
+					'<input type="button" value="'
+						. lang('Edit') . '" onclick="ExpressoLivre.link( \''
+						. $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' )
+						. '\' + \'&section=\' + escape( this.form.section.item( 1 ).value )'
+						. ' + \'&select_lang=\' + escape( this.form.select_lang.item( 1 ).value ) )'
+						. '">'
+					. '<input type="button" name="cancel" value="'
+						. lang('cancel') . '" onclick="ExpressoLivre.link( \''
+						. $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' )
+						. '\' )">'
+				);
 				$GLOBALS['phpgw']->template->fp('rows','row_2',True);
 			}
 			else
 			{
-			   $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section"
+				$GLOBALS['phpgw']->template->set_block('message','edit','edit');
+				$GLOBALS['phpgw']->template->set_block('message','edit_script','edit_script');
+
+				$GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin');
+
+				$GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section"
 				. "_message'",__LINE__,__FILE__);
 				$GLOBALS['phpgw']->db->next_record();
-				
-				$current_message = $GLOBALS['phpgw']->db->f('content');
-				
-				if($_REQUEST['htmlarea'])
-				{
-					//$text_or_htmlarea=$html->htmlarea('message',stripslashes($current_message));
-
-					include_once("news_admin/inc/fckeditor.php");
-					$oFCKeditor = new FCKeditor( 'message' );
-
-					$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
-					$webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
-
-					if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1))
-						$webserver_url .= '/';
-
-					$oFCKeditor->BasePath = $webserver_url . 'news_admin/templates/default/fckeditor/'; 
-					$oFCKeditor->ToolbarSet = 'Basic';
-					$oFCKeditor->Value = $current_message;
-
-					$text_or_htmlarea = $oFCKeditor->Create( );
-
-					$htmlarea_button='<input type="button" name="no-htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\');" value="'.lang('disable WYSIWYG-editor').'">';	
-				}
-				else
-				{
-					$text_or_htmlarea='<textarea name="message" style="width:100%; min-width:350px; height:300px;" wrap="virtual">' . stripslashes($current_message) . '</textarea>';
-					$htmlarea_button='<input type="button" name="htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\' );" value="'.lang('activate WYSIWYG-editor').'">';
-
-				}			   
-
-				$GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin');
-				//$GLOBALS['phpgw']->common->phpgw_header();
-				//echo parse_navbar();
 
 				$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'));
 				$GLOBALS['phpgw']->template->set_var('select_lang',$select_lang);
 				$GLOBALS['phpgw']->template->set_var('section',$section);
-				$GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
-				$GLOBALS['phpgw']->template->set_var('value','&nbsp;');
-				$GLOBALS['phpgw']->template->fp('rows','row_2',True);
+				$GLOBALS['phpgw']->template->set_var('message', '<textarea name="message"></textarea>');
 
-				$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-				$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
+				$GLOBALS['phpgw']->template->fp('scripts','edit_script',True);
+				$GLOBALS['phpgw']->template->fp('rows','edit',True);
 
-				
-				$GLOBALS['phpgw']->template->set_var('value',$text_or_htmlarea);
-				
-				
-				
-				$GLOBALS['phpgw']->template->fp('rows','row_2',True);
+				$GLOBALS['phpgw']->template->set_var( 'value',
+					'<input type="submit" name="submit" value="'
+						. lang('Save') . '">'
+					. '<input type="button" name="cancel" value="'. lang('cancel')
+						.'" onclick="ExpressoLivre.link( \''
+						. $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' )
+						. '\' )">'
+				);
 
-				$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-				$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
-				$GLOBALS['phpgw']->template->set_var('value','<input type="submit" name="submit" value="' . lang('Save')
-				. '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) . '\' )">'.$htmlarea_button);
 				$GLOBALS['phpgw']->template->fp('rows','row_2',True);
 			}
Index: /trunk/admin/inc/class.uiconfig.inc.php
===================================================================
--- /trunk/admin/inc/class.uiconfig.inc.php	(revision 2866)
+++ /trunk/admin/inc/class.uiconfig.inc.php	(revision 2876)
@@ -185,20 +185,7 @@
 			
 			if($appname=="admin") {							
-				/*
-				 * FCK editor to agree term
-				 */
-				include_once("news_admin/inc/fckeditor.php");
-				$oFCKeditor = new FCKeditor('newsettings[agree_term]');//CreateObject('news_admin.fckeditor','newsettings[agree_term]');
-
-				$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
-				$webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
-
-				if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1))
-					$webserver_url .= '/';
-
-				$oFCKeditor->BasePath = $webserver_url . 'news_admin/templates/default/fckeditor/'; 
-				$oFCKeditor->ToolbarSet = 'Basic';
-				$oFCKeditor->Value = isset($GLOBALS['phpgw_info']['server']['agree_term']) ? $GLOBALS['phpgw_info']['server']['agree_term'] : '';
-				$t->set_var('agree_term_input',$oFCKeditor->Create());			
+				$t->set_var('agree_term_input', '<textarea name="newsettings[agree_term]" id="agree_term">'
+					. (isset($GLOBALS['phpgw_info']['server']['agree_term']) ? $GLOBALS['phpgw_info']['server']['agree_term'] : '')
+					. '</textarea>');
 			}
 			$t->set_var('title',lang('Site Configuration'));
Index: /trunk/admin/templates/classic/config.tpl
===================================================================
--- /trunk/admin/templates/classic/config.tpl	(revision 2802)
+++ /trunk/admin/templates/classic/config.tpl	(revision 2876)
@@ -1,14 +1,28 @@
 <!-- BEGIN header -->
 <script>
-function FCKeditor_OnComplete( editorInstance )
+function send_form( pForm )
 {
-	editorInstance.LinkedField.form.onsubmit = function( )
+	ExpressoLivre.events.fire.onunload( );
+	return ExpressoLivre.form( pForm );
+}
+
+ExpressoLivre.events.onload( function( )
+{
+	CKEDITOR.replace( "agree_term",
 	{
-		document.getElementById( 'newsettings[agree_term]' ).value = FCKeditorAPI.GetInstance( editorInstance.Name ).GetHTML( );
-		return ExpressoLivre.form( editorInstance.LinkedField.form );
-	};
-}
+		toolbar :
+		[
+			[ 'Styles', 'Format' ],
+			[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList' ]
+		]
+	} );
+} );
+
+ExpressoLivre.events.onunload( function( )
+{
+	CKEDITOR.instances.agree_term.destroy( );
+} );
 </script>
-<form method="POST" action="{action_url}">
+<form method="POST" action="{action_url}" onsubmit="return send_form( this );">
 <table align="center" width="85%" callspacing="0" style="{ border: 1px solid #000000; }">
    <tr class="th">
@@ -197,5 +211,5 @@
     <td colspan="2" align="center">
       <input type="submit" name="submit" value="{lang_submit}">
-      <input type="submit" name="cancel" value="{lang_cancel}">
+      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" />
 		  <br>
     </td>
Index: /trunk/admin/templates/classic/mainscreen_message.tpl
===================================================================
--- /trunk/admin/templates/classic/mainscreen_message.tpl	(revision 1362)
+++ /trunk/admin/templates/classic/mainscreen_message.tpl	(revision 2876)
@@ -1,5 +1,5 @@
 <!-- BEGIN form -->
 <div align="center">{error_message}</div>
-<form method="POST" action="{form_action}">
+<form method="POST" action="{form_action}" onsubmit="return send_form( this );">
  <table border="0" align="center" >
 <input type="hidden" name="select_lang" value="{select_lang}">
Index: /trunk/admin/templates/default/mainscreen_message.tpl
===================================================================
--- /trunk/admin/templates/default/mainscreen_message.tpl	(revision 2802)
+++ /trunk/admin/templates/default/mainscreen_message.tpl	(revision 2876)
@@ -1,8 +1,8 @@
 <!-- BEGIN form -->
-<div align="center">{error_message}</div>
-<form method="POST" action="{form_action}" onsubmit="return ExpressoLivre.form( this );">
+{scripts}
+<form method="POST" action="{form_action}" onsubmit="return send_form( this );">
  <table border="0" align="center" >
-<input type="hidden" name="select_lang" value="{select_lang}">
-<input type="hidden" name="section" value="{section}">
+  <input type="hidden" name="select_lang" value="{select_lang}">
+  <input type="hidden" name="section" value="{section}">
   {rows}
  </table>
@@ -36,2 +36,38 @@
   </tr>
 <!-- END row_2 -->
+<!-- BEGIN edit -->
+  <tr >
+    <td colspan="2">
+	 <br />
+	  {message}
+	 <br />
+	</td>
+  </tr>
+<!-- END edit -->
+<!-- BEGIN edit_script -->
+<script>
+function send_form( pForm )
+{
+	ExpressoLivre.events.fire.onunload( );
+	return ExpressoLivre.form( pForm );
+}
+
+ExpressoLivre.events.onload( function( )
+{
+	CKEDITOR.replace( "message",
+	{
+		toolbar :
+		[
+			[ 'Styles', 'Format' ],
+			[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList' ]
+		],
+		width : 500
+	} );
+} );
+
+ExpressoLivre.events.onunload( function( )
+{
+	CKEDITOR.instances.message.destroy( );
+} );
+</script>
+<!-- END edit_script -->
Index: /trunk/admin/templates/default/config.tpl
===================================================================
--- /trunk/admin/templates/default/config.tpl	(revision 2802)
+++ /trunk/admin/templates/default/config.tpl	(revision 2876)
@@ -1,14 +1,28 @@
 <!-- BEGIN header -->
 <script>
-function FCKeditor_OnComplete( editorInstance )
+function send_form( pForm )
 {
-	editorInstance.LinkedField.form.onsubmit = function( )
+	ExpressoLivre.events.fire.onunload( );
+	return ExpressoLivre.form( pForm );
+}
+
+ExpressoLivre.events.onload( function( )
+{
+	CKEDITOR.replace( "agree_term",
 	{
-		document.getElementById( 'newsettings[agree_term]' ).value = FCKeditorAPI.GetInstance( editorInstance.Name ).GetHTML( );
-		return ExpressoLivre.form( editorInstance.LinkedField.form );
-	};
-}
+		toolbar :
+		[
+			[ 'Styles', 'Format' ],
+			[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList' ]
+		]
+	} );
+} );
+
+ExpressoLivre.events.onunload( function( )
+{
+	CKEDITOR.instances.agree_term.destroy( );
+} );
 </script>
-<form method="POST" action="{action_url}">
+<form method="POST" action="{action_url}" onsubmit="return send_form( this );">
 <table align="center" width="85%" callspacing="0">
    <tr class="th">
