Index: admin/post.php
===================================================================
--- admin/post.php	(revision 2694)
+++ admin/post.php	(revision 2705)
@@ -19,5 +19,5 @@
 $post_dt = '';
 $post_format = $core->auth->getOption('post_format');
-$editor = $core->auth->getOption('editor');
+$post_editor = $core->auth->getOption('editor');
 $post_password = '';
 $post_url = '';
@@ -61,5 +61,10 @@
 
 # Formaters combo
-$formaters_combo = dcAdminCombos::getFormatersCombo($editor);
+$formaters_combo = dcAdminCombos::getFormatersCombo();
+foreach ($formaters_combo as $editor => $formats) {
+	foreach ($formats as $format) {
+		$formaters_combo[$editor][$format] = "$editor:$format";
+	}
+}
 
 # Languages combo
@@ -83,6 +88,5 @@
 
 # Get entry informations
-if (!empty($_REQUEST['id']))
-{
+if (!empty($_REQUEST['id'])) {
 	$page_title = __('Edit entry');
 
@@ -91,15 +95,17 @@
 	$post = $core->blog->getPosts($params);
 
-	if ($post->isEmpty())
-	{
+	if ($post->isEmpty()) {
 		$core->error->add(__('This entry does not exist.'));
 		$can_view_page = false;
-	}
-	else
-	{
+	} else {
 		$post_id = $post->post_id;
 		$cat_id = $post->cat_id;
 		$post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
 		$post_format = $post->post_format;
+        # try to retrieve editor from post meta
+        $meta_editor = $core->meta->getMetaStr($post->post_meta,'editor');
+        if (!empty($meta_editor)) {
+            $post_editor = $meta_editor;
+        }
 		$post_password = $post->post_password;
 		$post_url = $post->post_url;
@@ -190,7 +196,13 @@
 
 # Format excerpt and content
-elseif (!empty($_POST) && $can_edit_post)
-{
-	$post_format = $_POST['post_format'];
+elseif (!empty($_POST) && $can_edit_post) {
+
+	if (strpos($_POST['post_format'], ':')!==false) {
+		list($post_editor, $post_format) = explode(':', $_POST['post_format']);
+	} else {
+		$post_format = $_POST['post_format'];
+		$post_editor = '';
+	}
+
 	$post_excerpt = $_POST['post_excerpt'];
 	$post_content = $_POST['post_content'];
@@ -280,4 +292,5 @@
 	$cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : '';
 	$cur->post_format = $post_format;
+	$cur->post_meta = serialize(array('editor' => $post_editor));
 	$cur->post_password = $post_password;
 	$cur->post_lang = $post_lang;
@@ -298,8 +311,10 @@
 
 	# Update post
-	if ($post_id)
-	{
-		try
-		{
+	if ($post_id) {
+		try {
+            $meta = $core->meta;
+            $meta->delPostMeta($post_id,'editor');
+            $meta->setPostMeta($post_id,'editor',$post_editor);
+
 			# --BEHAVIOR-- adminBeforePostUpdate
 			$core->callBehavior('adminBeforePostUpdate',$cur,$post_id);
@@ -311,16 +326,11 @@
 			dcPage::addSuccessNotice (sprintf(__('The post "%s" has been successfully updated'),html::escapeHTML($cur->post_title)));
 			http::redirect('post.php?id='.$post_id);
-		}
-		catch (Exception $e)
-		{
+		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
 		}
-	}
-	else
-	{
+	} else {
 		$cur->user_id = $core->auth->userID();
 
-		try
-		{
+		try {
 			# --BEHAVIOR-- adminBeforePostCreate
 			$core->callBehavior('adminBeforePostCreate',$cur);
@@ -328,4 +338,8 @@
 			$return_id = $core->blog->addPost($cur);
 
+            $meta = $core->meta;
+            $meta->delPostMeta($return_id,'editor');
+            $meta->setPostMeta($return_id,'editor',$post_editor);
+
 			# --BEHAVIOR-- adminAfterPostCreate
 			$core->callBehavior('adminAfterPostCreate',$cur,$return_id);
@@ -333,7 +347,5 @@
 			dcPage::addSuccessNotice(__('Entry has been successfully created.'));
 			http::redirect('post.php?id='.$return_id);
-		}
-		catch (Exception $e)
-		{
+		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
 		}
@@ -381,4 +393,9 @@
 }
 
+$admin_post_behavior = '';
+if (($core->auth->getOption('editor')==$post_editor) 
+    && in_array($post_format, $core->getFormaters($core->auth->getOption('editor')))) {
+    $admin_post_behavior = $core->callBehavior('adminPostEditor');
+}
 
 dcPage::open($page_title.' - '.__('Entries'),
@@ -386,6 +403,6 @@
 	dcPage::jsModal().
 	dcPage::jsMetaEditor().
+    $admin_post_behavior.
 	dcPage::jsLoad('js/_post.js').
-	$core->callBehavior('adminPostEditor').
 	dcPage::jsConfirmClose('entry-form','comment-form').
 	# --BEHAVIOR-- adminPostHeaders
@@ -455,12 +472,16 @@
 /* Post form if we can edit post
 -------------------------------------------------------- */
-if ($can_edit_post)
-{
+if ($can_edit_post) {
 	if (count($formaters_combo)>0 && ($core->auth->getOption('editor') && $core->auth->getOption('editor')!='')) {
-		$post_format_field = form::combo('post_format',$formaters_combo,$post_format,'maximal');
+		// temporay removed until we can switch easily editor
+        // $post_format_field = form::combo('post_format',$formaters_combo,"$post_editor:$post_format",'maximal');
+
+        $post_format_field = sprintf('%s (%s)', $post_format, $post_editor);
+ 		$post_format_field .= form::hidden('post_format',"$post_editor:$post_format");
 	} else {
 		$post_format_field = sprintf(__('Choose an active editor in %s.'), 
 		'<a href="preferences.php#user-options">'.__('your preferences').'</a>'
 		);
+		$post_format_field .= form::hidden('post_format','xhtml');
 	}
 
Index: plugins/dcLegacyEditor/js/_post_editor.js
===================================================================
--- plugins/dcLegacyEditor/js/_post_editor.js	(revision 2614)
+++ plugins/dcLegacyEditor/js/_post_editor.js	(revision 2705)
@@ -1,4 +1,12 @@
 $(function() {
 	if ($('#edit-entry').length==0) {return;}
+
+	// remove editor prefix
+	var getPostFormat = function getPostFormat(post_format) {
+		return post_format.replace(/[^:]*:/,'');
+	};
+	var getPostEditor = function getPostEditor(post_format) {
+		return post_format.replace(/:.*/,'');
+	};
 
 	// Get document format and prepare toolbars
@@ -6,10 +14,14 @@
 	var last_post_format = $(formatField).val();
 	$(formatField).change(function() {
+		if (getPostEditor(this.value)!='dcLegacyEditor') { return;}
+
+		var post_format = getPostFormat(this.value);
+
 		// Confirm post format change
-		if(window.confirm(dotclear.msg.confirm_change_post_format_noconvert)){
-			excerptTb.switchMode(this.value);
-			contentTb.switchMode(this.value);
+		if (window.confirm(dotclear.msg.confirm_change_post_format_noconvert)) {
+			excerptTb.switchMode(post_format);
+			contentTb.switchMode(post_format);
 			last_post_format = $(this).val();
-		}else{
+		} else {
 			// Restore last format if change cancelled
 			$(this).val(last_post_format);
@@ -17,5 +29,5 @@
 
 		$('.format_control > *').addClass('hide');
-		$('.format_control:not(.control_no_'+$(this).val()+') > *').removeClass('hide');
+		$('.format_control:not(.control_no_'+post_format+') > *').removeClass('hide');
 	});
 
@@ -25,5 +37,5 @@
 
 	$('.format_control > *').addClass('hide');
-	$('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide');
+	$('.format_control:not(.control_no_'+getPostFormat(last_post_format)+') > *').removeClass('hide');
 
 	if ($('#comment_content').length>0) {
@@ -49,5 +61,5 @@
 				excerpt: excerpt_content,
 				content: post_content,
-				format: $('#post_format').get(0).value,
+				format: getPostFormat($('#post_format').get(0).value),
 				lang: $('#post_lang').get(0).value
 			};
@@ -99,6 +111,6 @@
 
 		// Load toolbars
-		contentTb.switchMode(formatField.value);
-		excerptTb.switchMode(formatField.value);
+		contentTb.switchMode(getPostFormat(formatField.value));
+		excerptTb.switchMode(getPostFormat(formatField.value));
 
 		// Check unsaved changes before XHTML conversion
