Index: admin/_charte.php
===================================================================
--- admin/_charte.php	(revision 2501)
+++ admin/_charte.php	(revision 2504)
@@ -31,4 +31,5 @@
 	<script type="text/javascript" src="js/jquery/jquery.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script>
+	<script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script>
Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 2566)
+++ admin/auth.php	(revision 2720)
@@ -16,5 +16,5 @@
 if (isset($_SESSION['sess_user_id']))
 {
-	http::redirect('index.php');
+	http::redirect($core->adminurl->get('admin.home'));
 }
 
@@ -185,5 +185,5 @@
 		}
 
-		http::redirect('index.php');
+		http::redirect($core->adminurl->get('admin.home'));
 	}
 	catch (Exception $e)
@@ -243,5 +243,5 @@
 		}
 
-		http::redirect('index.php');
+		http::redirect($core->adminurl->get('admin.home'));
 	}
 	else
@@ -326,5 +326,5 @@
 <body id="dotclear-admin" class="auth">
 
-<form action="auth.php" method="post" id="login-screen">
+<form action="<?php echo $core->adminurl->get('admin.auth'); ?>" method="post" id="login-screen">
 <h1><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></h1>
 
@@ -339,5 +339,5 @@
 if ($akey)
 {
-	echo '<p><a href="auth.php">'.__('Back to login screen').'</a></p>';
+	echo '<p><a href="'.$core->adminurl->get('admin.auth').'">'.__('Back to login screen').'</a></p>';
 }
 elseif ($recover)
@@ -356,5 +356,5 @@
 
 	'<div id="issue">'.
-	'<p><a href="auth.php">'.__('Back to login screen').'</a></p>'.
+	'<p><a href="'.$core->adminurl->get('admin.auth').'">'.__('Back to login screen').'</a></p>'.
 	'</div>';
 }
@@ -426,11 +426,11 @@
 		if ($safe_mode) {
 			echo
-			'<p><a href="auth.php" id="normal_mode_link">'.__('Get back to normal authentication').'</a></p>';
+			'<p><a href="'.$core->adminurl->get('admin.auth').'" id="normal_mode_link">'.__('Get back to normal authentication').'</a></p>';
 		} else {
 			echo '<p id="more"><strong>'.__('Connection issue?').'</strong></p>';
 			if ($core->auth->allowPassChange()) {
-				echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
+				echo '<p><a href="'.$core->adminurl->get('admin.auth',array('recover' => 1)).'">'.__('I forgot my password').'</a></p>';
 			}
-			echo '<p><a href="auth.php?safe_mode=1" id="safe_mode_link">'.__('I want to log in in safe mode').'</a></p>';
+			echo '<p><a href="'.$core->adminurl->get('admin.auth',array('safe_mode' => 1)).'" id="safe_mode_link">'.__('I want to log in in safe mode').'</a></p>';
 		}
 
Index: admin/blog.php
===================================================================
--- admin/blog.php	(revision 2566)
+++ admin/blog.php	(revision 2720)
@@ -21,5 +21,5 @@
 
 # Create a blog
-if (!isset($_POST['id']) && !empty($_POST['blog_id']))
+if (!isset($_POST['id']) && (isset($_POST['create'])))
 {
 	$cur = $core->con->openCursor($core->prefix.'blog');
@@ -52,5 +52,5 @@
 		$core->callBehavior('adminAfterBlogCreate',$cur,$blog_id,$blog_settings);
 		dcPage::addSuccessNotice(sprintf(__('Blog "%s" successfully created'), html::escapeHTML($cur->blog_name)));
-		http::redirect('blog.php?id='.$cur->blog_id);
+		http::redirect($core->adminurl->get("admin.blog", array('id' => $cur->blog_id)));
 	}
 	catch (Exception $e)
@@ -71,5 +71,5 @@
 			array(
 				__('System') => '',
-				__('Blogs') => 'blogs.php',
+				__('Blogs') => $core->adminurl->get("admin.blogs"),
 				__('New blog') => ''
 			))
@@ -77,5 +77,5 @@
 
 	echo
-	'<form action="blog.php" method="post" id="blog-form">'.
+	'<form action="'.$core->adminurl->get("admin.blog").'" method="post" id="blog-form">'.
 
 	'<div>'.$core->formNonce().'</div>'.
@@ -83,9 +83,4 @@
 	form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</p>'.
 	'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> ';
-
-	if ($blog_id) {
-		echo
-		'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';
-	}
 
 	echo
@@ -99,5 +94,5 @@
 	form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'.
 
-	'<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'.
+	'<p><input type="submit" accesskey="s" name="create" value="'.__('Create').'" /></p>'.
 	'</form>';
 
Index: admin/blog_del.php
===================================================================
--- admin/blog_del.php	(revision 2566)
+++ admin/blog_del.php	(revision 2720)
@@ -44,5 +44,5 @@
 			dcPage::addSuccessNotice(sprintf(__('Blog "%s" successfully deleted'), html::escapeHTML($blog_name)));
 
-			http::redirect('blogs.php');
+			http::redirect($core->adminurl->get("admin.blogs"));
 		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
@@ -55,5 +55,5 @@
 		array(
 			__('System') => '',
-			__('Blogs') => 'blogs.php',
+			__('Blogs') => $core->adminurl->get("admin.blogs"),
 			__('Delete a blog') => ''
 		))
@@ -69,5 +69,5 @@
 
 	echo
-	'<form action="blog_del.php" method="post">'.
+	'<form action="'.$core->adminurl->get("admin.blog.del").'" method="post">'.
 	'<div>'.$core->formNonce().'</div>'.
 	'<p><label for="pwd">'.__('Your password:').'</label> '.
Index: admin/blog_pref.php
===================================================================
--- admin/blog_pref.php	(revision 2566)
+++ admin/blog_pref.php	(revision 2720)
@@ -26,6 +26,6 @@
 	$blog_url = $core->blog->url;
 
-	$action = 'blog_pref.php';
-	$redir = 'blog_pref.php';
+	$action = $core->adminurl->get("admin.blog.pref");
+	$redir = $core->adminurl->get("admin.blog.pref");
 }
 else
@@ -55,6 +55,6 @@
 	}
 
-	$action = 'blog.php';
-	$redir = 'blog.php?id=%s';
+	$action = $core->adminurl->get("admin.blog");
+	$redir = $core->adminurl->get("admin.blog",array('id' => "%s"));
 }
 
@@ -166,4 +166,7 @@
 	$media_img_m_size = abs((integer) $_POST['media_img_m_size']);
 	if ($media_img_m_size < 0) { $media_img_m_size = 448; }
+
+	$nb_post_for_home = abs((integer) $_POST['nb_post_for_home']);
+	if ($nb_post_for_home <= 1) { $nb_post_for_home = 1; }
 
 	$nb_post_per_page = abs((integer) $_POST['nb_post_per_page']);
@@ -231,4 +234,5 @@
 		$blog_settings->system->put('note_title_tag',$_POST['note_title_tag']);
 
+		$blog_settings->system->put('nb_post_for_home',$nb_post_for_home);
 		$blog_settings->system->put('nb_post_per_page',$nb_post_per_page);
 		$blog_settings->system->put('use_smilies',!empty($_POST['use_smilies']));
@@ -277,5 +281,5 @@
 		array(
 			__('System') => '',
-			__('Blogs') => 'blogs.php',
+			__('Blogs') => $core->adminurl->get("admin.blogs"),
 			__('Blog settings').' : '.html::escapeHTML($blog_name) => ''
 		));
@@ -292,4 +296,5 @@
 	"</script>".
 	dcPage::jsConfirmClose('blog-form').
+	$core->callBehavior('adminPostEditor').
 	dcPage::jsLoad('js/_blog_pref.js').
 
@@ -512,4 +517,8 @@
 
 	'<div class="col">'.
+	'<p><label for="nb_post_for_home" class="classic">'.sprintf(__('Display %s entries on home page'),
+	form::field('nb_post_for_home',2,3,$blog_settings->system->nb_post_for_home)).
+	'</label></p>'.
+
 	'<p><label for="nb_post_per_page" class="classic">'.sprintf(__('Display %s entries per page'),
 	form::field('nb_post_per_page',2,3,$blog_settings->system->nb_post_per_page)).
@@ -606,5 +615,5 @@
 	{
 		echo
-		'<form action="blog_del.php" method="post">'.
+		'<form action="'.$core->adminurl->get("admin.blog.del").'" method="post">'.
 		'<p><input type="submit" class="delete" value="'.__('Delete this blog').'" />'.
 		form::hidden(array('blog_id'),$blog_id).
@@ -638,5 +647,5 @@
 	{
 		if ($core->auth->isSuperAdmin()) {
-			$user_url_p = '<a href="user.php?id=%1$s">%1$s</a>';
+			$user_url_p = '<a href="'.$core->adminurl->get("admin.user",array('id' => '%1$s')).'">%1$s</a>';
 		} else {
 			$user_url_p = '%1$s';
@@ -710,5 +719,5 @@
 					'<form action="users_actions.php" method="post">'.
 					'<p class="change-user-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'.
-					form::hidden(array('redir'),'blog_pref.php?id='.$k).
+					form::hidden(array('redir'),$core->adminurl->get("admin.blog.pref",array('id' => $k))).
 					form::hidden(array('action'),'perms').
 					form::hidden(array('users[]'),$k).
Index: admin/blog_theme.php
===================================================================
--- admin/blog_theme.php	(revision 2579)
+++ admin/blog_theme.php	(revision 2677)
@@ -133,5 +133,5 @@
 		'<p class="info vertical-separator">'.sprintf(
 			__("Visit %s repository, the resources center for Dotclear."),
-			'<a href="http://themes.dotaddict.org/dc2/">Dotaddict</a>'
+			'<a href="http://themes.dotaddict.org/galerie-dc2/">Dotaddict</a>'
 			).
 		'</p>'.
Index: admin/blogs.php
===================================================================
--- admin/blogs.php	(revision 2566)
+++ admin/blogs.php	(revision 2720)
@@ -99,9 +99,9 @@
 {
 	if ($core->auth->isSuperAdmin()) {
-		echo '<p class="top-add"><a class="button add" href="blog.php">'.__('Create a new blog').'</a></p>';
+		echo '<p class="top-add"><a class="button add" href="'.$core->adminurl->get("admin.blog").'">'.__('Create a new blog').'</a></p>';
 	}
 
 	echo
-	'<form action="blogs.php" method="get" id="filters-form">'.
+	'<form action="'.$core->adminurl->get("admin.blogs").'" method="get" id="filters-form">'.
 	'<h3 class="hidden">'.__('Filter blogs list').'</h3>'.
 
@@ -183,5 +183,5 @@
 	if ($GLOBALS['core']->auth->isSuperAdmin()) {
 		$edit_link =
-		'<a href="blog.php?id='.$blog_id.'"  title="'.sprintf(__('Edit blog settings for %s'),$blog_id).'">'.
+		'<a href="'.$core->adminurl->get("admin.blog",array('id' => $blog_id)).'"  title="'.sprintf(__('Edit blog settings for %s'),$blog_id).'">'.
 		'<img src="images/edit-mini.png" alt="'.__('Edit blog settings').'" /> '.$blog_id.'</a> ';
 	} else {
@@ -198,5 +198,5 @@
 	'<tr class="line">'.
 	'<td class="nowrap">'.$edit_link.'</td>'.
-	'<td class="maximal"><a href="index.php?switchblog='.$rs->blog_id.'" '.
+	'<td class="maximal"><a href="'.$core->adminurl->get("admin.home",array('switchblog' => $rs->blog_id)).'" '.
 	'title="'.sprintf(__('Switch to blog %s'),$rs->blog_id).'">'.
 	html::escapeHTML($rs->blog_name).'</a></td>'.
Index: admin/categories.php
===================================================================
--- admin/categories.php	(revision 2709)
+++ admin/categories.php	(revision 2720)
@@ -24,5 +24,5 @@
 	if ($c->isEmpty()) {
 		dcPage::addErrorNotice(__('This category does not exist.'));
-		http::redirect('categories.php');
+		http::redirect($core->adminurl->get("admin.categories"));
 	}
 	$name = $c->cat_title;
@@ -33,5 +33,5 @@
 		$core->blog->delCategory($cat_id);
 		dcPage::addSuccessNotice(sprintf(__('The category "%s" has been successfully deleted.'),html::escapeHTML($name)));
-		http::redirect('categories.php');
+		http::redirect($core->adminurl->get("admin.categories"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -62,5 +62,5 @@
 		dcPage::addSuccessNotice(sprintf(__('The entries have been successfully moved to category "%s"'),
 			html::escapeHTML($name)));
-		http::redirect('categories.php');
+		http::redirect($core->adminurl->get("admin.categories"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -79,5 +79,5 @@
 
 	dcPage::addSuccessNotice(__('Categories have been successfully reordered.'));
-	http::redirect('categories.php');
+	http::redirect($core->adminurl->get("admin.categories"));
 }
 
@@ -89,5 +89,5 @@
 		$core->blog->resetCategoriesOrder();
 		dcPage::addSuccessNotice(__('Categories order has been successfully reset.'));
-		http::redirect('categories.php');
+		http::redirect($core->adminurl->get("admin.categories"));
 	}
 	catch (Exception $e)
@@ -109,4 +109,5 @@
 	&& $rs->count()>1) {
 		$starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js');
+		$starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');
 		$starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js');
 }
@@ -134,5 +135,5 @@
 
 echo
-'<p class="top-add"><a class="button add" href="category.php">'.__('New category').'</a></p>';
+'<p class="top-add"><a class="button add" href="'.$core->adminurl->get("admin.category").'">'.__('New category').'</a></p>';
 
 echo
@@ -145,5 +146,5 @@
 {
 	echo
-	'<form action="categories.php" method="post" id="form-categories">'.
+	'<form action="'.$core->adminurl->get("admin.categories").'" method="post" id="form-categories">'.
 	'<div id="categories">';
 
@@ -164,6 +165,8 @@
 
 		echo
-		'<p class="cat-title"><label class="classic" for="cat_'.$rs->cat_id.'"><a href="category.php?id='.$rs->cat_id.'">'.html::escapeHTML($rs->cat_title).'</a></label> </p>'.
-		'<p class="cat-nb-posts">(<a href="posts.php?cat_id='.$rs->cat_id.'">'.
+		'<p class="cat-title"><label class="classic" for="cat_'.$rs->cat_id.'"><a href="'.
+		$core->adminurl->get("admin.category",array('id' => $rs->cat_id)).'">'.html::escapeHTML($rs->cat_title).
+		'</a></label> </p>'.
+		'<p class="cat-nb-posts">(<a href="'.$core->adminurl->get("admin.posts",array('cat_id' => $rs->cat_id)).'">'.
 		sprintf(($rs->nb_post > 1 ? __('%d entries') : __('%d entry') ),$rs->nb_post).'</a>'.
 		', '.__('total:').' '.$rs->nb_total.')</p>'.
Index: admin/category.php
===================================================================
--- admin/category.php	(revision 2566)
+++ admin/category.php	(revision 2720)
@@ -85,5 +85,5 @@
 			$core->blog->setCategoryParent($cat_id,$new_parent);
 			dcPage::addSuccessNotice(__('The category has been successfully moved'));
-			http::redirect('categories.php');
+			http::redirect($core->adminurl->get("admin.categories"));
 		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
@@ -98,5 +98,5 @@
 		$core->blog->setCategoryPosition($cat_id,(integer) $_POST['cat_sibling'],$_POST['cat_move']);
 		dcPage::addSuccessNotice(__('The category has been successfully moved'));
-		http::redirect('categories.php');
+		http::redirect($core->adminurl->get("admin.categories"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -136,5 +136,5 @@
 			dcPage::addSuccessNotice(__('The category has been successfully updated.'));
 
-			http::redirect('category.php?id='.$_POST['id']);
+			http::redirect($core->adminurl->get("admin.category",array('id' => $_POST['id'])));
 		}
 		# Create category
@@ -151,5 +151,5 @@
 			dcPage::addSuccessNotice(sprintf(__('The category "%s" has been successfully created.'),
 				html::escapeHTML($cur->cat_title)));
-			http::redirect('categories.php');
+			http::redirect($core->adminurl->get("admin.categories"));
 		}
 	}
@@ -165,9 +165,9 @@
 $elements = array(
 	html::escapeHTML($core->blog->name) => '',
-	__('Categories') => 'categories.php'
+	__('Categories') => $core->adminurl->get("admin.categories")
 	);
 if ($cat_id) {
 	while($parents->fetch()) {
-		$elements[html::escapeHTML($parents->cat_title)] = 'category.php?id='.$parents->cat_id;
+		$elements[html::escapeHTML($parents->cat_title)] = $core->adminurl->get("admin.category",array('id'=> $parents->cat_id));
 	}
 }
@@ -176,6 +176,6 @@
 dcPage::open($title,
 	dcPage::jsConfirmClose('category-form').
-	dcPage::jsToolBar().
 	dcPage::jsLoad('js/_category.js'),
+	$core->callBehavior('adminPostEditor').
 	dcPage::breadcrumb($elements)
 );
@@ -186,5 +186,5 @@
 
 echo
-'<form action="category.php" method="post" id="category-form">'.
+'<form action="'.$core->adminurl->get("admin.category").'" method="post" id="category-form">'.
 '<h3>'.__('Category information').'</h3>'.
 '<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').'</label> '.
@@ -232,5 +232,5 @@
 	'<div class="col">'.
 
-	'<form action="category.php" method="post" class="fieldset">'.
+	'<form action="'.$core->adminurl->get("admin.category").'" method="post" class="fieldset">'.
 	'<h4>'.__('Category parent').'</h4>'.
 	'<p><label for="cat_parent" class="classic">'.__('Parent:').'</label> '.
@@ -244,5 +244,5 @@
 		echo
 		'<div class="col">'.
-		'<form action="category.php" method="post" class="fieldset">'.
+		'<form action="'.$core->adminurl->get("admin.category").'" method="post" class="fieldset">'.
 		'<h4>'.__('Category sibling').'</h4>'.
 		'<p><label class="classic" for="cat_sibling">'.__('Move current category').'</label> '.
Index: admin/comment.php
===================================================================
--- admin/comment.php	(revision 2566)
+++ admin/comment.php	(revision 2720)
@@ -91,5 +91,5 @@
 
 if (!$comment_id && !$core->error->flag()) {
-	$core->error->add(__('No comment'));
+	$core->error->add(__('No comments'));
 }
 
@@ -133,5 +133,5 @@
 
 			dcPage::addSuccessNotice(__('Comment has been successfully updated.'));
-			http::redirect('comment.php?id='.$comment_id);
+			http::redirect($core->adminurl->get("admin.comment",array('id' => $comment_id)));
 		}
 		catch (Exception $e)
@@ -181,6 +181,6 @@
 dcPage::open(__('Edit comment'),
 	dcPage::jsConfirmClose('comment-form').
-	dcPage::jsToolBar().
 	dcPage::jsLoad('js/_comment.js').
+	$core->callBehavior('adminPostEditor').
 	# --BEHAVIOR-- adminCommentHeaders
 	$core->callBehavior('adminCommentHeaders'),
@@ -205,9 +205,9 @@
 
 	echo
-	'<form action="comment.php" method="post" id="comment-form">'.
+	'<form action="'.$core->adminurl->get("admin.comment").'" method="post" id="comment-form">'.
 	'<div class="fieldset">'.
 	'<h3>'.__('Information collected').'</h3>'.
 	'<p>'.__('IP address:').' '.
-	'<a href="comments.php?ip='.$comment_ip.'">'.$comment_ip.'</a></p>'.
+	'<a href="'.$core->adminurl->get("admin.comments",array('ip' => $comment_ip)).'">'.$comment_ip.'</a></p>'.
 
 	'<p>'.__('Date:').' '.
Index: admin/comments.php
===================================================================
--- admin/comments.php	(revision 2566)
+++ admin/comments.php	(revision 2720)
@@ -20,5 +20,5 @@
 		$core->blog->delJunkComments();
 		$_SESSION['comments_del_spam'] = true;
-		http::redirect('comments.php');
+		http::redirect($core->adminurl->get("admin.comments"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -136,5 +136,5 @@
 }
 
-$comments_actions_page = new dcCommentsActionsPage($core,'comments.php');
+$comments_actions_page = new dcCommentsActionsPage($core,$core->adminurl->get("admin.comments"));
 
 if ($comments_actions_page->process()) {
@@ -191,13 +191,13 @@
 
 		echo
-			'<form action="comments.php" method="post" class="fieldset">';
+			'<form action="'.$core->adminurl->get("admin.comments").'" method="post" class="fieldset">';
 
 		if (!$with_spam || ($status != -2)) {
 			if ($spam_count == 1) {
 				echo '<p>'.sprintf(__('You have one spam comment.'),'<strong>'.$spam_count.'</strong>').' '.
-				'<a href="comments.php?status=-2">'.__('Show it.').'</a>.</p>';
+				'<a href="'.$core->adminurl->get("admin.comments",array('status' => -2)).'">'.__('Show it.').'</a>.</p>';
 			} elseif ($spam_count > 1) {
 				echo '<p>'.sprintf(__('You have %s spam comments.'),'<strong>'.$spam_count.'</strong>').' '.
-				'<a href="comments.php?status=-2">'.__('Show them.').'</a>.</p>';
+				'<a href="'.$core->adminurl->get("admin.comments",array('status' => -2)).'">'.__('Show them.').'</a>.</p>';
 			}
 		}
@@ -215,5 +215,5 @@
 
 	echo
-	'<form action="comments.php" method="get" id="filters-form">'.
+	'<form action="'.$core->adminurl->get("admin.comments").'" method="get" id="filters-form">'.
 	'<h3 class="hidden">'.__('Filter comments and trackbacks list').'</h3>'.
 	'<div class="table">'.
@@ -252,5 +252,5 @@
 	# Show comments
 	$comment_list->display($page,$nb_per_page,
-	'<form action="comments.php" method="post" id="form-comments">'.
+	'<form action="'.$core->adminurl->get("admin.comments").'" method="post" id="form-comments">'.
 
 	'%s'.
Index: admin/comments_actions.php
===================================================================
--- admin/comments_actions.php	(revision 2566)
+++ admin/comments_actions.php	(revision 2720)
@@ -24,5 +24,5 @@
 	$args['redir'] = $_REQUEST['redir'];
 } else {
-	$uri = 'comments.php';
+	$uri = $core->adminurl->get("admin.comments");
 	$args=array();
 }
Index: admin/help.php
===================================================================
--- admin/help.php	(revision 2566)
+++ admin/help.php	(revision 2720)
@@ -76,5 +76,5 @@
 	$breadcrumb = dcPage::breadcrumb(
 		array(
-			__('Global help') => 'help.php',
+			__('Global help') => $core->adminurl->get("admin.help"),
 			$content_array['title'] => ''
 		));
Index: admin/index.php
===================================================================
--- admin/index.php	(revision 2566)
+++ admin/index.php	(revision 2720)
@@ -21,5 +21,5 @@
 	try {
 		$core->setUserDefaultBlog($core->auth->userID(),$core->blog->id);
-		http::redirect('index.php');
+		http::redirect($core->adminurl->get("admin.home"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -36,5 +36,5 @@
 		setcookie('dc_admin',false,-600,'','',DC_ADMIN_SSL);
 	}
-	http::redirect('auth.php');
+	http::redirect($core->adminurl->get("admin.auth"));
 	exit;
 }
@@ -171,6 +171,6 @@
 -------------------------------------------------------- */
 dcPage::open(__('Dashboard'),
-	dcPage::jsToolBar().
 	dcPage::jsLoad('js/_index.js').
+	$core->callBehavior('adminPostEditor').
 	# --BEHAVIOR-- adminDashboardHeaders
 	$core->callBehavior('adminDashboardHeaders'),
@@ -193,6 +193,6 @@
 		echo
 		'<div class="dc-update"><h3>'.sprintf(__('Dotclear %s is available!'),$new_v).'</h3> '.
-		'<p><a class="button submit" href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a> '.
-		'<a class="button" href="update.php?hide_msg=1">'.__('Remind me later').'</a>'.
+		'<p><a class="button submit" href="'.$core->adminurl->get("admin.update").'">'.sprintf(__('Upgrade now'),$new_v).'</a> '.
+		'<a class="button" href="'.$core->adminurl->get("admin.update", array('hide_msg' => 1)).'">'.__('Remind me later').'</a>'.
 		($version_info ? ' </p>'.
 		'<p class="updt-info"><a href="'.$version_info.'">'.__('Information about this version').'</a>' : '').'</p>'.
@@ -203,5 +203,5 @@
 if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->getBlogCount() > 1) {
 	echo
-	'<p><a href="index.php?default_blog=1" class="button">'.__('Make this blog my default blog').'</a></p>';
+	'<p><a href="'.$core->adminurl->get("admin.home",array('default_blog' => 1)).'" class="button">'.__('Make this blog my default blog').'</a></p>';
 }
 
@@ -325,5 +325,5 @@
 		'<div id="quick">'.
 		'<h3>'.__('Quick entry').'</h3>'.
-		'<form id="quick-entry" action="post.php" method="post" class="fieldset">'.
+		'<form id="quick-entry" action="'.$core->adminurl->get('admin.post').'" method="post" class="fieldset">'.
 		'<h4>'.__('New entry').'</h4>'.
 		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
Index: admin/js/_category.js
===================================================================
--- admin/js/_category.js	(revision 2566)
+++ admin/js/_category.js	(revision 2614)
@@ -2,5 +2,7 @@
 	dotclear.hideLockable();
 
-	var tbCategory = new jsToolBar(document.getElementById('cat_desc'));
-	tbCategory.draw('xhtml');
+	if ($.isFunction('jsToolBar')) {
+		var tbCategory = new jsToolBar(document.getElementById('cat_desc'));
+		tbCategory.draw('xhtml');
+	}
 });
Index: admin/js/_comment.js
===================================================================
--- admin/js/_comment.js	(revision 2566)
+++ admin/js/_comment.js	(revision 2614)
@@ -1,7 +1,7 @@
 $(function() {
-	if (!document.getElementById) { return; }
-
-	var tbComment = new jsToolBar(document.getElementById('comment_content'));
-	tbComment.draw('xhtml');
+	if ($.isFunction('jsToolBar')) {
+		var tbComment = new jsToolBar(document.getElementById('comment_content'));
+		tbComment.draw('xhtml');
+	}
 
 	$('#comment-form input[name="delete"]').click(function() {
Index: admin/js/_index.js
===================================================================
--- admin/js/_index.js	(revision 1699)
+++ admin/js/_index.js	(revision 2614)
@@ -2,6 +2,8 @@
 	var f = $('#quick-entry');
 	if (f.length > 0) {
-		var contentTb = new jsToolBar($('#post_content',f)[0]);
-		contentTb.switchMode($('#post_format',f).val());
+		if ($.isFunction('jsToolBar')) {
+			var contentTb = new jsToolBar($('#post_content',f)[0]);
+			contentTb.switchMode($('#post_format',f).val());
+		}
 
 		$('input[name=save]',f).click(function() {
@@ -21,5 +23,5 @@
 
 		function quickPost(f,status) {
-			if (contentTb.getMode() == 'wysiwyg') {
+			if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) {
 				contentTb.syncContents('iframe');
 			}
@@ -55,5 +57,5 @@
 					$('#post_title',f).val('');
 					$('#post_content',f).val('');
-					if (contentTb.getMode() == 'wysiwyg') {
+					if ($.isFunction('jsToolBar') &&  (contentTb.getMode() == 'wysiwyg')) {
 						contentTb.syncContents('textarea');
 					}
Index: admin/js/_post.js
===================================================================
--- admin/js/_post.js	(revision 2556)
+++ admin/js/_post.js	(revision 2614)
@@ -51,36 +51,4 @@
 
 $(function() {
-	if (!document.getElementById) { return; }
-
-	if (document.getElementById('edit-entry'))
-	{
-		// Get document format and prepare toolbars
-		var formatField = $('#post_format').get(0);
-		var last_post_format = $(formatField).val();
-		$(formatField).change(function() {
-			// Confirm post format change
-			if(window.confirm(dotclear.msg.confirm_change_post_format_noconvert)){
-				excerptTb.switchMode(this.value);
-				contentTb.switchMode(this.value);
-				last_post_format = $(this).val();
-			}else{
-				// Restore last format if change cancelled
-				$(this).val(last_post_format);
-			}
-
-			$('.format_control > *').addClass('hide');
-			$('.format_control:not(.control_no_'+$(this).val()+') > *').removeClass('hide');
-		});
-
-		var excerptTb = new jsToolBar(document.getElementById('post_excerpt'));
-		var contentTb = new jsToolBar(document.getElementById('post_content'));
-		excerptTb.context = contentTb.context = 'post';
-	}
-
-	if (document.getElementById('comment_content')) {
-		var commentTb = new jsToolBar(document.getElementById('comment_content'));
-		commentTb.draw('xhtml');
-	}
-
 	// Post preview
 	$('#post-preview').modalWeb($(window).width()-40,$(window).height()-40);
@@ -99,72 +67,4 @@
 			return window.confirm(dotclear.msg.confirm_delete_post);
 		});
-
-		// Markup validator
-		var v = $('<div class="format_control"><p><a id="a-validator"></a></p><div/>').get(0);
-		$('.format_control').before(v);
-		var a = $('#a-validator').get(0);
-		a.href = '#';
-		a.className = 'button ';
-		$(a).click(function() {
-
-			excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html();
-			post_content	= $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html();
-
-			var params = {
-				xd_check: dotclear.nonce,
-				f: 'validatePostMarkup',
-				excerpt: excerpt_content,
-				content: post_content,
-				format: $('#post_format').get(0).value,
-				lang: $('#post_lang').get(0).value
-			};
-
-			$.post('services.php',params,function(data) {
-				if ($(data).find('rsp').attr('status') != 'ok') {
-					alert($(data).find('rsp message').text());
-					return false;
-				}
-
-				$('.message, .success, .error, .warning-msg').remove();
-
-				if ($(data).find('valid').text() == 1) {
-					var p = document.createElement('p');
-					p.id = 'markup-validator';
-
-					$(p).addClass('success');
-					$(p).text(dotclear.msg.xhtml_valid);
-					$('#entry-content h3').after(p);
-					$(p).backgroundFade({sColor: dotclear.fadeColor.beginValidatorMsg, eColor: dotclear.fadeColor.endValidatorMsg, steps: 50},function() {
-							$(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorMsg, eColor: dotclear.fadeColor.beginValidatorMsg});
-					});
-				} else {
-					var div = document.createElement('div');
-					div.id = 'markup-validator';
-
-					$(div).addClass('error');
-					$(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());
-					$('#entry-content h3').after(div);
-					$(div).backgroundFade({sColor: dotclear.fadeColor.beginValidatorErr,eColor: dotclear.fadeColor.endValidatorErr, steps: 50},function() {
-							$(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorErr, eColor: dotclear.fadeColor.beginValidatorErr});
-					});
-				}
-
-				if ( $('#post_excerpt').text() != excerpt_content || $('#post_content').text() != post_content ) {
-					var pn = document.createElement('p');
-					$(pn).addClass('warning-msg');
-					$(pn).text(dotclear.msg.warning_validate_no_save_content);
-					$('#entry-content h3').after(pn);
-				}
-
-				return false;
-			});
-
-			return false;
-		});
-
-		a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));
-
-		$('.format_control > *').addClass('hide');
-		$('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide');
 
 		// Hide some fields
@@ -218,8 +118,4 @@
 		});
 
-		// Load toolbars
-		contentTb.switchMode(formatField.value);
-		excerptTb.switchMode(formatField.value);
-
 		// Replace attachment remove links by a POST form submit
 		$('a.attachment-remove').click(function() {
@@ -232,13 +128,4 @@
 			}
 			return false;
-		});
-
-		// Check unsaved changes before XHTML conversion
-		var excerpt = $('#post_excerpt').val();
-		var content = $('#post_content').val();
-		$('#convert-xhtml').click(function() {
-			if (excerpt != $('#post_excerpt').val() || content != $('#post_content').val()) {
-				return window.confirm(dotclear.msg.confirm_change_post_format);
-			}
 		});
 	});
Index: admin/js/common.js
===================================================================
--- admin/js/common.js	(revision 2566)
+++ admin/js/common.js	(revision 2689)
@@ -290,5 +290,5 @@
 	var peInPage = $('#help-button').offset().top;
 	$('#help-button').addClass("floatable");
-	var peInFloat = $('#help-button').offset().top;
+	var peInFloat = $('#help-button').offset().top - $(window).scrollTop();
 	$('#help-button').removeClass("floatable");
 	$(window).scroll(
Index: admin/js/jquery/jquery.ui.touch-punch.js
===================================================================
--- admin/js/jquery/jquery.ui.touch-punch.js	(revision 2495)
+++ admin/js/jquery/jquery.ui.touch-punch.js	(revision 2495)
@@ -0,0 +1,160 @@
+/*!
+ * jQuery UI Touch Punch 0.2.2
+ *
+ * Copyright 2011, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ *  jquery.ui.widget.js
+ *  jquery.ui.mouse.js
+ */
+(function ($) {
+
+  // Detect touch support
+  $.support.touch = 'ontouchend' in document;
+
+  // Ignore browsers without touch support
+  if (!$.support.touch) {
+    return;
+  }
+
+  var mouseProto = $.ui.mouse.prototype,
+      _mouseInit = mouseProto._mouseInit,
+      touchHandled;
+
+  /**
+   * Simulate a mouse event based on a corresponding touch event
+   * @param {Object} event A touch event
+   * @param {String} simulatedType The corresponding mouse event
+   */
+  function simulateMouseEvent (event, simulatedType) {
+
+    // Ignore multi-touch events
+    if (event.originalEvent.touches.length > 1) {
+      return;
+    }
+
+    event.preventDefault();
+
+    var touch = event.originalEvent.changedTouches[0],
+        simulatedEvent = document.createEvent('MouseEvents');
+    
+    // Initialize the simulated mouse event using the touch event's coordinates
+    simulatedEvent.initMouseEvent(
+      simulatedType,    // type
+      true,             // bubbles                    
+      true,             // cancelable                 
+      window,           // view                       
+      1,                // detail                     
+      touch.screenX,    // screenX                    
+      touch.screenY,    // screenY                    
+      touch.clientX,    // clientX                    
+      touch.clientY,    // clientY                    
+      false,            // ctrlKey                    
+      false,            // altKey                     
+      false,            // shiftKey                   
+      false,            // metaKey                    
+      0,                // button                     
+      null              // relatedTarget              
+    );
+
+    // Dispatch the simulated event to the target element
+    event.target.dispatchEvent(simulatedEvent);
+  }
+
+  /**
+   * Handle the jQuery UI widget's touchstart events
+   * @param {Object} event The widget element's touchstart event
+   */
+  mouseProto._touchStart = function (event) {
+
+    var self = this;
+
+    // Ignore the event if another widget is already being handled
+    if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
+      return;
+    }
+
+    // Set the flag to prevent other widgets from inheriting the touch event
+    touchHandled = true;
+
+    // Track movement to determine if interaction was a click
+    self._touchMoved = false;
+
+    // Simulate the mouseover event
+    simulateMouseEvent(event, 'mouseover');
+
+    // Simulate the mousemove event
+    simulateMouseEvent(event, 'mousemove');
+
+    // Simulate the mousedown event
+    simulateMouseEvent(event, 'mousedown');
+  };
+
+  /**
+   * Handle the jQuery UI widget's touchmove events
+   * @param {Object} event The document's touchmove event
+   */
+  mouseProto._touchMove = function (event) {
+
+    // Ignore event if not handled
+    if (!touchHandled) {
+      return;
+    }
+
+    // Interaction was not a click
+    this._touchMoved = true;
+
+    // Simulate the mousemove event
+    simulateMouseEvent(event, 'mousemove');
+  };
+
+  /**
+   * Handle the jQuery UI widget's touchend events
+   * @param {Object} event The document's touchend event
+   */
+  mouseProto._touchEnd = function (event) {
+
+    // Ignore event if not handled
+    if (!touchHandled) {
+      return;
+    }
+
+    // Simulate the mouseup event
+    simulateMouseEvent(event, 'mouseup');
+
+    // Simulate the mouseout event
+    simulateMouseEvent(event, 'mouseout');
+
+    // If the touch interaction did not move, it should trigger a click
+    if (!this._touchMoved) {
+
+      // Simulate the click event
+      simulateMouseEvent(event, 'click');
+    }
+
+    // Unset the flag to allow other widgets to inherit the touch event
+    touchHandled = false;
+  };
+
+  /**
+   * A duck punch of the $.ui.mouse _mouseInit method to support touch events.
+   * This method extends the widget with bound touch event handlers that
+   * translate touch events to mouse events and pass them to the widget's
+   * original mouse event handling methods.
+   */
+  mouseProto._mouseInit = function () {
+    
+    var self = this;
+
+    // Delegate the touch handlers to the widget's element
+    self.element
+      .bind('touchstart', $.proxy(self, '_touchStart'))
+      .bind('touchmove', $.proxy(self, '_touchMove'))
+      .bind('touchend', $.proxy(self, '_touchEnd'));
+
+    // Call the original $.ui.mouse init method
+    _mouseInit.call(self);
+  };
+
+})(jQuery);
Index: admin/js/jsToolBar/jsToolBar.dotclear.js
===================================================================
--- admin/js/jsToolBar/jsToolBar.dotclear.js	(revision 2566)
+++ 	(revision )
@@ -1,386 +1,0 @@
-/* Change link button actions
--------------------------------------------------------- */
-jsToolBar.prototype.elements.link.data = {};
-jsToolBar.prototype.elements.link.fncall = {};
-jsToolBar.prototype.elements.link.open_url = 'popup_link.php';
-
-jsToolBar.prototype.elements.link.popup = function (args) {
-	window.the_toolbar = this;
-	args = args || '';
-
-	this.elements.link.data = {};
-	var url = this.elements.link.open_url+args;
-
-	var p_win = window.open(url,'dc_popup',
-	'alwaysRaised=yes,dependent=yes,toolbar=yes,height=420,width=520,'+
-	'menubar=no,resizable=yes,scrollbars=yes,status=no');
-};
-
-jsToolBar.prototype.elements.link.fn.wiki = function() {
-	this.elements.link.popup.call(this,'?hreflang='+this.elements.link.default_hreflang);
-};
-jsToolBar.prototype.elements.link.fncall.wiki = function() {
-	var data = this.elements.link.data;
-
-	if (data.href == '') { return; }
-
-	var etag = '|'+data.href;
-	if (data.hreflang) { etag += '|'+data.hreflang; }
-
-	if (data.title) {
-		if (!data.hreflang) { etag += '|'; }
-		etag += '|'+data.title;
-	}
-
-	if (data.content) {
-		this.encloseSelection('['+data.content,etag+']');
-	} else {
-		this.encloseSelection('[',etag+']');
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.xhtml = function() {
-	this.elements.link.popup.call(this,'?hreflang='+this.elements.link.default_hreflang);
-};
-jsToolBar.prototype.elements.link.fncall.xhtml = function() {
-	var data = this.elements.link.data;
-
-	if (data.href == '') { return; }
-
-	var stag = '<a href="'+data.href+'"';
-
-	if (data.hreflang) { stag += ' hreflang="'+data.hreflang+'"'; }
-	if (data.title) { stag += ' title="'+data.title+'"'; }
-	stag += '>';
-	var etag = '</a>';
-
-	if (data.content) {
-		this.encloseSelection('','',function() {
-			return stag + data.content + etag;
-		});
-	} else {
-		this.encloseSelection(stag,etag);
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.wysiwyg = function() {
-	var href, title, hreflang;
-	href = title = hreflang = '';
-	hreflang = this.elements.link.default_hreflang;
-
-	var a = this.getAncestor();
-
-	if (a.tagName == 'a') {
-		href= a.tag.href || '';
-		title = a.tag.title || '';
-		hreflang = a.tag.hreflang || '';
-	}
-
-	this.elements.link.popup.call(this,'?href='+href+'&hreflang='+hreflang+'&title='+title);
-};
-jsToolBar.prototype.elements.link.fncall.wysiwyg = function() {
-	var data = this.elements.link.data;
-
-	var a = this.getAncestor();
-
-	if (a.tagName == 'a') {
-		if (data.href == '') {
-			// Remove link
-			this.replaceNodeByContent(a.tag);
-			this.iwin.focus();
-			return;
-		} else {
-			// Update link
-			a.tag.href = data.href;
-			if (data.hreflang) {
-				a.tag.setAttribute('hreflang',data.hreflang);
-			} else {
-				a.tag.removeAttribute('hreflang');
-			}
-			if (data.title) {
-				a.tag.setAttribute('title',data.title);
-			} else {
-				a.tag.removeAttribute('title');
-			}
-			return;
-		}
-	}
-
-	// Create link
-	if (data.content) {
-		var n = document.createTextNode(data.content);
-	} else {
-		var n = this.getSelectedNode();
-	}
-	var a = this.iwin.document.createElement('a');
-	a.href = data.href;
-	if (data.hreflang) a.setAttribute('hreflang',data.hreflang);
-	if (data.title) a.setAttribute('title',data.title);
-	a.appendChild(n);
-	this.insertNode(a);
-};
-jsToolBar.prototype.getAncestor = function() {
-	var res = {};
-	var range, commonAncestorContainer;
-
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (ancestorTagName!='a' && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-
-	res.tag = commonAncestorContainer;
-	res.tagName = ancestorTagName;
-
-	return res;
-};
-
-/* Image selector
--------------------------------------------------------- */
-jsToolBar.prototype.elements.img_select = {
-	type: 'button',
-	title: 'Image chooser',
-	fn: {},
-	fncall: {},
-	open_url: 'media.php?popup=1',
-	data: {},
-	popup: function() {
-		window.the_toolbar = this;
-		this.elements.img_select.data = {};
-
-		var p_win = window.open(this.elements.img_select.open_url,'dc_popup',
-		'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+
-		'menubar=no,resizable=yes,scrollbars=yes,status=no');
-	}
-};
-jsToolBar.prototype.elements.img_select.fn.wiki = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.wiki = function() {
-	var d = this.elements.img_select.data;
-	if (d.src == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		var alt = (str) ? str : d.title;
-		var res = '(('+d.src+'|'+alt;
-
-		if (d.alignment == 'left') {
-			res += '|L';
-		} else if (d.alignment == 'right') {
-			res += '|R';
-		} else if (d.alignment == 'center') {
-			res += '|C';
-		} else if (d.description) {
-			res += '|';
-		}
-
-		if (d.description) {
-			res += '|'+d.description;
-		}
-
-		res += '))';
-
-		if (d.link) {
-			var ltitle = (alt) ? '||'+alt : '';
-			res = '['+res+'|'+d.url+ltitle+']';
-		}
-
-		return res;
-	});
-};
-jsToolBar.prototype.elements.img_select.fn.xhtml = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.xhtml = function() {
-	var d = this.elements.img_select.data;
-	if (d.src == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		var alt = (str) ? str : d.title;
-		var res = '<img src="'+d.src+'" alt="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"';
-
-		if (d.alignment == 'left') {
-			res += ' style="float: left; margin: 0 1em 1em 0;"';
-		} else if (d.alignment == 'right') {
-			res += ' style="float: right; margin: 0 0 1em 1em;"';
-		} else if (d.alignment == 'center') {
-			res += ' style="margin: 0 auto; display: block;"';
-		}
-
-		if (d.description) {
-			res += ' title="'+d.description.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"';
-		}
-
-		res += ' />';
-
-		if (d.link) {
-			var ltitle = (alt) ? ' title="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"' : '';
-			res = '<a href="'+d.url+'"'+ltitle+'>'+res+'</a>';
-		}
-
-		return res;
-	});
-};
-
-jsToolBar.prototype.elements.img.fn.wysiwyg = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (!src) { return; }
-
-	var img = this.iwin.document.createElement('img');
-	img.src = src;
-	img.setAttribute('alt',this.getSelectedText());
-
-	this.insertNode(img);
-};
-
-jsToolBar.prototype.elements.img_select.fn.wysiwyg = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.wysiwyg = function() {
-	var d = this.elements.img_select.data;
-	var alt = (this.getSelectedText()) ? this.getSelectedText() : d.title;
-	if (d.src == undefined) { return; }
-
-	var img = this.iwin.document.createElement('img');
-	img.src = d.src;
-	img.setAttribute('alt',alt);
-
-
-	if (d.alignment == 'left') {
-		if (img.style.styleFloat != undefined) {
-			img.style.styleFloat = 'left';
-		} else {
-			img.style.cssFloat = 'left';
-		}
-		img.style.marginTop = 0;
-		img.style.marginRight = '1em';
-		img.style.marginBottom = '1em';
-		img.style.marginLeft = 0;
-	} else if (d.alignment == 'right') {
-		if (img.style.styleFloat != undefined) {
-			img.style.styleFloat = 'right';
-		} else {
-			img.style.cssFloat = 'right';
-		}
-		img.style.marginTop = 0;
-		img.style.marginRight = 0;
-		img.style.marginBottom = '1em';
-		img.style.marginLeft = '1em';
-	} else if (d.alignment == 'center') {
-		img.style.marginTop = 0;
-		img.style.marginRight = 'auto';
-		img.style.marginBottom = 0;
-		img.style.marginLeft = 'auto';
-		img.style.display = 'block';
-	}
-
-	if (d.description) {
-		img.setAttribute('title',d.description);
-	}
-
-	if (d.link) {
-		var a = this.iwin.document.createElement('a');
-		a.href = d.url;
-		if (alt) {
-			a.setAttribute('title',alt);
-		}
-		a.appendChild(img);
-		this.insertNode(a);
-	} else {
-		this.insertNode(img);
-	}
-};
-
-// MP3 helpers
-jsToolBar.prototype.elements.mp3_insert = { fncall: {}, data: {} };
-jsToolBar.prototype.elements.mp3_insert.fncall.wiki = function() {
-	var d = this.elements.mp3_insert.data;
-	if (d.player == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		return '\n///html\n' + d.player + '///\n';
-	});
-};
-jsToolBar.prototype.elements.mp3_insert.fncall.xhtml = function() {
-	var d = this.elements.mp3_insert.data;
-	if (d.player == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		return '\n' + d.player + '\n';
-	});
-};
-jsToolBar.prototype.elements.mp3_insert.fncall.wysiwyg = function() {
-	return;
-};
-
-// FLV helpers
-jsToolBar.prototype.elements.flv_insert = { fncall: {}, data: {} };
-jsToolBar.prototype.elements.flv_insert.fncall.wiki = function() {
-	var d = this.elements.flv_insert.data;
-	if (d.player == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		return '\n///html\n' + d.player + '///\n';
-	});
-};
-jsToolBar.prototype.elements.flv_insert.fncall.xhtml = function() {
-	var d = this.elements.flv_insert.data;
-	if (d.player == undefined) { return; }
-
-	this.encloseSelection('','',function(str) {
-		return '\n' + d.player + '\n';
-	});
-};
-jsToolBar.prototype.elements.flv_insert.fncall.wysiwyg = function() {
-	return;
-};
-
-
-/* Posts selector
--------------------------------------------------------- */
-jsToolBar.prototype.elements.post_link = {
-	type: 'button',
-	title: 'Link to an entry',
-	fn: {},
-	open_url: 'popup_posts.php',
-	data: {},
-	popup: function() {
-		window.the_toolbar = this;
-		this.elements.img_select.data = {};
-
-		var p_win = window.open(this.elements.post_link.open_url,'dc_popup',
-		'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+
-		'menubar=no,resizable=yes,scrollbars=yes,status=no');
-	}
-};
-jsToolBar.prototype.elements.post_link.fn.wiki = function() {
-	this.elements.post_link.popup.call(this);
-};
-jsToolBar.prototype.elements.post_link.fn.xhtml = function() {
-	this.elements.post_link.popup.call(this);
-};
-jsToolBar.prototype.elements.post_link.fn.wysiwyg = function() {
-	this.elements.post_link.popup.call(this);
-};
-
-// Last space element
-jsToolBar.prototype.elements.space3 = {
-	type:'space',
-	format:{
-		wysiwyg:true,
-		wiki:true,
-		xhtml:true
-	}
-};
Index: admin/js/jsToolBar/jsToolBar.js
===================================================================
--- admin/js/jsToolBar/jsToolBar.js	(revision 2566)
+++ 	(revision )
@@ -1,612 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * This file is part of DotClear.
- * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
- * rights reserved.
- *
- * DotClear 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 2 of the License, or
- * (at your option) any later version.
- *
- * DotClear 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 DotClear; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ***** END LICENSE BLOCK *****
-*/
-
-function jsToolBar(textarea) {
-	if (!document.createElement) { return; }
-
-	if (!textarea) { return; }
-
-	if ((typeof(document["selection"]) == "undefined")
-	&& (typeof(textarea["setSelectionRange"]) == "undefined")) {
-		return;
-	}
-
-	this.textarea = textarea;
-
-	this.editor = document.createElement('div');
-	this.editor.className = 'jstEditor';
-
-	this.textarea.parentNode.insertBefore(this.editor,this.textarea);
-	this.editor.appendChild(this.textarea);
-
-	this.toolbar = document.createElement("div");
-	this.toolbar.className = 'jstElements';
-	this.editor.parentNode.insertBefore(this.toolbar,this.editor);
-
-	// Dragable resizing (only for gecko)
-	if (navigator.appName == 'Microsoft Internet Explorer')
-	{
-		if (this.editor.addEventListener)
-		{
-			this.handle = document.createElement('div');
-			this.handle.className = 'jstHandle';
-			var dragStart = this.resizeDragStart;
-			var This = this;
-			this.handle.addEventListener('mousedown',function(event) { dragStart.call(This,event); },false);
-			this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling);
-		}
-	}
-
-	this.context = null;
-	this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni
-					// de raccourcis vers les éléments DOM correspondants aux outils.
-};
-
-function jsButton(title, fn, scope, className) {
-	this.title = title || null;
-	this.fn = fn || function(){};
-	this.scope = scope || null;
-	this.className = className || null;
-};
-jsButton.prototype.draw = function() {
-	if (!this.scope) return null;
-
-	var button = document.createElement('button');
-	button.setAttribute('type','button');
-	if (this.className) button.className = this.className;
-	button.title = this.title;
-	var span = document.createElement('span');
-	span.appendChild(document.createTextNode(this.title));
-	button.appendChild(span);
-
-	if (this.icon != undefined) {
-		button.style.backgroundImage = 'url('+this.icon+')';
-	}
-	if (typeof(this.fn) == 'function') {
-		var This = this;
-		button.onclick = function() { try { This.fn.apply(This.scope, arguments) } catch (e) {} return false; };
-	}
-	return button;
-};
-
-function jsSpace(id) {
-	this.id = id || null;
-	this.width = null;
-};
-jsSpace.prototype.draw = function() {
-	var span = document.createElement('span');
-	if (this.id) span.id = this.id;
-	span.appendChild(document.createTextNode(String.fromCharCode(160)));
-	span.className = 'jstSpacer';
-	if (this.width) span.style.marginRight = this.width+'px';
-
-	return span;
-};
-
-function jsCombo(title, options, scope, fn, className) {
-	this.title = title || null;
-	this.options = options || null;
-	this.scope = scope || null;
-	this.fn = fn || function(){};
-	this.className = className || null;
-};
-jsCombo.prototype.draw = function() {
-	if (!this.scope || !this.options) return null;
-
-	var select = document.createElement('select');
-	if (this.className) select.className = className;
-	select.title = this.title;
-
-	for (var o in this.options) {
-		//var opt = this.options[o];
-		var option = document.createElement('option');
-		option.value = o;
-		option.appendChild(document.createTextNode(this.options[o]));
-		select.appendChild(option);
-	}
-
-	var This = this;
-	select.onchange = function() {
-		try {
-			This.fn.call(This.scope, this.value);
-		} catch (e) { alert(e); }
-
-		return false;
-	};
-
-	return select;
-};
-
-
-jsToolBar.prototype = {
-	base_url: '',
-	mode: 'xhtml',
-	elements: {},
-
-	getMode: function() {
-		return this.mode;
-	},
-
-	setMode: function(mode) {
-		this.mode = mode || 'xhtml';
-	},
-
-	switchMode: function(mode) {
-		mode = mode || 'xhtml';
-		this.draw(mode);
-	},
-
-	button: function(toolName) {
-		var tool = this.elements[toolName];
-		if (typeof tool.fn[this.mode] != 'function') return null;
-		var b = new jsButton(tool.title, tool.fn[this.mode], this, 'jstb_'+toolName);
-		if (tool.icon != undefined) {
-			b.icon = tool.icon;
-		}
-		return b;
-	},
-	space: function(toolName) {
-		var tool = new jsSpace(toolName);
-		if (this.elements[toolName].format != undefined && !this.elements[toolName].format[this.mode]) return null;
-		if (this.elements[toolName].width !== undefined) {
-			tool.width = this.elements[toolName].width;
-		}
-		return tool;
-	},
-	combo: function(toolName) {
-		var tool = this.elements[toolName];
-
-		if( tool[this.mode] != undefined) {
-
-			var length = tool[this.mode].list.length;
-
-			if (typeof tool[this.mode].fn != 'function' || length == 0) {
-				return null;
-			} else {
-				var options = {};
-				for (var i=0; i < length; i++) {
-					var opt = tool[this.mode].list[i];
-					options[opt] = tool.options[opt];
-				}
-				return new jsCombo(tool.title, options, this, tool[this.mode].fn);
-			}
-
-		}
-
-	},
-	draw: function(mode) {
-		this.setMode(mode);
-
-		// Empty toolbar
-		while (this.toolbar.hasChildNodes()) {
-			this.toolbar.removeChild(this.toolbar.firstChild)
-		}
-		this.toolNodes = {}; // vide les raccourcis DOM/**/
-
-		// Draw toolbar elements
-		var b, tool, newTool;
-
-		for (var i in this.elements) {
-			b = this.elements[i];
-
-			var disabled =
-			b.type == undefined || b.type == ''
-			|| (b.disabled != undefined && b.disabled)
-			|| (b.context != undefined && b.context != null && b.context != this.context);
-
-			if (!disabled && typeof this[b.type] == 'function') {
-				tool = this[b.type](i);
-				if (tool) newTool = tool.draw();
-				if (newTool) {
-					this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur
-					this.toolbar.appendChild(newTool);
-				}
-			}
-		}
-	},
-
-	singleTag: function(stag,etag) {
-		stag = stag || null;
-		etag = etag || stag;
-
-		if (!stag || !etag) { return; }
-
-		this.encloseSelection(stag,etag);
-	},
-
-	encloseSelection: function(prefix, suffix, fn) {
-		this.textarea.focus();
-
-		prefix = prefix || '';
-		suffix = suffix || '';
-
-		var start, end, sel, scrollPos, subst, res;
-
-		if (typeof(document["selection"]) != "undefined") {
-			sel = document.selection.createRange().text;
-		} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
-			start = this.textarea.selectionStart;
-			end = this.textarea.selectionEnd;
-			scrollPos = this.textarea.scrollTop;
-			sel = this.textarea.value.substring(start, end);
-		}
-
-		if (sel.match(/ $/)) { // exclude ending space char, if any
-			sel = sel.substring(0, sel.length - 1);
-			suffix = suffix + " ";
-		}
-
-		if (typeof(fn) == 'function') {
-			res = (sel) ? fn.call(this,sel) : fn('');
-		} else {
-			res = (sel) ? sel : '';
-		}
-
-		subst = prefix + res + suffix;
-
-		if (typeof(document["selection"]) != "undefined") {
-			var range = document.selection.createRange().text = subst;
-			this.textarea.caretPos -= suffix.length;
-		} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
-			this.textarea.value = this.textarea.value.substring(0, start) + subst +
-			this.textarea.value.substring(end);
-			if (sel) {
-				this.textarea.setSelectionRange(start + subst.length, start + subst.length);
-			} else {
-				this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);
-			}
-			this.textarea.scrollTop = scrollPos;
-		}
-	},
-
-	stripBaseURL: function(url) {
-		if (this.base_url != '') {
-			var pos = url.indexOf(this.base_url);
-			if (pos == 0) {
-				url = url.substr(this.base_url.length);
-			}
-		}
-
-		return url;
-	}
-};
-
-/** Resizer
--------------------------------------------------------- */
-jsToolBar.prototype.resizeSetStartH = function() {
-	this.dragStartH = this.textarea.offsetHeight + 0;
-};
-jsToolBar.prototype.resizeDragStart = function(event) {
-	var This = this;
-	this.dragStartY = event.clientY;
-	this.resizeSetStartH();
-	document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false);
-	document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false);
-};
-
-jsToolBar.prototype.resizeDragMove = function(event) {
-	this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px';
-};
-
-jsToolBar.prototype.resizeDragStop = function(event) {
-	document.removeEventListener('mousemove', this.dragMoveHdlr, false);
-	document.removeEventListener('mouseup', this.dragStopHdlr, false);
-};
-
-// Elements definition ------------------------------------
-// block format (paragraph, headers)
-jsToolBar.prototype.elements.blocks = {
-	type: 'combo',
-	title: 'block format',
-	options: {
-		none: '-- none --', // only for wysiwyg mode
-		nonebis: '- block format -', // only for xhtml mode
-		p: 'Paragraph',
-		h1: 'Header 1',
-		h2: 'Header 2',
-		h3: 'Header 3',
-		h4: 'Header 4',
-		h5: 'Header 5',
-		h6: 'Header 6'
-	},
-	xhtml: {
-		list: ['nonebis','p','h1','h2','h3','h4','h5','h6'],
-		fn: function(opt) {
-			if (opt=='nonebis')
-				this.textarea.focus();
-			else
-				try {this.singleTag('<'+opt+'>','</'+opt+'>');} catch(e){};
-			this.toolNodes.blocks.value = 'nonebis';
-		}
-	},
-	wiki: {
-		list: ['nonebis','h3','h4','h5'],
-		fn: function(opt) {
-			switch (opt) {
-				case 'nonebis': this.textarea.focus(); break;
-				case 'h3': this.encloseSelection('!!!'); break;
-				case 'h4': this.encloseSelection('!!'); break;
-				case 'h5': this.encloseSelection('!'); break;
-			}
-			this.toolNodes.blocks.value = 'nonebis';
-		}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space0 = {
-	type:'space',
-	format:{
-		wysiwyg:true,
-		wiki:true,
-		xhtml:true
-	}
-};
-
-// strong
-jsToolBar.prototype.elements.strong = {
-	type: 'button',
-	title: 'Strong emphasis',
-	fn: {
-		wiki: function() { this.singleTag('__') },
-		xhtml: function() { this.singleTag('<strong>','</strong>') }
-	}
-};
-
-// em
-jsToolBar.prototype.elements.em = {
-	type: 'button',
-	title: 'Emphasis',
-	fn: {
-		wiki: function() { this.singleTag("''") },
-		xhtml: function() { this.singleTag('<em>','</em>') }
-	}
-};
-
-// ins
-jsToolBar.prototype.elements.ins = {
-	type: 'button',
-	title: 'Inserted',
-	fn: {
-		wiki: function() { this.singleTag('++') },
-		xhtml: function() { this.singleTag('<ins>','</ins>') }
-	}
-};
-
-// del
-jsToolBar.prototype.elements.del = {
-	type: 'button',
-	title: 'Deleted',
-	fn: {
-		wiki: function() { this.singleTag('--') },
-		xhtml: function() { this.singleTag('<del>','</del>') }
-	}
-};
-
-// quote
-jsToolBar.prototype.elements.quote = {
-	type: 'button',
-	title: 'Inline quote',
-	fn: {
-		wiki: function() { this.singleTag('{{','}}') },
-		xhtml: function() { this.singleTag('<q>','</q>') }
-	}
-};
-
-// code
-jsToolBar.prototype.elements.code = {
-	type: 'button',
-	title: 'Code',
-	fn: {
-		wiki: function() { this.singleTag('@@') },
-		xhtml: function() { this.singleTag('<code>','</code>')}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space1 = {
-	type:'space',
-	format:{
-		wysiwyg:true,
-		wiki:true,
-		xhtml:true
-	}
-};
-
-// br
-jsToolBar.prototype.elements.br = {
-	type: 'button',
-	title: 'Line break',
-	fn: {
-		wiki: function() { this.encloseSelection("%%%\n",'') },
-		xhtml: function() { this.encloseSelection("<br />\n",'')}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space2 = {
-	type:'space',
-	format:{
-		wysiwyg:true,
-		wiki:true,
-		xhtml:true
-	}
-};
-
-// blockquote
-jsToolBar.prototype.elements.blockquote = {
-	type: 'button',
-	title: 'Blockquote',
-	fn: {
-		xhtml: function() { this.singleTag('<blockquote>','</blockquote>') },
-		wiki: function() {
-			this.encloseSelection("\n",'',
-			function(str) {
-				str = str.replace(/\r/g,'');
-				return '> '+str.replace(/\n/g,"\n> ");
-			});
-		}
-	}
-};
-
-// pre
-jsToolBar.prototype.elements.pre = {
-	type: 'button',
-	title: 'Preformated text',
-	fn: {
-		wiki: function() { this.singleTag("///\n","\n///") },
-		xhtml: function() { this.singleTag('<pre>','</pre>') }
-	}
-};
-
-// ul
-jsToolBar.prototype.elements.ul = {
-	type: 'button',
-	title: 'Unordered list',
-	fn: {
-		wiki: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				return '* '+str.replace(/\n/g,"\n* ");
-			});
-		},
-		xhtml: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				str = str.replace(/\n/g,"</li>\n <li>");
-				return "<ul>\n <li>"+str+"</li>\n</ul>";
-			});
-		}
-	}
-};
-
-// ol
-jsToolBar.prototype.elements.ol = {
-	type: 'button',
-	title: 'Ordered list',
-	fn: {
-		wiki: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				return '# '+str.replace(/\n/g,"\n# ");
-			});
-		},
-		xhtml: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				str = str.replace(/\n/g,"</li>\n <li>");
-				return "<ol>\n <li>"+str+"</li>\n</ol>";
-			});
-		}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space3 = {
-	type:'space',
-	format:{
-		wysiwyg:true,
-		wiki:true,
-		xhtml:true
-	}
-};
-
-// link
-jsToolBar.prototype.elements.link = {
-	type: 'button',
-	title: 'Link',
-	fn: {},
-	href_prompt: 'Please give page URL:',
-	hreflang_prompt: 'Language of this page:',
-	default_hreflang: '',
-	prompt: function(href,hreflang) {
-		href = href || '';
-		hreflang = hreflang || this.elements.link.default_hreflang;
-
-		href = window.prompt(this.elements.link.href_prompt,href);
-		if (!href) { return false; }
-
-		hreflang = window.prompt(this.elements.link.hreflang_prompt,
-		hreflang);
-
-		return { href: this.stripBaseURL(href), hreflang: hreflang };
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.xhtml = function() {
-	var link = this.elements.link.prompt.call(this);
-	if (link) {
-		var stag = '<a href="'+link.href+'"';
-		if (link.hreflang) { stag = stag+' hreflang="'+link.hreflang+'"'; }
-		stag = stag+'>';
-		var etag = '</a>';
-
-		this.encloseSelection(stag,etag);
-	}
-};
-jsToolBar.prototype.elements.link.fn.wiki = function() {
-	var link = this.elements.link.prompt.call(this);
-	if (link) {
-		var stag = '[';
-		var etag = '|'+link.href;
-		if (link.hreflang) { etag = etag+'|'+link.hreflang; }
-		etag = etag+']';
-
-		this.encloseSelection(stag,etag);
-	}
-};
-
-// img
-jsToolBar.prototype.elements.img = {
-		type: 'button',
-		title: 'External image',
-		src_prompt: 'Please give image URL:',
-		fn: {},
-		prompt: function(src) {
-			src = src || '';
-			return this.stripBaseURL(window.prompt(this.elements.img.src_prompt,src));
-		}
-};
-jsToolBar.prototype.elements.img.fn.xhtml = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (src) {
-		this.encloseSelection('','',function(str) {
-			if (str) {
-				return '<img src="'+src+'" alt="'+str+'" />';
-			} else {
-				return '<img src="'+src+'" alt="" />';
-			}
-		});
-	}
-};
-jsToolBar.prototype.elements.img.fn.wiki = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (src) {
-		this.encloseSelection('','',function(str) {
-			if (str) {
-				return '(('+src+'|'+str+'))';
-			} else {
-				return '(('+src+'))';
-			}
-		});
-	}
-};
Index: admin/js/jsToolBar/jsToolBar.wysiwyg.js
===================================================================
--- admin/js/jsToolBar/jsToolBar.wysiwyg.js	(revision 2589)
+++ 	(revision )
@@ -1,801 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * This file is part of DotClear.
- * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
- * rights reserved.
- *
- * DotClear 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 2 of the License, or
- * (at your option) any later version.
- *
- * DotClear 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 DotClear; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ***** END LICENSE BLOCK *****
-*/
-
-jsToolBar.prototype.can_wwg = (document.designMode != undefined);
-jsToolBar.prototype.iframe = null;
-jsToolBar.prototype.iwin = null;
-jsToolBar.prototype.ibody = null;
-jsToolBar.prototype.iframe_css = null;
-
-/* Editor methods
--------------------------------------------------------- */
-jsToolBar.prototype.drawToolBar = jsToolBar.prototype.draw;
-jsToolBar.prototype.draw = function(mode) {
-	mode = mode || 'xhtml';
-
-	if (this.can_wwg) {
-		this.mode = 'wysiwyg';
-		this.drawToolBar('wysiwyg');
-		this.initWindow();
-	} else {
-		this.drawToolBar(mode);
-	}
-};
-
-jsToolBar.prototype.switchMode = function(mode) {
-	mode = mode || 'xhtml';
-
-	if (mode == 'xhtml') {
-		this.wwg_mode = true;
-		this.draw(mode);
-	} else {
-		if (this.wwg_mode) {
-			this.syncContents('iframe');
-		}
-		this.wwg_mode = false;
-		this.removeEditor();
-		this.textarea.style.display = '';
-		this.drawToolBar(mode);
-	}
-};
-
-jsToolBar.prototype.syncContents = function(from) {
-	from = from || 'textarea';
-	var This = this;
-	if (from == 'textarea') {
-		initContent();
-	} else {
-		this.validBlockquote();
-		var html = this.applyHtmlFilters(this.ibody.innerHTML);
-		if (html == '<br />') { html = '<p></p>'; }
-		this.textarea.value = html;
-	}
-
-	function initContent() {
-		if (!This.iframe.contentWindow.document || !This.iframe.contentWindow.document.body) {
-			setTimeout(initContent, 1);
-			return;
-		}
-		This.ibody = This.iframe.contentWindow.document.body;
-
-		if (This.textarea.value != '' && This.textarea.value != '<p></p>') {
-			This.ibody.innerHTML = This.applyWysiwygFilters(This.textarea.value);
-			if (This.ibody.createTextRange) { //cursor at the begin for IE
-				var IErange = This.ibody.createTextRange();
-				IErange.execCommand("SelectAll");
-				IErange.collapse();
-				IErange.select();
-			}
-		} else {
-			var idoc = This.iwin.document;
-			var para = idoc.createElement('p');
-			para.appendChild(idoc.createElement('br'));
-			while (idoc.body.hasChildNodes()) {
-				idoc.body.removeChild(idoc.body.lastChild);
-			}
-			idoc.body.appendChild(para);
-		}
-	}
-};
-jsToolBar.prototype.htmlFilters = {
-	tagsoup: function(str){
-		return this.tagsoup2xhtml(str);
-	}
-};
-jsToolBar.prototype.applyHtmlFilters = function(str) {
-	for (var fn in this.htmlFilters) {
-		 str = this.htmlFilters[fn].call(this, str);
-	}
-	return str;
-};
-jsToolBar.prototype.wysiwygFilters = {};
-jsToolBar.prototype.applyWysiwygFilters = function( str) {
-	for (var fn in this.wysiwygFilters) {
-		 str = this.wysiwygFilters[fn].call(this, str);
-	}
-	return str;
-};
-
-jsToolBar.prototype.switchEdit = function() {
-	if (this.wwg_mode) {
-		this.textarea.style.display = '';
-		this.iframe.style.display = 'none';
-		this.syncContents('iframe');
-		this.drawToolBar('xhtml');
-		this.wwg_mode = false;
-		this.focusEditor();
-	} else {
-		this.iframe.style.display = '';
-		this.textarea.style.display = 'none';
-		this.syncContents('textarea');
-		this.drawToolBar('wysiwyg');
-		this.wwg_mode = true;
-		this.focusEditor();
-	}
-	this.setSwitcher();
-};
-
-/** Creates iframe for editor, inits a blank document
-*/
-jsToolBar.prototype.initWindow = function() {
-	var This = this;
-
-	this.iframe = document.createElement('iframe');
-	this.textarea.parentNode.insertBefore(this.iframe,this.textarea.nextSibling);
-
-	this.switcher = document.createElement('ul');
-	this.switcher.className = 'jstSwitcher';
-	this.editor.appendChild(this.switcher);
-
-	this.iframe.height = this.textarea.offsetHeight + 0;
-	this.iframe.width = this.textarea.offsetWidth + 0;
-
-	if (this.textarea.tabIndex != undefined) {
-		this.iframe.tabIndex = this.textarea.tabIndex;
-	}
-
-	function initIframe() {
-		var doc = This.iframe.contentWindow.document;
-		if (!doc) {
-			setTimeout(initIframe,1);
-			return false;
-		}
-
-		doc.open();
-		var html =
-		'<html>\n'+
-		'<head>\n'+
-		'<style type="text/css">'+This.iframe_css+'</style>\n'+
-		(This.base_url != '' ? '<base href="'+This.base_url+'" />' : '')+
-		'</head>\n'+
-		'<body>\n'+
-		'</body>\n'+
-		'</html>';
-
-		doc.write(html);
-		doc.close();
-		if (document.all) { // for IE
-			doc.designMode = 'on';
-			// warning : doc is now inaccessible for IE6 sp1
-		}
-
-		This.iwin = This.iframe.contentWindow;
-
-		This.syncContents('textarea');
-
-		if (This.wwg_mode == undefined) {
-			This.wwg_mode = true;
-		}
-
-		if (This.wwg_mode) {
-			This.textarea.style.display = 'none';
-		} else {
-			This.iframe.style.display = 'none';
-		}
-
-		// update textarea on submit
-		if (This.textarea.form) {
-			chainHandler(This.textarea.form,'onsubmit', function() {
-				if (This.wwg_mode) {
-					This.syncContents('iframe');
-				}
-			});
-		}
-
-		for (var evt in This.iwinEvents) {
-			var event = This.iwinEvents[evt];
-			This.addIwinEvent(This.iframe.contentWindow.document, event.type, event.fn, This);
-		}
-
-		This.setSwitcher();
-		try { This.iwin.document.designMode = 'on'; } catch (e) {}; // Firefox needs this
-
-		return true;
-	}
-	initIframe();
-};
-jsToolBar.prototype.addIwinEvent = function(target, type, fn, scope) {
-	var myFn = function(e){fn.call(scope, e)};
-	addEvent(target, type, myFn, true);
-	// fix memory leak
-	addEvent(scope.iwin, 'unload', function(){
-		removeEvent(target, type, myFn, true);
-	}, true);
-};
-jsToolBar.prototype.iwinEvents = {
-	block1: {
-		type: 'mouseup',
-		fn: function(){ this.adjustBlockLevelCombo() }
-	},
-	block2: {
-		type: 'keyup',
-		fn: function(){ this.adjustBlockLevelCombo() }
-	}
-};
-
-/** Insert a mode switcher after editor area
-*/
-jsToolBar.prototype.switcher_visual_title = 'visual';
-jsToolBar.prototype.switcher_source_title = 'source';
-jsToolBar.prototype.setSwitcher = function() {
-	while (this.switcher.hasChildNodes()) {
-		this.switcher.removeChild(this.switcher.firstChild);
-	}
-
-	var This = this;
-	function setLink(title,link) {
-		var li = document.createElement('li');
-		if (link) {
-			var a = document.createElement('a');
-			a.href = '#';
-			a.editor = This;
-			a.onclick = function() { this.editor.switchEdit(); return false; };
-			a.appendChild(document.createTextNode(title));
-		} else {
-			li.className = 'jstSwitcherCurrent';
-			a = document.createTextNode(title);
-		}
-
-		li.appendChild(a);
-		This.switcher.appendChild(li);
-	}
-
-	setLink(this.switcher_visual_title,!this.wwg_mode);
-	setLink(this.switcher_source_title,this.wwg_mode);
-};
-
-/** Removes editor area and mode switcher
-*/
-jsToolBar.prototype.removeEditor = function() {
-	if (this.iframe != null) {
-		this.iframe.parentNode.removeChild(this.iframe);
-		this.iframe = null;
-	}
-
-	if (this.switcher != undefined && this.switcher.parentNode != undefined) {
-		this.switcher.parentNode.removeChild(this.switcher);
-	}
-};
-
-/** Focus on the editor area
-*/
-jsToolBar.prototype.focusEditor = function() {
-	if (this.wwg_mode) {
-		try { this.iwin.document.designMode = 'on'; } catch (e) {}; // Firefox needs this
-		var This = this;
-		setTimeout(function() {This.iframe.contentWindow.focus()},1);
-	} else {
-		this.textarea.focus();
-	}
-};
-
-/** Resizer
-*/
-jsToolBar.prototype.resizeSetStartH = function() {
-	if (this.wwg_mode && this.iframe != undefined) {
-		this.dragStartH = this.iframe.offsetHeight;
-		return;
-	}
-	this.dragStartH = this.textarea.offsetHeight + 0;
-};
-jsToolBar.prototype.resizeDragMove = function(event) {
-	var new_height = (this.dragStartH+event.clientY-this.dragStartY)+'px';
-	if (this.iframe != undefined) {
-		this.iframe.style.height = new_height;
-	}
-	this.textarea.style.height = new_height;
-};
-
-/* Editing methods
--------------------------------------------------------- */
-/** Replaces current selection by given node
-*/
-jsToolBar.prototype.insertNode = function(node) {
-	var range;
-
-	if (this.iwin.getSelection) { // Gecko
-		var sel = this.iwin.getSelection();
-		range = sel.getRangeAt(0);
-
-		// deselect all ranges
-		sel.removeAllRanges();
-
-		// empty range
-		range.deleteContents();
-
-		// Insert node
-		range.insertNode(node);
-
-		range.selectNodeContents(node);
-		range.setEndAfter(node);
-		if (range.endContainer.childNodes.length > range.endOffset &&
-		range.endContainer.nodeType != Node.TEXT_NODE) {
-			range.setEnd(range.endContainer.childNodes[range.endOffset], 0);
-		} else {
-			range.setEnd(range.endContainer.childNodes[0]);
-		}
-		sel.addRange(range);
-
-		sel.collapseToEnd();
-	} else { // IE
-		// lambda element
-		var p = this.iwin.document.createElement('div');
-		p.appendChild(node);
-		range = this.iwin.document.selection.createRange();
-		range.execCommand('delete');
-		// insert innerHTML from element
-		range.pasteHTML(p.innerHTML);
-		range.collapse(false);
-		range.select();
-	}
-	this.iwin.focus();
-};
-
-/** Returns a document fragment with selected nodes
-*/
-jsToolBar.prototype.getSelectedNode = function() {
-	if (this.iwin.getSelection) { // Gecko
-		var sel = this.iwin.getSelection();
-		var range = sel.getRangeAt(0);
-		var content = range.cloneContents();
-	} else { // IE
-		var sel = this.iwin.document.selection;
-		var d = this.iwin.document.createElement('div');
-		d.innerHTML = sel.createRange().htmlText;
-		var content = this.iwin.document.createDocumentFragment();
-		for (var i=0; i < d.childNodes.length; i++) {
-			content.appendChild(d.childNodes[i].cloneNode(true));
-		}
-	}
-	return content;
-};
-
-/** Returns string representation for selected node
-*/
-jsToolBar.prototype.getSelectedText = function() {
-	if (this.iwin.getSelection) { // Gecko
-		return this.iwin.getSelection().toString();
-	} else { // IE
-		var range = this.iwin.document.selection.createRange();
-		return range.text;
-	}
-};
-
-jsToolBar.prototype.replaceNodeByContent = function(node) {
-	var content = this.iwin.document.createDocumentFragment();
-	for (var i=0; i < node.childNodes.length; i++) {
-		content.appendChild(node.childNodes[i].cloneNode(true));
-	}
-	node.parentNode.replaceChild(content, node);
-};
-
-jsToolBar.prototype.getBlockLevel = function() {
-	var blockElts = ['p','h1','h2','h3','h4','h5','h6'];
-
-	var range, commonAncestorContainer;
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (arrayIndexOf(blockElts, ancestorTagName)==-1 && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-	if (ancestorTagName == 'body') return null;
-	else return commonAncestorContainer;
-};
-jsToolBar.prototype.adjustBlockLevelCombo = function() {
-	var blockLevel = this.getBlockLevel();
-	if (blockLevel !== null)
-		this.toolNodes.blocks.value = blockLevel.tagName.toLowerCase();
-	else {
-		if (this.mode == 'wysiwyg') this.toolNodes.blocks.value = 'none';
-		if (this.mode == 'xhtml') this.toolNodes.blocks.value = 'nonebis';
-	}
-};
-
-/** HTML code cleanup
--------------------------------------------------------- */
-jsToolBar.prototype.simpleCleanRegex = new Array(
-	/* Remove every tags we don't need */
-	[/<meta[\w\W]*?>/gim,''],
-	[/<style[\w\W]*?>[\w\W]*?<\/style>/gim, ''],
-	[/<\/?font[\w\W]*?>/gim, ''],
-
-
-	/* Replacements */
-	[/<(\/?)(B|b|STRONG)([\s>\/])/g, "<$1strong$3"],
-	[/<(\/?)(I|i|EM)([\s>\/])/g, "<$1em$3"],
-	[/<IMG ([^>]*?[^\/])>/gi, "<img $1 />"],
-	[/<INPUT ([^>]*?[^\/])>/gi, "<input $1 />"],
-	[/<COL ([^>]*?[^\/])>/gi, "<col $1 />"],
-	[/<AREA ([^>]*?[^\/])>/gi, "<area $1 />"],
-	[/<PARAM ([^>]*?[^\/])>/gi, "<param $1 />"],
-	[/<HR ([^>]*?[^\/])>/gi, "<hr $1/>"],
-	[/<BR ([^>]*?[^\/])>/gi, "<br $1/>"],
-	[/<(\/?)U([\s>\/])/gi, "<$1ins$2"],
-	[/<(\/?)STRIKE([\s>\/])/gi, "<$1del$2"],
-	[/<span style="font-weight: normal;">([\w\W]*?)<\/span>/gm, "$1"],
-	[/<span style="font-weight: bold;">([\w\W]*?)<\/span>/gm, "<strong>$1</strong>"],
-	[/<span style="font-style: italic;">([\w\W]*?)<\/span>/gm, "<em>$1</em>"],
-	[/<span style="text-decoration: underline;">([\w\W]*?)<\/span>/gm, "<ins>$1</ins>"],
-	[/<span style="text-decoration: line-through;">([\w\W]*?)<\/span>/gm, "<del>$1</del>"],
-	[/<span style="text-decoration: underline line-through;">([\w\W]*?)<\/span>/gm, "<del><ins>$1</ins></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?){2}">([\w\W]*?)<\/span>/gm, "<strong><em>$2</em></strong>"],
-	[/<span style="(font-weight: bold; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/span>/gm, "<ins><strong>$2</strong></ins>"],
-	[/<span style="(font-weight: italic; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/span>/gm, "<ins><em>$2</em></ins>"],
-	[/<span style="(font-weight: bold; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/span>/gm, "<del><strong>$2</strong></del>"],
-	[/<span style="(font-weight: italic; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/span>/gm, "<del><em>$2</em></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline; ?){3}">([\w\W]*?)<\/span>/gm, "<ins><strong><em>$2</em></strong></ins>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: line-through; ?){3}">([\w\W]*?)<\/span>/gm, "<del><strong><em>$2</em></strong></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline line-through; ?){3}">([\w\W]*?)<\/span>/gm, "<del><ins><strong><em>$2</em></strong></ins></del>"],
-	[/<strong style="font-weight: normal;">([\w\W]*?)<\/strong>/gm, "$1"],
-	[/<([a-z]+) style="font-weight: normal;">([\w\W]*?)<\/\1>/gm, "<$1>$2</$1>"],
-	[/<([a-z]+) style="font-weight: bold;">([\w\W]*?)<\/\1>/gm, "<$1><strong>$2</strong></$1>"],
-	[/<([a-z]+) style="font-style: italic;">([\w\W]*?)<\/\1>/gm, "<$1><em>$2</em></$1>"],
-	[/<([a-z]+) style="text-decoration: underline;">([\w\W]*?)<\/\1>/gm, "<ins><$1>$2</$1></ins>"],
-	[/<([a-z]+) style="text-decoration: line-through;">([\w\W]*?)<\/\1>/gm, "<del><$1>$2</$1></del>"],
-	[/<([a-z]+) style="text-decoration: underline line-through;">([\w\W]*?)<\/\1>/gm, "<del><ins><$1>$2</$1></ins></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?){2}">([\w\W]*?)<\/\1>/gm, "<$1><strong><em>$3</em></strong></$1>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/\1>/gm, "<ins><$1><strong>$3</strong></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: italic; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/\1>/gm, "<ins><$1><em>$3</em></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/\1>/gm, "<del><$1><strong>$3</strong></$1></del>"],
-	[/<([a-z]+) style="(font-weight: italic; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/\1>/gm, "<del><$1><em>$3</em></$1></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline; ?){3}">([\w\W]*?)<\/\1>/gm, "<ins><$1><strong><em>$3</em></strong></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: line-through; ?){3}">([\w\W]*?)<\/\1>/gm, "<del><$1><strong><em>$3</em></strong></$1></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline line-through; ?){3}">([\w\W]*?)<\/\1>/gm, "<del><ins><$1><strong><em>$3</em></strong></$1></ins></del>"],
-	[/<p><blockquote>(.*)(\n)+<\/blockquote><\/p>/i,"<blockquote>$1</blockquote>\n"],
-	/* mise en forme identique contigue */
-	[/<\/(strong|em|ins|del|q|code)>(\s*?)<\1>/gim, "$2"],
-	[/<(br|BR)>/g, "<br />"],
-	[/<(hr|HR)>/g, "<hr />"],
-	/* opera est trop strict ;)) */
-	[/([^\s])\/>/g, "$1 />"],
-	/* br intempestifs de fin de block */
-	[/<br \/>\s*<\/(h1|h2|h3|h4|h5|h6|ul|ol|li|p|blockquote|div)/gi, "</$1"],
-	[/<\/(h1|h2|h3|h4|h5|h6|ul|ol|li|p|blockquote)>([^\n\u000B\r\f])/gi, "</$1>\n$2"],
-	[/<hr style="width: 100%; height: 2px;" \/>/g, "<hr />"]
-);
-
-/** Cleanup HTML code
-*/
-jsToolBar.prototype.tagsoup2xhtml = function(html) {
-	for (var reg in this.simpleCleanRegex) {
-		html = html.replace(this.simpleCleanRegex[reg][0], this.simpleCleanRegex[reg][1]);
-	}
-	/* tags vides */
-	/* note : on tente de ne pas tenir compte des commentaires html, ceux-ci
-	   permettent entre autre d'inserer des commentaires conditionnels pour ie */
-	while ( /(<[^\/!]>|<[^\/!][^>]*[^\/]>)\s*<\/[^>]*[^-]>/.test(html) ) {
-		html = html.replace(/(<[^\/!]>|<[^\/!][^>]*[^\/]>)\s*<\/[^>]*[^-]>/g, "");
-	}
-
-	/* tous les tags en minuscule */
-	html = html.replace(/<(\/?)([A-Z0-9]+)/g,
-			function(match0, match1, match2) {
-				return "<" + match1 + match2.toLowerCase();
-			});
-
-	/* IE laisse souvent des attributs sans guillemets */
-	var myRegexp = /<[^>]+((\s+\w+\s*=\s*)([^"'][\w~@+$,%\/:.#?=&;!*()-]*))[^>]*?>/;
-	while ( myRegexp.test(html)) {
-		html = html.replace(
-			myRegexp,
-			function (str, val1, val2, val3){
-				var tamponRegex = new RegExp(regexpEscape(val1));
-				return str.replace(tamponRegex, val2+'"'+val3+'"');
-			}
-		)
-	}
-
-	/* les navigateurs rajoutent une unite aux longueurs css nulles */
-	/* note: a ameliorer ! */
-	while ( /(<[^>]+style=(["'])[^>]+[\s:]+)0(pt|px)(\2|\s|;)/.test(html)) {
-		html = html.replace(/(<[^>]+style=(["'])[^>]+[\s:]+)0(pt|px)(\2|\s|;)/gi, "$1"+"0$4");
-	}
-
-	/* correction des fins de lignes : le textarea edite contient des \n
-	* le wysiwyg des \r\n , et le textarea mis a jour SANS etre affiche des \r\n ! */
-	html = html.replace(/\r\n/g,"\n");
-
-	/* Trim only if there's no pre tag */
-	pattern_pre = /<pre>[\s\S]*<\/pre>/gi;
-	if (!pattern_pre.test(html)) {
-		html = html.replace(/^\s+/gm,'');
-		html = html.replace(/\s+$/gm,'');
-	}
-
-	return html;
-};
-jsToolBar.prototype.validBlockquote = function() {
-	var blockElts = ['address','blockquote','dl','div','fieldset','form','h1',
-	                 'h2','h3','h4','h5','h6','hr','ol','p','pre','table','ul'];
-	var BQs = this.iwin.document.getElementsByTagName('blockquote');
-	var bqChilds;
-
-	for (var bq = 0; bq < BQs.length; bq++) {
-		bqChilds = BQs[bq].childNodes;
-		var frag = this.iwin.document.createDocumentFragment();
-		for (var i = (bqChilds.length-1); i >= 0; i--) {
-			if (bqChilds[i].nodeType == 1 && // Node.ELEMENT_NODE
-			    arrayIndexOf(blockElts, bqChilds[i].tagName.toLowerCase()) >= 0)
-			{
-				if (frag.childNodes.length > 0) {
-					var p = this.iwin.document.createElement('p');
-					p.appendChild(frag);
-					BQs[bq].replaceChild(p, bqChilds[i+1]);
-					frag = this.iwin.document.createDocumentFragment();
-				}
-			} else {
-				if (frag.childNodes.length > 0) BQs[bq].removeChild(bqChilds[i+1]);
-				frag.insertBefore(bqChilds[i].cloneNode(true), frag.firstChild);
-			}
-		}
-		if (frag.childNodes.length > 0) {
-			var p = this.iwin.document.createElement('p');
-			p.appendChild(frag);
-			BQs[bq].replaceChild(p, bqChilds[0]);
-		}
-	}
-};
-
-/* Removing text formating */
-jsToolBar.prototype.removeFormatRegexp = new Array(
-	[/(<[a-z][^>]*)margin\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-bottom\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-left\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-right\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-top\s*:[^;]*;/mg, "$1"],
-
-	[/(<[a-z][^>]*)padding\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-bottom\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-left\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-right\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-top\s*:[^;]*;/mg, "$1"],
-
-	[/(<[a-z][^>]*)font\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-family\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-size\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-style\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-variant\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-weight\s*:[^;]*;/mg, "$1"],
-
-	[/(<[a-z][^>]*)color\s*:[^;]*;/mg, "$1"]
-);
-
-jsToolBar.prototype.removeTextFormating = function(html) {
-	for (var reg in this.removeFormatRegexp) {
-		html = html.replace(this.removeFormatRegexp[reg][0], this.removeFormatRegexp[reg][1]);
-	}
-
-	html = this.tagsoup2xhtml(html);
-	html = html.replace(/style="\s*?"/mgi,'');
-	return html;
-};
-
-/** Toolbar elements
--------------------------------------------------------- */
-jsToolBar.prototype.elements.blocks.wysiwyg = {
-	list: ['none','p','h1','h2','h3','h4','h5','h6'],
-	fn: function(opt) {
-		if (opt=='none') {
-			var blockLevel = this.getBlockLevel();
-			if (blockLevel !== null) {
-				this.replaceNodeByContent(blockLevel);
-			}
-			this.iwin.focus();
-		} else {
-			try { this.iwin.document.execCommand('formatblock',false,'<'+opt+'>');
-			} catch(e){};
-			this.iwin.focus();
-		}
-	}
-};
-
-jsToolBar.prototype.elements.strong.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('bold', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.em.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('italic', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ins.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('underline', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.del.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('strikethrough', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.quote.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var q = this.iwin.document.createElement('q');
-	q.appendChild(n);
-	this.insertNode(q);
-};
-
-jsToolBar.prototype.elements.code.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var code = this.iwin.document.createElement('code');
-	code.appendChild(n);
-	this.insertNode(code);
-};
-
-jsToolBar.prototype.elements.br.fn.wysiwyg = function() {
-	var n = this.iwin.document.createElement('br');
-	this.insertNode(n);
-};
-
-jsToolBar.prototype.elements.blockquote.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var q = this.iwin.document.createElement('blockquote');
-	q.appendChild(n);
-	this.insertNode(q);
-};
-
-jsToolBar.prototype.elements.pre.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('formatblock',false,'<pre>');
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ul.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('insertunorderedlist',false,null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ol.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('insertorderedlist',false,null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.link.fn.wysiwyg = function() {
-	var href, hreflang;
-	var range, commonAncestorContainer;
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (ancestorTagName!='a' && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-
-	// Update or remove link?
-	if (ancestorTagName == 'a') {
-		href = commonAncestorContainer.href || '';
-		hreflang = commonAncestorContainer.hreflang || '';
-	}
-
-	href = window.prompt(this.elements.link.href_prompt,href);
-
-	// Remove link
-	if (ancestorTagName == 'a' && href=='') {
-		this.replaceNodeByContent(commonAncestorContainer);
-	}
-	if (!href) return; // user cancel
-
-	hreflang = window.prompt(this.elements.link.hreflang_prompt, hreflang);
-
-	// Update link
-	if (ancestorTagName == 'a' && href) {
-		commonAncestorContainer.setAttribute('href', href);
-		if (hreflang) {
-			commonAncestorContainer.setAttribute('hreflang', hreflang);
-		} else {
-			commonAncestorContainer.removeAttribute('hreflang');
-		}
-		return;
-	}
-
-	// Create link
-	var n = this.getSelectedNode();
-	var a = this.iwin.document.createElement('a');
-	a.href = href;
-	if (hreflang) a.setAttribute('hreflang',hreflang);
-	a.appendChild(n);
-	this.insertNode(a);
-};
-
-
-
-// Remove format and Toggle
-jsToolBar.prototype.elements.removeFormat = {
-	type: 'button',
-	title: 'Remove text formating',
-	fn: {}
-};
-jsToolBar.prototype.elements.removeFormat.disabled = !jsToolBar.prototype.can_wwg;
-jsToolBar.prototype.elements.removeFormat.fn.xhtml = function() {
-	var html = this.textarea.value;
-	html = this.removeTextFormating(html);
-	this.textarea.value = html;
-};
-jsToolBar.prototype.elements.removeFormat.fn.wysiwyg = function() {
-	var html = this.iwin.document.body.innerHTML;
-	html = this.removeTextFormating(html);
-	this.iwin.document.body.innerHTML = html;
-};
-/** Utilities
--------------------------------------------------------- */
-function arrayIndexOf(aArray, aValue){
-	if (typeof Array.indexOf == 'function') {
-		return aArray.indexOf(aValue);
-	} else {
-		var index = -1;
-		var l = aArray.length;
-		for (var i = 0; i < l ; i++) {
-			if (aArray[i] === aValue) {
-				index = i;
-				break;
-			}
-		}
-		return index;
-	}
-};
-function addEvent(obj, evType, fn, useCapture) {
-	if (obj.addEventListener){
-		obj.addEventListener(evType, fn, useCapture);
-		return true;
-	} else if (obj.attachEvent){
-		var r = obj.attachEvent("on"+evType, fn);
-		return r;
-	} else {
-		return false;
-	}
-};
-function removeEvent(obj, evType, fn, useCapture) {
-	if (obj.removeEventListener){
-		obj.removeEventListener(evType, fn, useCapture);
-		return true;
-	} else if (obj.detachEvent){
-		var r = obj.detachEvent("on"+evType, fn);
-		return r;
-	} else {
-		return false;
-  }
-};
-function regexpEscape(s) {
-	return s.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1")
-};
Index: admin/js/jsToolBar/popup_link.js
===================================================================
--- admin/js/jsToolBar/popup_link.js	(revision 2566)
+++ 	(revision )
@@ -1,23 +1,0 @@
-$(function() {
-	$('#link-insert-cancel').click(function() {
-		window.close();
-	});
-
-	$('#link-insert-ok').click(function() {
-		sendClose();
-		window.close();
-	});
-
-	function sendClose() {
-		var insert_form = $('#link-insert-form').get(0);
-		if (insert_form == undefined) { return; }
-
-		var tb = window.opener.the_toolbar;
-		var data = tb.elements.link.data;
-
-		data.href = tb.stripBaseURL(insert_form.elements.href.value);
-		data.title = insert_form.elements.title.value;
-		data.hreflang = insert_form.elements.hreflang.value;
-		tb.elements.link.fncall[tb.mode].call(tb);
-	};
-});
Index: admin/js/jsToolBar/popup_media.js
===================================================================
--- admin/js/jsToolBar/popup_media.js	(revision 2566)
+++ 	(revision )
@@ -1,92 +1,0 @@
-$(function() {
-	var toolBar = window.opener.the_toolbar.textarea;
-
-	$('#media-insert').onetabload(function() {
-		$('#media-insert-cancel').click(function() {
-			window.close();
-		});
-
-		$('#media-insert-ok').click(function() {
-			sendClose();
-			window.close();
-		});
-	});
-
-	function sendClose() {
-		var insert_form = $('#media-insert-form').get(0);
-		if (insert_form == undefined) { return; }
-
-		var tb = window.opener.the_toolbar;
-		var type = insert_form.elements.type.value;
-
-		var media_align_grid = {
-			left: 'float: left; margin: 0 1em 1em 0;',
-			right: 'float: right; margin: 0 0 1em 1em;',
-			center: 'text-align: center;'
-		};
-
-		if (type == 'image')
-		{
-			tb.elements.img_select.data.src = tb.stripBaseURL($('input[name="src"]:checked',insert_form).val());
-			tb.elements.img_select.data.alignment = $('input[name="alignment"]:checked',insert_form).val();
-			tb.elements.img_select.data.link = $('input[name="insertion"]:checked',insert_form).val() == 'link';
-
-			tb.elements.img_select.data.title = insert_form.elements.title.value;
-			tb.elements.img_select.data.description = $('input[name="description"]',insert_form).val();
-			tb.elements.img_select.data.url = tb.stripBaseURL(insert_form.elements.url.value);
-			tb.elements.img_select.fncall[tb.mode].call(tb);
-		}
-		else if (type == 'mp3')
-		{
-			var player = $('#public_player').val();
-			var align = $('input[name="alignment"]:checked',insert_form).val();
-
-			if (align != undefined && align != 'none') {
-				player = '<div style="' + media_align_grid[align] + '">' + player + '</div>';
-			}
-
-			tb.elements.mp3_insert.data.player = player.replace(/>/g,'>\n');
-			tb.elements.mp3_insert.fncall[tb.mode].call(tb);
-		}
-		else if (type == 'flv')
-		{
-			var oplayer = $('<div>'+$('#public_player').val()+'</div>');
-			var flashvars = $("[name=FlashVars]",oplayer).val();
-
-			var align = $('input[name="alignment"]:checked',insert_form).val();
-			var title = insert_form.elements.title.value;
-
-			if (title) {
-				flashvars = 'title='+encodeURI(title)+'&amp;'+flashvars;
-			}
-			$('object',oplayer).attr('width',$('#video_w').val());
-			$('object',oplayer).attr('height',$('#video_h').val());
-			flashvars = flashvars.replace(/(width=\d*)/,'width='+$('#video_w').val());
-			flashvars = flashvars.replace(/(height=\d*)/,'height='+$('#video_h').val());
-
-			$("[name=FlashVars]",oplayer).val(flashvars);
-			var player = oplayer.html();
-
-			if (align != undefined && align != 'none') {
-				player = '<div style="' + media_align_grid[align] + '">' + player + '</div>';
-			}
-
-			tb.elements.flv_insert.data.player = player.replace(/>/g,'>\n');
-			tb.elements.flv_insert.fncall[tb.mode].call(tb);
-		}
-		else
-		{
-			tb.elements.link.data.href = tb.stripBaseURL(insert_form.elements.url.value);
-			tb.elements.link.data.content = insert_form.elements.title.value;
-			tb.elements.link.fncall[tb.mode].call(tb);
-		}
-	};
-
-	function playerFormat(s) {
-		s = s.replace(/&lt;/g,'<');
-		s = s.replace(/&gt;/g,'>\n');
-		s = s.replace(/&amp;/g,'&');
-
-		return s;
-	};
-});
Index: admin/js/jsToolBar/popup_posts.js
===================================================================
--- admin/js/jsToolBar/popup_posts.js	(revision 2566)
+++ 	(revision )
@@ -1,16 +1,0 @@
-$(function() {
-	$('#link-insert-cancel').click(function() {
-		window.close();
-	});
-
-	$('#form-entries tr>td.maximal>a').click(function() {
-		// Get post_id
-		var tb = window.opener.the_toolbar;
-		var data = tb.elements.link.data;
-
-		data.href = tb.stripBaseURL($(this).attr('title'));
-
-		tb.elements.link.fncall[tb.mode].call(tb);
-		window.close();
-	});
-});
Index: admin/langs.php
===================================================================
--- admin/langs.php	(revision 2594)
+++ admin/langs.php	(revision 2720)
@@ -50,5 +50,5 @@
 
 		dcPage::addSuccessNotice(__('Language has been successfully deleted.'));
-		http::redirect('langs.php');
+		http::redirect($core->adminurl->get("admin.langs"));
 	}
 	catch (Exception $e)
@@ -93,5 +93,5 @@
 			dcPage::addSuccessNotice(__('Language has been successfully installed.'));
 		}
-		http::redirect('langs.php');
+		http::redirect($core->adminurl->get("admin.langs"));
 	}
 	catch (Exception $e)
@@ -129,5 +129,5 @@
 			dcPage::addSuccessNotice(__('Language has been successfully installed.'));
 		}
-		http::redirect('langs.php');
+		http::redirect($core->adminurl->get("admin.langs"));
 	}
 	catch (Exception $e)
@@ -161,5 +161,5 @@
 '<p>'.sprintf(__('You can change your user language in your <a href="%1$s">preferences</a> or '.
 'change your blog\'s main language in your <a href="%2$s">blog settings</a>.'),
-'preferences.php','blog_pref.php').'</p>';
+$core->adminurl->get("admin.user.preferences"),$core->adminurl->get("admin.blog.pref")).'</p>';
 
 echo
@@ -203,5 +203,5 @@
 		{
 			echo
-			'<form action="langs.php" method="post">'.
+			'<form action="'.$core->adminurl->get("admin.langs").'" method="post">'.
 			'<div>'.
 			$core->formNonce().
@@ -234,5 +234,5 @@
 
 	echo
-	'<form method="post" action="langs.php" enctype="multipart/form-data" class="fieldset">'.
+	'<form method="post" action="'.$core->adminurl->get("admin.langs").'" enctype="multipart/form-data" class="fieldset">'.
 	'<h4>'.__('Available languages').'</h4>'.
 	'<p>'.sprintf(__('You can download and install a additional language directly from Dotclear.net. '.
@@ -252,5 +252,5 @@
 	# 'Upload language pack' form
 	echo
-	'<form method="post" action="langs.php" enctype="multipart/form-data" class="fieldset">'.
+	'<form method="post" action="'.$core->adminurl->get("admin.langs").'" enctype="multipart/form-data" class="fieldset">'.
 	'<h4>'.__('Upload a zip file').'</h4>'.
 	'<p>'.__('You can install languages by uploading zip files.').'</p>'.
Index: admin/media.php
===================================================================
--- admin/media.php	(revision 2529)
+++ admin/media.php	(revision 2720)
@@ -74,5 +74,8 @@
 $popup = (integer) !empty($_GET['popup']);
 
-$page_url = 'media.php?popup='.$popup.'&post_id='.$post_id;
+$page_url = $core->adminurl->get("admin.media",array('popup' => $popup,'post_id' => $post_id));
+if (($temp = $core->callBehavior('adminMediaURL',$page_url))!='') {
+	$page_url = $temp;
+}
 
 if ($popup) {
@@ -362,7 +365,17 @@
 }
 
+// Remove hidden directories (unless DC_SHOW_HIDDEN_DIRS is set to true)
+if (!defined('DC_SHOW_HIDDEN_DIRS') || (DC_SHOW_HIDDEN_DIRS == false)) {
+	for ($i = count($dir['dirs']) - 1; $i >= 0; $i--) {
+		if ($dir['dirs'][$i]->d) {
+			if (strpos($dir['dirs'][$i]->relname,'.') !== false) {
+				unset($dir['dirs'][$i]);
+			}
+		}
+	}
+}
 $items = array_values(array_merge($dir['dirs'],$dir['files']));
 
-$fmt_form_media = '<form action="media.php" method="post" id="form-medias">'.
+$fmt_form_media = '<form action="'.$core->adminurl->get("admin.media").'" method="post" id="form-medias">'.
 	'<div class="files-group">%s</div>'.
 	'<p class="hidden">'.$core->formNonce() . form::hidden(array('d'),$d).'</p>';
@@ -390,5 +403,5 @@
 
 	echo
-	'<form action="media.php" method="get" id="filters-form">'.
+	'<form action="'.$core->adminurl->get("admin.media").'" method="get" id="filters-form">'.
 	'<p class="two-boxes"><label for="file_sort" class="classic">'.__('Sort files:').'</label> '.
 	form::combo('file_sort',$sort_combo,$file_sort).'</p>'.
@@ -426,4 +439,7 @@
 '</div>';
 
+$core_media_archivable = $core->auth->check('media_admin',$core->blog->id) &&
+	!(count($items) == 0 || (count($items) == 1 && $items[0]->parent));
+
 if ($core_media_writable || $core_media_archivable) {
 	echo
@@ -431,7 +447,4 @@
 	'<h3 class="out-of-screen-if-js">'.sprintf(__('In %s:'),($d == '' ? '“'.__('Media manager').'”' : '“'.$d.'”')).'</h3>';
 }
-
-$core_media_archivable = $core->auth->check('media_admin',$core->blog->id) &&
-	!(count($items) == 0 || (count($items) == 1 && $items[0]->parent));
 
 if ($core_media_writable || $core_media_archivable) {
@@ -509,5 +522,5 @@
 		echo
 		'<p class="one-file form-help info">'.__('To send several files at the same time, you can activate the enhanced uploader in').
-		' <a href="preferences.php?tab=user-options">'.__('My preferences').'</a></p>';
+		' <a href="'.$core->adminurl->get("admin.user.preferences",array('tab' => 'user-options')).'">'.__('My preferences').'</a></p>';
 	}
 
@@ -542,5 +555,5 @@
 if (!$popup) {
 	echo '<div class="info"><p>'.sprintf(__('Current settings for medias and images are defined in %s'),
-	'<a href="blog_pref.php#medias-settings">'.__('Blog parameters').'</a>').'</p></div>';
+	'<a href="'.$core->adminurl->get("admin.blog.pref").'#medias-settings">'.__('Blog parameters').'</a>').'</p></div>';
 }
 
@@ -565,6 +578,8 @@
 		}
 	} else {
-		$link =
-		'media_item.php?id='.$f->media_id.'&amp;popup='.$popup.'&amp;post_id='.$post_id;
+		$link = $core->adminurl->get("admin.media.item", array('id' => $f->media_id,'popup' => $popup,'post_id' => $post_id));
+        if (($temp = $core->callBehavior('adminMediaURL',$link))!='') {
+            $link = $temp;
+        }
 	}
 
@@ -593,6 +608,7 @@
 	if ($post_id && !$f->d) {
 		$act .=
-		'<a class="attach-media" title="'.__('Attach this file to entry').'" href="post_media.php?media_id='.$f->media_id.
-		'&amp;post_id='.$post_id.'&amp;attach=1">'.
+		'<a class="attach-media" title="'.__('Attach this file to entry').'" href="'.
+		$core->adminurl->get("admin.post.media", array('media_id' => $f->media_id, 'post_id' => $post_id,'attach' => 1)).
+		'">'.
 		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'"/>'.
 		'</a>';
@@ -618,5 +634,5 @@
 
 	if ($f->type == 'audio/mpeg3') {
-		$lst .= '<li>'.dcMedia::mp3player($f->file_url,'index.php?pf=player_mp3.swf').'</li>';
+		$lst .= '<li>'.dcMedia::mp3player($f->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf'))).'</li>';
 	}
 
Index: admin/media_item.php
===================================================================
--- admin/media_item.php	(revision 2566)
+++ admin/media_item.php	(revision 2723)
@@ -29,6 +29,6 @@
 $file = null;
 $popup = (integer) !empty($_GET['popup']);
-$page_url = 'media_item.php?popup='.$popup.'&post_id='.$post_id;
-$media_page_url = 'media.php?popup='.$popup.'&post_id='.$post_id;
+$page_url = $core->adminurl->get("admin.media.item",array('popup' => $popup,'post_id' => $post_id));
+$media_page_url = $core->adminurl->get("admin.media",array('popup' => $popup,'post_id' => $post_id));
 
 $id = !empty($_REQUEST['id']) ? (integer) $_REQUEST['id'] : '';
@@ -209,5 +209,5 @@
 if ($popup) {
 	$starting_scripts .=
-	dcPage::jsLoad('js/jsToolBar/popup_media.js');
+	$core->callBehavior('adminPopupMedia');
 }
 call_user_func($open_f,__('Media manager'),
@@ -469,10 +469,10 @@
 if ($file->type == 'audio/mpeg3')
 {
-	echo dcMedia::mp3player($file->file_url,'index.php?pf=player_mp3.swf');
+	echo dcMedia::mp3player($file->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf')));
 }
 
 if ($file->type == 'video/x-flv' || $file->type == 'video/mp4' || $file->type == 'video/x-m4v')
 {
-	echo dcMedia::flvplayer($file->file_url,'index.php?pf=player_flv.swf');
+	echo dcMedia::flvplayer($file->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_flv.swf')));
 }
 
Index: admin/plugin.php
===================================================================
--- admin/plugin.php	(revision 2566)
+++ admin/plugin.php	(revision 2708)
@@ -36,4 +36,5 @@
 	$p_info = $core->plugins->getModules($p);
 
+	$p_name = $p;
 	$p_url = 'plugin.php?p='.$p;
 
Index: admin/popup_link.php
===================================================================
--- admin/popup_link.php	(revision 2566)
+++ admin/popup_link.php	(revision 2614)
@@ -19,5 +19,5 @@
 $title = !empty($_GET['title']) ? $_GET['title'] : '';
 
-dcPage::openPopup(__('Add a link'),dcPage::jsLoad('js/jsToolBar/popup_link.js'));
+dcPage::openPopup(__('Add a link'),$core->callBehavior('adminPopupLink'));
 
 echo '<h2 class="page-title">'.__('Add a link').'</h2>';
Index: admin/popup_posts.php
===================================================================
--- admin/popup_posts.php	(revision 2566)
+++ admin/popup_posts.php	(revision 2614)
@@ -48,5 +48,5 @@
 dcPage::openPopup(__('Add a link to an entry'),
 	dcPage::jsLoad('js/_posts_list.js').
-	dcPage::jsLoad('js/jsToolBar/popup_posts.js'));
+	$core->callBehavior('adminPopupPosts'));
 
 echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>';
Index: admin/post.php
===================================================================
--- admin/post.php	(revision 2566)
+++ admin/post.php	(revision 2736)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2014 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -19,4 +19,5 @@
 $post_dt = '';
 $post_format = $core->auth->getOption('post_format');
+$post_editor = $core->auth->getOption('editor');
 $post_password = '';
 $post_url = '';
@@ -40,6 +41,6 @@
 $can_delete = false;
 
-$post_headlink = '<link rel="%s" title="%s" href="post.php?id=%s" />';
-$post_link = '<a href="post.php?id=%s" title="%s">%s</a>';
+$post_headlink = '<link rel="%s" title="%s" href="'.$core->adminurl->get('admin.post',array('id' => "%s"),'&').'" />';
+$post_link = '<a href="'.$core->adminurl->get('admin.post',array('id' => "%s"),'&').'" title="%s">%s</a>';
 
 $next_link = $prev_link = $next_headlink = $prev_headlink = null;
@@ -59,6 +60,12 @@
 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
 
-# Formaters combo
-$formaters_combo = dcAdminCombos::getFormatersCombo();
+# Formats combo
+$core_formaters = $core->getFormaters();
+$available_formats = array('' => '');
+foreach ($core_formaters as $editor => $formats) {
+	foreach ($formats as $format) {
+        $available_formats[$format] = $format;
+    }
+}
 
 # Languages combo
@@ -74,6 +81,5 @@
 
 # Get entry informations
-if (!empty($_REQUEST['id']))
-{
+if (!empty($_REQUEST['id'])) {
 	$page_title = __('Edit entry');
 
@@ -82,11 +88,8 @@
 	$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;
@@ -148,5 +151,5 @@
 }
 
-$comments_actions_page = new dcCommentsActionsPage($core,'post.php',array('id' => $post_id, '_ANCHOR'=>$anchor,'section' => $anchor));
+$comments_actions_page = new dcCommentsActionsPage($core,$core->adminurl->get('admin.post'),array('id' => $post_id, '_ANCHOR'=>$anchor,'section' => $anchor));
 
 if ($comments_actions_page->process()) {
@@ -175,5 +178,8 @@
 		if (!$core->error->flag()) {
 			dcPage::addSuccessNotice(__('All pings sent.'));
-			http::redirect('post.php?id='.$post_id.'&tb=1');
+			http::redirect($core->adminurl->get(
+				'admin.post',
+				array('id' => $post_id, 'tb'=> '1')
+			));
 		}
 	}
@@ -181,6 +187,5 @@
 
 # Format excerpt and content
-elseif (!empty($_POST) && $can_edit_post)
-{
+elseif (!empty($_POST) && $can_edit_post) {
 	$post_format = $_POST['post_format'];
 	$post_excerpt = $_POST['post_excerpt'];
@@ -238,5 +243,5 @@
 		$core->callBehavior('adminBeforePostDelete',$post_id);
 		$core->blog->delPost($post_id);
-		http::redirect('posts.php');
+		http::redirect($core->adminurl->get("admin.posts"));
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
@@ -289,8 +294,6 @@
 
 	# Update post
-	if ($post_id)
-	{
-		try
-		{
+	if ($post_id) {
+		try {
 			# --BEHAVIOR-- adminBeforePostUpdate
 			$core->callBehavior('adminBeforePostUpdate',$cur,$post_id);
@@ -301,17 +304,15 @@
 			$core->callBehavior('adminAfterPostUpdate',$cur,$post_id);
 			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)
-		{
+			http::redirect($core->adminurl->get(
+				'admin.post',
+				array('id' => $post_id)
+			));
+		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
 		}
-	}
-	else
-	{
+	} else {
 		$cur->user_id = $core->auth->userID();
 
-		try
-		{
+		try {
 			# --BEHAVIOR-- adminBeforePostCreate
 			$core->callBehavior('adminBeforePostCreate',$cur);
@@ -323,8 +324,9 @@
 
 			dcPage::addSuccessNotice(__('Entry has been successfully created.'));
-			http::redirect('post.php?id='.$return_id);
-		}
-		catch (Exception $e)
-		{
+			http::redirect($core->adminurl->get(
+				'admin.post',
+				array('id' => $return_id)
+			));
+		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
 		}
@@ -372,10 +374,14 @@
 }
 
+$admin_post_behavior = '';
+if (!empty($core->auth->getOption('editor')) && !empty($core->auth->getOption('editor')[$post_format])) {
+	$admin_post_behavior = $core->callBehavior('adminPostEditor', $core->auth->getOption('editor')[$post_format]);
+}
 
 dcPage::open($page_title.' - '.__('Entries'),
 	dcPage::jsDatePicker().
-	dcPage::jsToolBar().
 	dcPage::jsModal().
 	dcPage::jsMetaEditor().
+    $admin_post_behavior.
 	dcPage::jsLoad('js/_post.js').
 	dcPage::jsConfirmClose('entry-form','comment-form').
@@ -387,5 +393,5 @@
 		array(
 			html::escapeHTML($core->blog->name) => '',
-			__('Entries') => 'posts.php',
+			__('Entries') => $core->adminurl->get("admin.posts"),
 			($post_id ? $page_title_edit : $page_title) => ''
 		))
@@ -446,6 +452,5 @@
 /* Post form if we can edit post
 -------------------------------------------------------- */
-if ($can_edit_post)
-{
+if ($can_edit_post) {
 	$sidebar_items = new ArrayObject(array(
 		'status-box' => array(
@@ -467,8 +472,9 @@
 					'<div>'.
 					'<h5 id="label_format"><label for="post_format" class="classic">'.__('Text formatting').'</label></h5>'.
-					'<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal').
-					'</p>'.
+					'<p>'.form::combo('post_format',$available_formats,$post_format,'maximal').'</p>'.
 					'<p class="format_control control_no_xhtml">'.
-					'<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? ' hide' : '').'" href="post.php?id='.$post_id.'&amp;xconv=1">'.
+					'<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? ' hide' : '').'" href="'.
+					$core->adminurl->get('admin.post',array('id'=> $post_id,'xconv'=> '1')).
+					'">'.
 					__('Convert to XHTML').'</a></p></div>')),
 		'metas-box' => array(
@@ -567,5 +573,5 @@
 
 	echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New entry')).'" id="edit-entry">';
-	echo '<form action="post.php" method="post" id="entry-form">';
+	echo '<form action="'.$core->adminurl->get('admin.post').'" method="post" id="entry-form">';
 	echo '<div id="entry-wrapper">';
 	echo '<div id="entry-content"><div class="constrained">';
@@ -593,5 +599,5 @@
 	} else {
 		echo
-		'<a id="post-cancel" href="index.php" class="button" accesskey="c">'.__('Cancel').' (c)</a>';
+		'<a id="post-cancel" href="'.$core->adminurl->get("admin.home").'" class="button" accesskey="c">'.__('Cancel').' (c)</a>';
 	}
 
@@ -645,5 +651,5 @@
 
 	if ($has_action) {
-		echo '<form action="post.php" id="form-comments" method="post">';
+		echo '<form action="'.$core->adminurl->get('admin.post').'" id="form-comments" method="post">';
 	}
 
@@ -652,5 +658,5 @@
 		showComments($comments,$has_action);
 	} else {
-		echo '<p>'.__('No comment').'</p>';
+		echo '<p>'.__('No comments').'</p>';
 	}
 
@@ -676,5 +682,5 @@
 	'<h3>'.__('Add a comment').'</h3>'.
 
-	'<form action="comment.php" method="post" id="comment-form">'.
+	'<form action="'.$core->adminurl->get("admin.comment").'" method="post" id="comment-form">'.
 	'<div class="constrained">'.
 	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').'</label>'.
@@ -728,5 +734,5 @@
 	# tracbacks actions
 	if ($has_action) {
-		echo '<form action="post.php" id="form-trackbacks" method="post">';
+		echo '<form action="'.$core->adminurl->get("admin.post").'" id="form-trackbacks" method="post">';
 	}
 
@@ -762,5 +768,5 @@
 		echo
 		'<h3>'.__('Ping blogs').'</h3>'.
-		'<form action="post.php?id='.$post_id.'" id="trackback-form" method="post">'.
+		'<form action="'.$core->adminurl->get("admin.post",array('id' => $post_id)).'" id="trackback-form" method="post">'.
 		'<p><label for="tb_urls" class="area">'.__('URLs to ping:').'</label>'.
 		form::textarea('tb_urls', 60, 5, $tb_urls).
@@ -775,5 +781,5 @@
 		(empty($_GET['tb_auto']) ?
 			'&nbsp;&nbsp;<a class="button" href="'.
-			'post.php?id='.$post_id.'&amp;tb_auto=1&amp;tb=1'.
+			$core->adminurl->get("admin.post",array('id'=> $post_id,'tb_auto' => 1,'tb' => 1)).
 			'">'.__('Auto discover ping URLs').'</a>'
 		: '').
@@ -827,4 +833,5 @@
 function showComments($rs,$has_action,$tb=false)
 {
+	global $core;
 	echo
 	'<div class="table-outer">'.
@@ -845,5 +852,5 @@
 	while($rs->fetch())
 	{
-		$comment_url = 'comment.php?id='.$rs->comment_id;
+		$comment_url = $core->adminurl->get("admin.comment",array('id' => $rs->comment_id));
 
 		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
@@ -871,5 +878,5 @@
 		'<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'.
 		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'.
-		'<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'.
+		'<td class="nowrap"><a href="'.$core->adminurl->get("admin.comments",array('ip' => $rs->comment_ip)).'">'.$rs->comment_ip.'</a></td>'.
 		'<td class="nowrap status">'.$img_status.'</td>'.
 		'<td class="nowrap status"><a href="'.$comment_url.'">'.
Index: admin/post_media.php
===================================================================
--- admin/post_media.php	(revision 2566)
+++ admin/post_media.php	(revision 2720)
@@ -72,5 +72,5 @@
 
 		echo
-		'<form action="post_media.php" method="post">'.
+		'<form action="'.$core->adminurl->get("admin.post.media").'" method="post">'.
 		'<p>'.__('Are you sure you want to remove this attachment?').'</p>'.
 		'<p><input type="submit" class="reset" value="'.__('Cancel').'" /> '.
Index: admin/posts.php
===================================================================
--- admin/posts.php	(revision 2566)
+++ admin/posts.php	(revision 2720)
@@ -112,5 +112,5 @@
 # Actions combo box
 
-$posts_actions_page = new dcPostsActionsPage($core,'posts.php');
+$posts_actions_page = new dcPostsActionsPage($core,$core->adminurl->get("admin.posts"));
 
 if ($posts_actions_page->process()) {
@@ -258,6 +258,6 @@
 {
 	echo
-	'<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>'.
-	'<form action="posts.php" method="get" id="filters-form">'.
+	'<p class="top-add"><a class="button add" href="'.$core->adminurl->get("admin.post").'">'.__('New entry').'</a></p>'.
+	'<form action="'.$core->adminurl->get("admin.posts").'" method="get" id="filters-form">'.
 	'<h3 class="out-of-screen-if-js">'.$form_filter_title.'</h3>'.
 
@@ -302,5 +302,5 @@
 	# Show posts
 	$post_list->display($page,$nb_per_page,
-	'<form action="posts.php" method="post" id="form-entries">'.
+	'<form action="'.$core->adminurl->get("admin.posts").'" method="post" id="form-entries">'.
 
 	'%s'.
Index: admin/posts_actions.php
===================================================================
--- admin/posts_actions.php	(revision 2566)
+++ admin/posts_actions.php	(revision 2720)
@@ -26,5 +26,5 @@
 	$args['redir'] = $_REQUEST['redir'];
 } else {
-	$uri = 'posts.php';
+	$uri = $core->adminurl->get("admin.posts");
 	$args=array();
 }
Index: admin/preferences.php
===================================================================
--- admin/preferences.php	(revision 2566)
+++ admin/preferences.php	(revision 2736)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2014 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -27,4 +27,7 @@
 
 $user_options = $core->auth->getOptions();
+if (empty($user_options['editor']) || !is_array($user_options['editor'])) {
+	$user_options['editor'] = array();
+}
 
 $core->auth->user_prefs->addWorkspace('dashboard');
@@ -58,7 +61,23 @@
 }
 
-# Formaters combo
-$formaters_combo = dcAdminCombos::getFormatersCombo();
-
+# Editors combo
+$editors_combo = dcAdminCombos::getEditorsCombo();
+$editors = array_keys($editors_combo);
+
+# Format by editors
+$formaters = $core->getFormaters();
+$format_by_editors = array();
+foreach ($formaters as $editor => $formats) {
+	foreach ($formats as $format) {
+		$format_by_editors[$format][$editor] = $editor;
+	}
+}
+$available_formats = array('' => '');
+foreach (array_keys($format_by_editors) as $format) {
+	$available_formats[$format] = $format;
+	if (!isset($user_options['editor'][$format])) {
+		$user_options['editor'][$format] = '';
+	}
+}
 $status_combo = dcAdminCombos::getPostStatusescombo();
 
@@ -125,5 +144,5 @@
 		dcPage::addSuccessNotice(__('Personal information has been successfully updated.'));
 
-		http::redirect('preferences.php');
+		http::redirect($core->adminurl->get("admin.user.preferences"));
 	}
 	catch (Exception $e)
@@ -134,5 +153,5 @@
 
 # Update user options
-if (isset($_POST['user_post_format']))
+if (isset($_POST['user_editor']))
 {
 	try
@@ -155,4 +174,5 @@
 		}
 		$user_options['post_format'] = $_POST['user_post_format'];
+		$user_options['editor'] = $_POST['user_editor'];
 		$user_options['enable_wysiwyg'] = !empty($_POST['user_wysiwyg']);
 
@@ -178,5 +198,5 @@
 
 		dcPage::addSuccessNotice(__('Personal options has been successfully updated.'));
-		http::redirect('preferences.php#user-options');
+		http::redirect($core->adminurl->get("admin.user.preferences").'#user-options');
 	}
 	catch (Exception $e)
@@ -204,5 +224,5 @@
 
 		dcPage::addSuccessNotice(__('Dashboard options has been successfully updated.'));
-		http::redirect('preferences.php#user-favorites');
+		http::redirect($core->adminurl->get("admin.user.preferences").'#user-favorites');
 	}
 	catch (Exception $e)
@@ -230,5 +250,5 @@
 		if (!$core->error->flag()) {
 			dcPage::addSuccessNotice(__('Favorites have been successfully added.'));
-			http::redirect('preferences.php#user-favorites');
+			http::redirect($core->adminurl->get("admin.user.preferences").'#user-favorites');
 		}
 	} catch (Exception $e) {
@@ -257,5 +277,5 @@
 		if (!$core->error->flag()) {
 			dcPage::addSuccessNotice(__('Favorites have been successfully removed.'));
-			http::redirect('preferences.php#user-favorites');
+			http::redirect($core->adminurl->get("admin.user.preferences").'#user-favorites');
 		}
 	} catch (Exception $e) {
@@ -284,5 +304,5 @@
 	if (!$core->error->flag()) {
 		dcPage::addSuccessNotice(__('Favorites have been successfully updated.'));
-		http::redirect('preferences.php#user-favorites');
+		http::redirect($core->adminurl->get("admin.user.preferences").'#user-favorites');
 	}
 }
@@ -295,5 +315,5 @@
 	if (!$core->error->flag()) {
 		dcPage::addSuccessNotice(__('Default favorites have been successfully updated.'));
-		http::redirect('preferences.php#user-favorites');
+		http::redirect($core->adminurl->get("admin.user.preferences").'#user-favorites');
 	}
 }
@@ -305,4 +325,5 @@
 	($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')).
 	dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
+	dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 	dcPage::jsLoad('js/jquery/jquery.pwstrength.js').
 		'<script type="text/javascript">'."\n".
@@ -315,5 +336,5 @@
 				sprintf(__('Password strength: %s'),__('strong'))."', '".
 				sprintf(__('Password strength: %s'),__('very strong'))."']});\n".
-		"});\n".
+		"});".
 		"\n//]]>\n".
 		"</script>\n".
@@ -358,5 +379,5 @@
 echo
 '<h3>'.__('My profile').'</h3>'.
-'<form action="preferences.php" method="post" id="user-form">'.
+'<form action="'.$core->adminurl->get("admin.user.preferences").'" method="post" id="user-form">'.
 
 '<p><label for="user_name">'.__('Last Name:').'</label>'.
@@ -418,5 +439,5 @@
 
 echo
-'<form action="preferences.php" method="post" id="opts-forms">'.
+'<form action="'.$core->adminurl->get("admin.user.preferences").'#user-options" method="post" id="opts-forms">'.
 '<h3>'.__('My options').'</h3>';
 
@@ -452,9 +473,19 @@
 echo
 '<div class="fieldset">'.
-'<h4>'.__('Edition').'</h4>'.
-
+'<h4>'.__('Edition').'</h4>';
+
+foreach ($format_by_editors as $format => $editors) {
+	echo
+	'<p class="field"><label for="user_editor">'.sprintf(__('Preferred editor for %s:'),$format).'</label>'.
+	form::combo(
+		'user_editor['.$format.']',
+		array_merge(array(__('Choose an editor') => ''),$editors),$user_options['editor'][$format]
+	).'</p>';
+}
+echo
 '<p class="field"><label for="user_post_format">'.__('Preferred format:').'</label>'.
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</p>'.
-
+form::combo('user_post_format',$available_formats,$user_options['post_format']).'</p>';
+
+echo
 '<p class="field"><label for="user_post_status">'.__('Default entry status:').'</label>'.
 form::combo('user_post_status',$status_combo,$user_post_status).'</p>'.
@@ -488,5 +519,5 @@
 echo '<h3>'.__('My dashboard').'</h3>';
 
-echo '<form action="preferences.php" method="post" id="favs-form" class="two-boxes odd">';
+echo '<form action="'.$core->adminurl->get("admin.user.preferences").'" method="post" id="favs-form" class="two-boxes odd">';
 
 echo '<div id="my-favs" class="fieldset"><h4>'.__('My favorites').'</h4>';
@@ -580,5 +611,5 @@
 
 echo
-'<form action="preferences.php" method="post" id="db-forms" class="two-boxes even">'.
+'<form action="'.$core->adminurl->get("admin.user.preferences").'" method="post" id="db-forms" class="two-boxes even">'.
 
 '<div class="fieldset">'.
Index: admin/search.php
===================================================================
--- admin/search.php	(revision 2566)
+++ admin/search.php	(revision 2720)
@@ -70,5 +70,5 @@
 
 if ($qtype == 'p') {
-	$posts_actions_page = new dcPostsActionsPage($core,'search.php',array('q'=>$q,'qtype'=>$qtype));
+	$posts_actions_page = new dcPostsActionsPage($core,$core->adminurl->get("admin.search"),array('q'=>$q,'qtype'=>$qtype));
 
 	if ($posts_actions_page->process()) {
@@ -76,5 +76,5 @@
 	}
 } else {
-	$comments_actions_page = new dcCommentsActionsPage($core,'search.php',array('q'=>$q,'qtype'=>$qtype));
+	$comments_actions_page = new dcCommentsActionsPage($core,$core->adminurl->get("admin.search"),array('q'=>$q,'qtype'=>$qtype));
 
 	if ($comments_actions_page->process()) {
@@ -92,5 +92,5 @@
 
 echo
-'<form action="search.php" method="get">'.
+'<form action="'.$core->adminurl->get("admin.search").'" method="get">'.
 '<div class="fieldset"><h3>'.__('Search options').'</h3>'.
 '<p><label for="q">'.__('Query:').' </label>'.form::field('q',30,255,html::escapeHTML($q)).'</p>'.
@@ -116,5 +116,5 @@
 
 		$post_list->display($page,$nb_per_page,
-		'<form action="search.php" method="post" id="form-entries">'.
+		'<form action="'.$core->adminurl->get("admin.search").'" method="post" id="form-entries">'.
 
 		'%s'.
@@ -144,5 +144,5 @@
 
 		$comment_list->display($page,$nb_per_page,
-		'<form action="search.php" method="post" id="form-comments">'.
+		'<form action="'.$core->adminurl->get("admin.search").'" method="post" id="form-comments">'.
 
 		'%s'.
Index: admin/style/jsToolBar/jsToolBar.css
===================================================================
--- admin/style/jsToolBar/jsToolBar.css	(revision 2566)
+++ 	(revision )
@@ -1,184 +1,0 @@
-.jstEditor {
-	border-width : 0 1px 1px 1px;
-	border-style : solid;
-	border-color : #ddd;
-	background : #f7f7f7;
-}
-.jstEditor textarea, .jstEditor iframe {
-	-webkit-box-sizing: border-box;
-	-moz-box-sizing: border-box;
-	box-sizing: border-box;
-	margin: 0;
-	border: 1px solid #fbfbfb;
-  	width: 100%;
-  	padding: .5em 0 0 0;
-  	min-height: 100px;
-}
-.jstHandle {
-	height: 8px;
-	background: #ccc url(resize.png) no-repeat center center;
-	font-size: 0.1em;
-	cursor: s-resize;
-	border-color: #ccc #ccc #ccc #000;
-	border-width: 0 1px 1px 1px;
-	border-style: solid;
-}
-.jstEditor textarea:focus, .jstEditor iframe:focus {
-	border-color: #bee74b;
-}
-.jstElements {
-	-webkit-box-sizing: border-box;
-	-moz-box-sizing: border-box;
-	box-sizing: border-box;
-	padding: 0 32px 0 1rem;
-	border: 1px solid #dfdfdf;
-	overflow: hidden;
-	background: #f5f5f5;
-	border-radius: 4px 4px 0 0;
-	position: relative;
-	line-height: 30px;
-}
-.jstElements select, .jstElements button {
-	vertical-align: middle;
-}
-.jstElements select {
-	width: 12em;
-	margin-right: .6rem;
-	border: 1px solid #ddd;
-}
-.jstElements button {
-	width: 30px;
-	height: 28px;
-	border-style: solid;
-	border-width: 1px;
-	margin-left: 2px;
-	margin-bottom: 2px;
-	border-color: #e5e5e5 #ccc #ccc #e5e5e5;
-	background-color : #f7f7f7;
-	background-position : 50% 50%;
-	background-repeat: no-repeat;
-}
-.jstElements button:hover, .jstElements button:focus {
-	border-color : #ddd;
-	background-color: #fff;
-}
-.jstElements button span {
-	display: none;
-}
-.jstElements span {
-	display : inline-block;
-	vertical-align: top;
-}
-span.jstSpacer {
-	width : 8px;
-}
-.jstSwitcher {
-	display: block;
-	list-style: none;
-	margin: 0;
-	padding: 0 0 5px 0;
-	background: #dfdfdf;
-	border-top: 1px solid #999;
-}
-.jstSwitcher li {
-	display: inline;
-	margin: 0 0 0 5px;
-	padding: 2px 8px;
-}
-.jstSwitcher li.jstSwitcherCurrent {
-	color: #fff;
-	background: #677374;
-	border-radius: 0 0 2px 2px;
-}
-.jstSwitcher a {
-	font-weight: normal;
-	border-bottom: none !important;
-}
-
-/* Buttons
--------------------------------------------------------- */
-button.jstb_strong {
-	background-image: url(bt_strong.png);
-}
-button.jstb_em {
-	background-image: url(bt_em.png);
-}
-button.jstb_ins {
-	background-image: url(bt_ins.png);
-}
-button.jstb_del {
-	background-image: url(bt_del.png);
-}
-button.jstb_quote {
-	background-image: url(bt_quote.png);
-}
-button.jstb_code {
-	background-image: url(bt_code.png);
-}
-button.jstb_paragraph {
-	background-image: url(bt_paragraph.png);
-}
-button.jstb_br {
-	background-image: url(bt_br.png);
-}
-button.jstb_blockquote {
-	background-image: url(bt_bquote.png);
-}
-button.jstb_pre {
-	background-image: url(bt_pre.png);
-}
-button.jstb_ul {
-	background-image: url(bt_ul.png);
-}
-button.jstb_ol {
-	background-image: url(bt_ol.png);
-}
-button.jstb_link {
-	background-image: url(bt_link.png);
-}
-button.jstb_img {
-	background-image: url(bt_img.png);
-}
-button.jstb_img_select {
-	background-image: url(bt_img_select.png);
-}
-button.jstb_post_link {
-	background-image: url(bt_post.png);
-}
-button.jstb_removeFormat {
-	background-color: #e5e5e5;
-	background-image: url(bt_clean.png);
-	position: absolute;
-	right: 2px;
-	top: 1px;
-	border-color: #ccc;
-}
-
-/* WYSIWYG Iframe */
-.wysiwygIframe {
-	border-width : 1px;
-	border-style : solid;
-	border-color : #000 #ccc #ccc #000;
-	width : 100%;
-}
-
-/* WYSIWYG Document */
-body.wysiwygDoc {
-	font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
-	color : #000;
-	background: #f9f9f9;
-	margin: 0;
-	padding : 2px;
-	border: none;
-}
-.wysiwygDoc pre, .wysiwygDoc code, .wysiwygDoc kbd, .wysiwygDoc samp {
-	font-family:"Courier New",Courier,monospace;
-	font-size : 1.1em;
-}
-.wysiwygDoc code {
-	color : #666;
-	font-weight : bold;
-}
-body.wysiwygDoc  > p:first-child {
-	margin-top: 0;
-}
Index: admin/user.php
===================================================================
--- admin/user.php	(revision 2566)
+++ admin/user.php	(revision 2729)
@@ -131,5 +131,5 @@
 
 			dcPage::addSuccessNotice(__('User has been successfully updated.'));
-			http::redirect('user.php?id='.$new_id);
+			http::redirect($core->adminurl->get("admin.user",array('id' => $new_id)));
 		}
 		# Add user
@@ -150,7 +150,7 @@
 			dcPage::addSuccessNotice(__('User has been successfully created.'));
 			if (!empty($_POST['saveplus'])) {
-				http::redirect('user.php');
+				http::redirect($core->adminurl->get("admin.user"));
 			} else {
-				http::redirect('user.php?id='.$new_id);
+				http::redirect($core->adminurl->get("admin.user",array('id' => $new_id)));
 			}
 		}
@@ -187,5 +187,5 @@
 		array(
 			__('System') => '',
-			__('Users') => 'users.php',
+			__('Users') => $core->adminurl->get("admin.users"),
 			$page_title => ''
 		))
@@ -201,5 +201,5 @@
 
 echo
-'<form action="user.php" method="post" id="user-form">'.
+'<form action="'.$core->adminurl->get("admin.user").'" method="post" id="user-form">'.
 '<div class="two-cols">'.
 
@@ -324,7 +324,7 @@
 	{
 		echo
-		'<form action="users_actions.php" method="post">'.
+		'<form action="'.$core->adminurl->get("admin.user.actions").'" method="post">'.
 		'<p><input type="submit" value="'.__('Add new permissions').'" />'.
-		form::hidden(array('redir'),'user.php?id='.$user_id).
+		form::hidden(array('redir'),$core->adminurl->get("admin.user",array('id' => $user_id))).
 		form::hidden(array('action'),'blogs').
 		form::hidden(array('users[]'),$user_id).
@@ -347,6 +347,7 @@
 				{
 					echo
-					'<form action="users_actions.php" method="post" class="perm-block">'.
-					'<p class="blog-perm">'.__('Blog:').' <a href="blog.php?id='.html::escapeHTML($k).'">'.
+					'<form action="'.$core->adminurl->get("admin.user.actions").'" method="post" class="perm-block">'.
+					'<p class="blog-perm">'.__('Blog:').' <a href="'.
+					$core->adminurl->get("admin.blog",array('id' => html::escapeHTML($k))).'">'.
 					html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</p>';
 
@@ -360,5 +361,5 @@
 					'</ul>'.
 					'<p class="add-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'.
-					form::hidden(array('redir'),'user.php?id='.$user_id).
+					form::hidden(array('redir'),$core->adminurl->get("admin.user",array('id' => $user_id))).
 					form::hidden(array('action'),'perms').
 					form::hidden(array('users[]'),$user_id).
Index: admin/users.php
===================================================================
--- admin/users.php	(revision 2566)
+++ admin/users.php	(revision 2720)
@@ -123,6 +123,6 @@
 
 	echo
-	'<p class="top-add"><strong><a class="button add" href="user.php">'.__('New user').'</a></strong></p>'.
-	'<form action="users.php" method="get" id="filters-form">'.
+	'<p class="top-add"><strong><a class="button add" href="'.$core->adminurl->get("admin.user").'">'.__('New user').'</a></strong></p>'.
+	'<form action="'.$core->adminurl->get("admin.users").'" method="get" id="filters-form">'.
 	'<h3 class="out-of-screen-if-js">'.$form_filter_title.'</h3>'.
 
@@ -151,5 +151,5 @@
 	# Show users
 	$user_list->display($page,$nb_per_page,
-	'<form action="users_actions.php" method="post" id="form-users">'.
+	'<form action="'.$core->adminurl->get("admin.user.actions").'" method="post" id="form-users">'.
 
 	'%s'.
Index: admin/users_actions.php
===================================================================
--- admin/users_actions.php	(revision 2566)
+++ admin/users_actions.php	(revision 2720)
@@ -49,10 +49,11 @@
 	else
 	{
-		$redir =
-		'users.php?q='.$_POST['q'].
-		'&sortby='.$_POST['sortby'].
-		'&order='.$_POST['order'].
-		'&page='.$_POST['page'].
-		'&nb='.$_POST['nb'];
+		$redir = $core->adminurl->get("admin.users", array(
+			'q'      => $_POST['q'],
+			'sortby' => $_POST['sortby'],
+			'order'  => $_POST['order'],
+			'page'   => $_POST['page'],
+			'nb'     => $_POST['nb']
+		));
 	}
 
@@ -137,5 +138,5 @@
 		array(
 			__('System') => '',
-			__('Users') => 'users.php',
+			__('Users') => $core->adminurl->get("admin.users"),
 			__('Permissions') => ''
 		));
@@ -144,5 +145,5 @@
 		array(
 			__('System') => '',
-			__('Users') => 'users.php',
+			__('Users') => $core->adminurl->get("admin.users"),
 			__('Actions') => ''
 		));
@@ -195,5 +196,5 @@
 
 	foreach ($users as $u) {
-		$user_list[] = '<a href="user.php?id='.$u.'">'.$u.'</a>';
+		$user_list[] = '<a href="'.$core->adminurl->get("admin.user",array('id' => $u)).'">'.$u.'</a>';
 	}
 
@@ -211,5 +212,5 @@
 	{
 		echo
-		'<form action="users_actions.php" method="post" id="form-blogs">'.
+		'<form action="'.$core->adminurl->get("admin.user.actions").'" method="post" id="form-blogs">'.
 		'<div class="table-outer clear">'.
 		'<table><tr>'.
@@ -256,5 +257,5 @@
 
 	foreach ($users as $u) {
-		$user_list[] = '<a href="user.php?id='.$u.'">'.$u.'</a>';
+		$user_list[] = '<a href="'.$core->adminurl->get("admin.user",array('id' => $u)).'">'.$u.'</a>';
 	}
 
@@ -264,9 +265,9 @@
 		implode(', ',$user_list)
 	).'</p>'.
-	'<form id="permissions-form" action="users_actions.php" method="post">';
+	'<form id="permissions-form" action="'.$core->adminurl->get("admin.user.actions").'" method="post">';
 
 	foreach ($blogs as $b)
 	{
-		echo '<h3>'.('Blog:').' <a href="blog.php?id='.html::escapeHTML($b).'">'.html::escapeHTML($b).'</a>'.
+		echo '<h3>'.('Blog:').' <a href="'.$core->adminurl->get("admin.blog",array('id' => html::escapeHTML($b))).'">'.html::escapeHTML($b).'</a>'.
 		form::hidden(array('blogs[]'),$b).'</h3>';
 		$unknown_perms = $user_perm;
Index: admin/xmlrpc.php
===================================================================
--- admin/xmlrpc.php	(revision 2730)
+++ admin/xmlrpc.php	(revision 2566)
@@ -27,7 +27,4 @@
 }
 
-# Avoid plugins warnings, set a default blog
-$core->setBlog($blog_id);
-
 # Loading plugins
 $core->plugins->loadModules(DC_PLUGINS_ROOT);
