Index: plugins/aboutConfig/_admin.php
===================================================================
--- plugins/aboutConfig/_admin.php	(revision 0)
+++ plugins/aboutConfig/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/aboutConfig/_define.php
===================================================================
--- plugins/aboutConfig/_define.php	(revision 0)
+++ plugins/aboutConfig/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/aboutConfig/index.php
===================================================================
--- plugins/aboutConfig/index.php	(revision 220)
+++ plugins/aboutConfig/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/akismet/_define.php
===================================================================
--- plugins/akismet/_define.php	(revision 0)
+++ plugins/akismet/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/akismet/_prepend.php
===================================================================
--- plugins/akismet/_prepend.php	(revision 0)
+++ plugins/akismet/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/akismet/class.dc.filter.akismet.php
===================================================================
--- plugins/akismet/class.dc.filter.akismet.php	(revision 217)
+++ plugins/akismet/class.dc.filter.akismet.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/_admin.php
===================================================================
--- plugins/antispam/_admin.php	(revision 203)
+++ plugins/antispam/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/_define.php
===================================================================
--- plugins/antispam/_define.php	(revision 0)
+++ plugins/antispam/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/_install.php
===================================================================
--- plugins/antispam/_install.php	(revision 0)
+++ plugins/antispam/_install.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/_prepend.php
===================================================================
--- plugins/antispam/_prepend.php	(revision 0)
+++ plugins/antispam/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/_public.php
===================================================================
--- plugins/antispam/_public.php	(revision 0)
+++ plugins/antispam/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/filters/class.dc.filter.ip.php
===================================================================
--- plugins/antispam/filters/class.dc.filter.ip.php	(revision 223)
+++ plugins/antispam/filters/class.dc.filter.ip.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -167,6 +167,6 @@
 
 				$res .=
-				'<p style="'.$p_style.'"><label class="classic">'.
-				form::checkbox(array('delip[]'),$rs->rule_id,false,'','',$disabled_ip, 'title="'.html::escapeHTML($pattern).'"').' '.
+				'<p style="'.$p_style.'"><label class="classic" for="'.$type.'-ip-'.$rs->rule_id.'">'.
+				form::checkbox(array('delip[]',$type.'-ip-'.$rs->rule_id),$rs->rule_id,false,'','',$disabled_ip).' '.
 				html::escapeHTML($pattern).
 				'</label></p>';
@@ -311,3 +311,2 @@
 }
 ?>
-
Index: plugins/antispam/filters/class.dc.filter.iplookup.php
===================================================================
--- plugins/antispam/filters/class.dc.filter.iplookup.php	(revision 223)
+++ plugins/antispam/filters/class.dc.filter.iplookup.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -84,7 +84,7 @@
 		'<form action="'.html::escapeURL($url).'" method="post">'.
 		'<fieldset><legend>' . __('IP Lookup servers') . '</legend>'.
-		'<p>'.'<label for="bls">'.__('Add here a coma separated list of servers.').'</label>'.
-		form::textarea('bls',40,3,html::escapeHTML($bls),'maximal').'</p>'.
-		'<p><input type="submit" value="'.__('Save').'" />'.
+		'<p><label for="bls">'.__('Add here a coma separated list of servers.').
+		form::textarea('bls',40,3,html::escapeHTML($bls),'maximal').
+		'<input type="submit" value="'.__('Save').'" /></label></p>'.
 		$this->core->formNonce().'</p>'.
 		'</fieldset>'.
@@ -119,3 +119,2 @@
 }
 ?>
-
Index: plugins/antispam/filters/class.dc.filter.linkslookup.php
===================================================================
--- plugins/antispam/filters/class.dc.filter.linkslookup.php	(revision 0)
+++ plugins/antispam/filters/class.dc.filter.linkslookup.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/filters/class.dc.filter.words.php
===================================================================
--- plugins/antispam/filters/class.dc.filter.words.php	(revision 223)
+++ plugins/antispam/filters/class.dc.filter.words.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -156,6 +156,6 @@
 
 				$res .=
-				'<p style="'.$p_style.'"><label class="classic">'.
-				form::checkbox(array('swd[]'),$rs->rule_id,false,'','',$disabled_word, 'title="'.html::escapeHTML($rs->rule_content).'"').' '.
+				'<p style="'.$p_style.'"><label class="classic" for="word-'.$rs->rule_id.'">'.
+				form::checkbox(array('swd[]', 'word-'.$rs->rule_id),$rs->rule_id,false,'','',$disabled_word).' '.
 				html::escapeHTML($rs->rule_content).
 				'</label></p>';
@@ -356,3 +356,2 @@
 }
 ?>
-
Index: plugins/antispam/inc/class.dc.spamfilter.php
===================================================================
--- plugins/antispam/inc/class.dc.spamfilter.php	(revision 0)
+++ plugins/antispam/inc/class.dc.spamfilter.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/inc/class.dc.spamfilters.php
===================================================================
--- plugins/antispam/inc/class.dc.spamfilters.php	(revision 0)
+++ plugins/antispam/inc/class.dc.spamfilters.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/inc/lib.dc.antispam.php
===================================================================
--- plugins/antispam/inc/lib.dc.antispam.php	(revision 203)
+++ plugins/antispam/inc/lib.dc.antispam.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/inc/lib.dc.antispam.url.php
===================================================================
--- plugins/antispam/inc/lib.dc.antispam.url.php	(revision 0)
+++ plugins/antispam/inc/lib.dc.antispam.url.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/antispam/index.php
===================================================================
--- plugins/antispam/index.php	(revision 223)
+++ plugins/antispam/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Antispam, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_admin.php
===================================================================
--- plugins/blogroll/_admin.php	(revision 3)
+++ plugins/blogroll/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_define.php
===================================================================
--- plugins/blogroll/_define.php	(revision 0)
+++ plugins/blogroll/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_install.php
===================================================================
--- plugins/blogroll/_install.php	(revision 0)
+++ plugins/blogroll/_install.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_prepend.php
===================================================================
--- plugins/blogroll/_prepend.php	(revision 0)
+++ plugins/blogroll/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_public.php
===================================================================
--- plugins/blogroll/_public.php	(revision 0)
+++ plugins/blogroll/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/_widgets.php
===================================================================
--- plugins/blogroll/_widgets.php	(revision 0)
+++ plugins/blogroll/_widgets.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/class.dc.blogroll.php
===================================================================
--- plugins/blogroll/class.dc.blogroll.php	(revision 0)
+++ plugins/blogroll/class.dc.blogroll.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/class.dc.importblogroll.php
===================================================================
--- plugins/blogroll/class.dc.importblogroll.php	(revision 0)
+++ plugins/blogroll/class.dc.importblogroll.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/edit.php
===================================================================
--- plugins/blogroll/edit.php	(revision 217)
+++ plugins/blogroll/edit.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blogroll/index.php
===================================================================
--- plugins/blogroll/index.php	(revision 218)
+++ plugins/blogroll/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/_admin.php
===================================================================
--- plugins/blowupConfig/_admin.php	(revision 0)
+++ plugins/blowupConfig/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/_define.php
===================================================================
--- plugins/blowupConfig/_define.php	(revision 0)
+++ plugins/blowupConfig/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/_install.php
===================================================================
--- plugins/blowupConfig/_install.php	(revision 175)
+++ plugins/blowupConfig/_install.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of blowupConfig, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/_public.php
===================================================================
--- plugins/blowupConfig/_public.php	(revision 0)
+++ plugins/blowupConfig/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/index.php
===================================================================
--- plugins/blowupConfig/index.php	(revision 217)
+++ plugins/blowupConfig/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/blowupConfig/lib/class.blowup.config.php
===================================================================
--- plugins/blowupConfig/lib/class.blowup.config.php	(revision 0)
+++ plugins/blowupConfig/lib/class.blowup.config.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/dcRevisions/_admin.php
===================================================================
--- plugins/dcRevisions/_admin.php	(revision 338)
+++ plugins/dcRevisions/_admin.php	(revision 338)
@@ -0,0 +1,28 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+# 
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+# 
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+if (!defined('DC_CONTEXT_ADMIN')) { return; }
+
+$core->addBehavior('adminPostForm',array('dcRevisionsBehaviors','adminPostForm'));
+$core->addBehavior('adminPostHeaders',array('dcRevisionsBehaviors','adminPostHeaders'));
+$core->addBehavior('adminBeforePostUpdate',array('dcRevisionsBehaviors','adminBeforeUpdate'));
+$core->addBehavior('adminBeforePageUpdate',array('dcRevisionsBehaviors','adminBeforeUpdate'));
+
+$core->rest->addFunction('getPatch',array('dcRevisionsRestMethods','getPatch'));
+
+$core->blog->revisions = new dcRevisions($core);
+
+if (isset($_GET['id']) && isset($_GET['patch']) && preg_match('/post.php\?id=[0-9]+(.*)$/',$_SERVER['REQUEST_URI'])) {
+	$core->blog->revisions->setPatch($_GET['id'],$_GET['patch']);
+}
+
+?>
Index: plugins/dcRevisions/_define.php
===================================================================
--- plugins/dcRevisions/_define.php	(revision 338)
+++ plugins/dcRevisions/_define.php	(revision 338)
@@ -0,0 +1,21 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+$this->registerModule(
+		/* Name */			"dcRevisions",
+		/* Description*/		"Allows entries's versionning",
+		/* Author */			"Tomtom (http://blog.zenstyle.fr)",
+		/* Version */			'0.1',
+		/* Permissions */		'usage,contentadmin'
+);
+
+?>
Index: plugins/dcRevisions/_install.php
===================================================================
--- plugins/dcRevisions/_install.php	(revision 338)
+++ plugins/dcRevisions/_install.php	(revision 338)
@@ -0,0 +1,65 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+if (!defined('DC_CONTEXT_ADMIN')) { return; }
+
+$m_version = $core->plugins->moduleInfo('dcRevisions','version');
+$i_version = $core->getVersion('dcrevisions');
+
+if (version_compare($i_version,$m_version,'>=')) {
+	return;
+}
+
+$core->blog->settings->addNamespace('dcrevisions');
+$core->blog->settings->dcrevisions->put(
+	'enable',
+	false,
+	'boolean','Enable revisions',false,true
+);
+
+# --INSTALL AND UPDATE PROCEDURES--
+$s = new dbStruct($core->con,$core->prefix);
+
+$s->revision
+	->revision_id				('bigint',0,false)
+	->post_id					('bigint',0,false)
+	->user_id					('varchar',32,false)
+	->blog_id					('varchar',32,false)
+	->revision_dt				('timestamp',0,false,'now()')
+	->revision_tz				('varchar',128,false,"'UTC'")
+	->revision_type			('varchar',50,true,null)
+	->revision_excerpt_diff		('text',0,true,null)
+	->revision_excerpt_xhtml_diff	('text',0,true,null)
+	->revision_content_diff		('text',0,true,null)
+	->revision_content_xhtml_diff	('text',0,true,null)
+	;
+
+$s->revision->primary('pk_revision','revision_id');
+
+$s->revision->index('idx_revision_post_id','btree','post_id');
+
+$s->revision->reference('fk_revision_post','post_id','post','post_id','cascade','cascade');
+$s->revision->reference('fk_revision_blog','blog_id','blog','blog_id','cascade','cascade');
+
+$si = new dbStruct($core->con,$core->prefix);
+
+try {
+	$changes = $si->synchronize($s);
+} catch (Exception $e) {
+	$core->error->add($e);
+}
+
+$core->setVersion('dcrevisions',$m_version);
+
+return true;
+
+?>
Index: plugins/dcRevisions/_prepend.php
===================================================================
--- plugins/dcRevisions/_prepend.php	(revision 338)
+++ plugins/dcRevisions/_prepend.php	(revision 338)
@@ -0,0 +1,19 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRrevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+$__autoload['dcRevisions'] = dirname(__FILE__).'/inc/class.dc.revisions.php';
+$__autoload['dcRevisionsRestMethods'] = dirname(__FILE__).'/_services.php';
+$__autoload['dcRevisionsBehaviors'] = dirname(__FILE__).'/inc/class.dc.revisions.behaviors.php';
+$__autoload['dcRevisionsExtensions'] = dirname(__FILE__).'/inc/class.dc.revisions.extensions.php';
+$__autoload['dcRevisionsList'] = dirname(__FILE__).'/inc/class.dc.revisions.list.php';
+
+?>
Index: plugins/dcRevisions/_services.php
===================================================================
--- plugins/dcRevisions/_services.php	(revision 338)
+++ plugins/dcRevisions/_services.php	(revision 338)
@@ -0,0 +1,166 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+class dcRevisionsRestMethods
+{
+	public static function getPatch()
+	{
+		global $core;
+		
+		$pid = isset($_GET['pid']) ? $_GET['pid'] : null;
+		$rid = isset($_GET['rid']) ? $_GET['rid'] : null;
+		
+		if ($pid === null) {
+			throw new Exception(__('No post ID'));
+		}
+		if ($rid === null) {
+			throw new Exception(__('No revision ID'));
+		}
+		
+		$p = $core->blog->getPosts(array('post_id' => $pid));
+		$o = array(
+			'post_excerpt_xhtml' => $p->post_excerpt_xhtml,
+			'post_content_xhtml' => $p->post_content_xhtml
+		);
+		
+		$n = $core->blog->revisions->getPatch($pid,$rid);
+		unset($n['post_excerpt']);
+		unset($n['post_content']);
+		
+		$rsp = new xmlTag('revision');
+		
+		foreach ($o as $k => $v) {
+			$c = dcRevisionsRestMethods::getNode($v,$n[$k],$k);
+			$rsp->insertNode($c);
+		}
+		
+		return $rsp;
+	}
+	
+	protected static function getNode($old,$new,$node_name)
+	{
+		if (!is_array($old)) {
+			$old = preg_replace ('/ +/',' ',$old);
+			$lo = explode("\n",trim($old));
+		} else {
+			$lo = $old;
+		}
+
+		if (!is_array($new)) {
+			$new = preg_replace('/ +/',' ',$new);
+			$ln = explode("\n", trim($new));
+		} else {
+			$ln = $new;
+		}
+		
+		$n = new xmlTag($node_name);
+		
+		$size = max(count($lo),count($ln));
+		$pad_length = strlen($size);
+
+		$equ = array_intersect_assoc($lo,$ln);
+		$ins = array_diff_assoc($ln,$lo);
+		$del = array_diff_assoc($lo,$ln);
+
+		for ($i = 0; $i < $size; $i++)
+		{
+			$line_number = str_pad($i + 1,$pad_length,'0',STR_PAD_LEFT);
+
+			if (isset($del[$i])) {
+				$ld = new xmlTag('line');
+				$ld->insertAttr('old',(string) $line_number);
+				$ld->insertAttr('new','');
+				$ld->insertAttr('content',dcRevisionsRestMethods::getLine($del,$ins,$i,'delete'));
+				$n->insertNode($ld);
+			}
+			if (isset($equ[$i])) {
+				$li = new xmlTag('line');
+				$li->insertAttr('old',(string) $line_number);
+				$li->insertAttr('new',(string) $line_number);
+				$li->insertAttr('content',$equ[$i]);
+				$n->insertNode($li);
+			}
+			if (isset($ins[$i])) {
+				$l = new xmlTag('line');
+				$l->insertAttr('old','');
+				$l->insertAttr('new',(string) $line_number);
+				$l->insertAttr('content',dcRevisionsRestMethods::getLine($del,$ins,$i,'insert'));
+				$n->insertNode($l);
+			}
+		}
+
+		return $n;
+	}
+	
+	protected static function getLine($del,$ins,$key,$mode)
+	{
+		
+		$p_del = '<del>%s</del>';
+		$p_ins = '<ins>%s</ins>';
+		
+		$str_del = isset($del[$key]) ? preg_replace('#<p>(.*)<\/p>#','$1',$del[$key]) : '';
+		$ins_del = isset($ins[$key]) ? preg_replace('#<p>(.*)<\/p>#','$1',$ins[$key]) : '';
+
+		switch ($mode) {
+			case 'delete':
+				$p = $p_del;
+				$src = preg_replace('#(.)*#',"\$1\n",$str_del);
+				$dist = preg_replace('#(.)*#',"\$1\n",$ins_del);
+				break;
+			case 'insert':
+				$p = $p_ins;
+				$src = preg_replace('#(.)*#',"\$1\n",$ins_del);
+				$dist = preg_replace('#(.)*#',"\$1\n",$str_del);
+				break;
+		}
+		
+		if (array_key_exists($key,$del) && !array_key_exists($key,$ins)) {
+			return sprintf($p_del,preg_replace('#<p>(.*)<\/p>#','$1',$del[$key]));
+		}
+		if (array_key_exists($key,$ins) && !array_key_exists($key,$del)) {
+			return sprintf($p_ins,preg_replace('#<p>(.*)<\/p>#','$1',$ins[$key]));
+		}
+		
+		$del = preg_split('//',preg_replace('#<p>(.*)<\/p>#','$1',$del[$key]),-1);
+		$ins = preg_split('//',preg_replace('#<p>(.*)<\/p>#','$1',$ins[$key]),-1);
+		
+		switch ($mode) {
+			case 'delete':
+				$p = $p_del;
+				$arr = array_diff_assoc($del,$ins);
+				$res = implode('',$del);
+				break;
+			case 'insert':
+				$p = $p_ins;
+				$arr = array_diff_assoc($ins,$del);
+				$res = implode('',$ins);
+				break;
+		}
+		
+		$word = '';
+		$diff = array();
+		
+		foreach ($arr as $k => $c) {
+			if (array_key_exists($k+1,$arr)) {
+				$word .= $c;
+			}
+			else {
+				array_push($diff,$word);
+				$word = '';
+			}
+		}
+		
+		return preg_replace('#('.implode('|',$diff).')#',sprintf($p,'$1'),$res);
+	}
+}
+
+?>
Index: plugins/dcRevisions/inc/class.dc.revisions.behaviors.php
===================================================================
--- plugins/dcRevisions/inc/class.dc.revisions.behaviors.php	(revision 338)
+++ plugins/dcRevisions/inc/class.dc.revisions.behaviors.php	(revision 338)
@@ -0,0 +1,68 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+class dcRevisionsBehaviors
+{
+	public static function adminPostForm($post)
+	{
+		global $core;
+		
+		$id = isset($post) && !$post->isEmpty() ? $post->post_id : null;
+		$page = isset($_GET['page']) ? $_GET['page'] : 1;
+		$url = sprintf('post.php?id=%1$s&amp;patch=%2$s',$id,'%s');
+		
+		$params = array(
+			'post_id' => $id
+		);
+		
+		$rs = $core->blog->revisions->getRevisions($params);
+		
+		if (is_null($id)) {
+			$rs = staticRecord::newFromArray(array());
+			$rs->core = $core;
+		}
+		
+		$list = new dcRevisionsList($rs);
+		
+		echo '<div class="area" id="revisions-area"><label>'.__('Revisions:').'</label>'.
+		$list->display($url).
+		'</div>';
+	}
+	
+	public static function adminPostHeaders()
+	{
+		return
+		'<script type="text/javascript">'."\n".
+		"//<![CDATA[\n".
+		dcPage::jsVar('dotclear.msg.excerpt',__('Excerpt')).
+		dcPage::jsVar('dotclear.msg.content',__('Content')).
+		dcPage::jsVar('dotclear.msg.current',__('Current')).
+		dcPage::jsVar('dotclear.msg.confirm_apply_patch',__('Are you sure to want apply this patch on this entry?')).
+		"\n//]]>\n".
+		"</script>\n".
+		'<script type="text/javascript" src="index.php?pf=dcRevisions/js/_revision.js"></script>'."\n".
+		'<link rel="stylesheet" type="text/css" href="index.php?pf=dcRevisions/style.css" />';
+	}
+	
+	public static function adminBeforeUpdate($cur,$post_id)
+	{
+		global $core;
+		
+		try {
+			$core->blog->revisions->addRevision($cur,$post_id);
+		} catch (Exception $e) {
+			$core->error->add($e->getMessage());
+		}
+	}
+}
+
+?>
Index: plugins/dcRevisions/inc/class.dc.revisions.extensions.php
===================================================================
--- plugins/dcRevisions/inc/class.dc.revisions.extensions.php	(revision 338)
+++ plugins/dcRevisions/inc/class.dc.revisions.extensions.php	(revision 338)
@@ -0,0 +1,73 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+class dcRevisionsExtensions
+{
+	public static function getDate($rs,$format = null)
+	{
+		$format === null ? $format = $rs->core->blog->settings->system->date_format : $format;
+		
+		return dt::dt2str($format,$rs->revision_dt,$rs->revision_tz);
+	}
+	
+	public static function getTime($rs,$format = null)
+	{	
+		$format === null ? $format = $rs->core->blog->settings->system->time_format : $format;
+
+		return dt::dt2str($format,$rs->revision_dt,$rs->revision_tz);
+	}
+	
+	public static function getAuthorCN($rs)
+	{
+		return dcUtils::getUserCN($rs->user_id, $rs->user_name,
+		$rs->user_firstname, $rs->user_displayname);
+	}
+	
+	public static function getAuthorLink($rs)
+	{
+		$res = '%1$s';
+		$url = $rs->user_url;
+		if ($url) {
+			$res = '<a href="%2$s">%1$s</a>';
+		}
+		
+		return sprintf($res,html::escapeHTML($rs->getAuthorCN()),html::escapeHTML($url));
+	}
+	
+	public static function canPatch($rs)
+	{
+		# If user is super admin, true
+		if ($rs->core->auth->isSuperAdmin()) {
+			return true;
+		}
+		
+		# If user is admin or contentadmin, true
+		if ($rs->core->auth->check('contentadmin',$rs->core->blog->id)) {
+			return true;
+		}
+		
+		# No user id in result ? false
+		if (!$rs->exists('user_id')) {
+			return false;
+		}
+		
+		# If user is usage and owner of the entrie
+		if ($rs->core->auth->check('usage',$rs->core->blog->id)
+		&& $rs->user_id == $rs->core->auth->userID()) {
+			return true;
+		}
+		
+		return false;
+	}
+}
+
+?>
Index: plugins/dcRevisions/inc/class.dc.revisions.list.php
===================================================================
--- plugins/dcRevisions/inc/class.dc.revisions.list.php	(revision 338)
+++ plugins/dcRevisions/inc/class.dc.revisions.list.php	(revision 338)
@@ -0,0 +1,86 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+class dcRevisionsList
+{
+	protected $rs = null;
+	
+	public function __construct($rs)
+	{
+		$this->rs = $rs;
+		$this->core = $rs->core;
+	}
+	
+	public function display($url)
+	{
+		$res = '';
+		
+		if (!$this->rs->isEmpty()) {
+			$html_block =
+				'<table id="revisions-list" summary="'.__('Revisions').'" class="clear maximal" style="display: none;">'.
+				'<thead>'.
+				'<tr>'.
+				'<th>'.__('Id').'</th>'.
+				'<th class="nowrap">'.__('Author').'</th>'.
+				'<th class="nowrap">'.__('Date').'</th>'.
+				'<th class="nowrap">'.__('Status').'</th>'.
+				'<th class="nowrap">'.__('Actions').'</th>'.
+				'</tr>'.
+				'</thead>'.
+				'<tbody>%s</tbody>'.
+				'</table>';
+				
+			$res .= sprintf($html_block,$this->getLines($url));
+		}
+		else {
+			$res .= '<p style="display:none">'.__('No revision').'</p>';
+		}
+		
+		return $res;
+	}
+	
+	private function getLines($url)
+	{
+		$res = '';
+		$p_img = '<img src="%1$s" alt="%2$s" title="%2$s" />';
+		$p_link = '<a href="%1$s" title="%3$s" class="patch"><img src="%2$s" alt="%3$s" /></a>';
+		
+		while ($this->rs->fetch()) {
+			$res .= 
+				'<tr class="line wide'.(!$this->rs->canPatch() ? ' offline' : '').'" id="r'.$this->rs->revision_id.'">'."\n".
+				'<td class="maximal nowrap rid">'.
+					'<strong>'.sprintf(__('Revision %s'),$this->rs->count()-$this->rs->index()).'</strong>'.
+				"</td>\n".
+				'<td class="minimal nowrap">'.
+					$this->rs->getAuthorLink().
+				"</td>\n".
+				'<td class="minimal nowrap">'.
+					$this->rs->getDate().' - '.$this->rs->getTime().
+				"</td>\n".
+				'<td class="minimal nowrap status">'.
+					sprintf(
+						$p_img,
+						('images/'.($this->rs->canPatch() ? 'check-on.png' : 'locker.png')),
+						($this->rs->canPatch() ? __('Revision allowed') : __('Revision blocked'))
+					).
+				"</td>\n".
+				'<td class="minimal nowrap status">'.
+					($this->rs->canPatch() ? sprintf($p_link,sprintf($url,$this->rs->revision_id),'index.php?pf=dcRevisions/images/apply.png',__('Apply patch')) : '').
+				"</td>\n".
+				"</tr>\n";
+		}
+		
+		return $res;
+	}
+}
+
+?>
Index: plugins/dcRevisions/inc/class.dc.revisions.php
===================================================================
--- plugins/dcRevisions/inc/class.dc.revisions.php	(revision 338)
+++ plugins/dcRevisions/inc/class.dc.revisions.php	(revision 338)
@@ -0,0 +1,255 @@
+<?php
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+
+class dcRevisions
+{
+	public function __construct($core)
+	{
+		$this->core = $core;
+	}
+	
+	public function getRevisions($params,$count_only = false)
+	{
+		if ($count_only) {
+			$f = 'COUNT(revision_id)';
+		}
+		else {
+			$f = 'R.revision_id, R.post_id, R.user_id, R.revision_type, '.
+			'R.revision_dt, R.revision_tz, R.revision_excerpt_diff, '.
+			'R.revision_excerpt_xhtml_diff, R.revision_content_diff, '.
+			'R.revision_content_xhtml_diff, U.user_url, U.user_name, '.
+			'U.user_firstname, U.user_displayname';
+		}
+		
+		$strReq = 'SELECT '.$f.' FROM '.$this->core->prefix.'revision R '.
+		'LEFT JOIN '.$this->core->prefix.'user U ON R.user_id = U.user_id ';
+		
+		if (!empty($params['from'])) {
+			$strReq .= $params['from'].' ';
+		}
+		
+		$strReq .= "WHERE R.blog_id = '".$this->core->con->escape($this->core->blog->id)."' ";
+		
+		if (!empty($params['post_id'])) {
+			if (is_array($params['post_id'])) {
+				array_walk($params['post_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}'));
+			} else {
+				$params['post_id'] = array((integer) $params['post_id']);
+			}
+			$strReq .= 'AND R.post_id '.$this->core->con->in($params['post_id']);
+		}
+		
+		if (!empty($params['revision_id'])) {
+			if (is_array($params['revision_id'])) {
+				array_walk($params['revision_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}'));
+			} else {
+				$params['revision_id'] = array((integer) $params['revision_id']);
+			}
+			$strReq .= 'AND R.revision_id '.$this->core->con->in($params['revision_id']);
+		}
+		
+		if (isset($params['post_type'])) {
+			if (is_array($params['post_type']) && !empty($params['post_type'])) {
+				$strReq .= 'AND R.revision_type '.$this->core->con->in($params['revision_type']);
+			} elseif ($params['post_type'] != '') {
+				$strReq .= "AND R.revision_type = '".$this->core->con->escape($params['revision_type'])."' ";
+			}
+		}
+		
+		if (!empty($params['sql'])) {
+			$strReq .= $params['sql'].' ';
+		}
+		
+		if (!$count_only) {
+			if (!empty($params['order'])) {
+				$strReq .= 'ORDER BY '.$this->core->con->escape($params['order']).' ';
+			} else {
+				$strReq .= 'ORDER BY revision_dt DESC ';
+			}
+		}
+		
+		if (!$count_only && !empty($params['limit'])) {
+			$strReq .= $this->core->con->limit($params['limit']);
+		}
+		
+		$rs = $this->core->con->select($strReq);
+		$rs->core = $this->core;
+		$rs->extend('dcRevisionsExtensions');
+		
+		return $rs;
+	}
+	
+	public function addRevision($pcur,$post_id)
+	{
+		$rs = $this->core->con->select(
+			'SELECT MAX(revision_id) '.
+			'FROM '.$this->core->prefix.'revision' 
+		);
+		$revision_id = $rs->f(0) + 1; 
+		
+		$rs = $this->core->blog->getPosts(array('post_id' => $post_id));
+		
+		$old = array(
+			'post_excerpt' => $rs->post_excerpt,
+			'post_excerpt_xhtml' => $rs->post_excerpt_xhtml,
+			'post_content' => $rs->post_content,
+			'post_content_xhtml' => $rs->post_content_xhtml
+		);
+		$new = array(
+			'post_excerpt' => $pcur->post_excerpt,
+			'post_excerpt_xhtml' => $pcur->post_excerpt_xhtml,
+			'post_content' => $pcur->post_content,
+			'post_content_xhtml' => $pcur->post_content_xhtml
+		);
+		
+		$diff = $this->getDiff($new,$old);
+		
+		$insert = false;
+		foreach ($diff as $k => $v) {
+			if ($v !== '') {
+				$insert = true;
+			}
+		}
+		
+		if ($insert) {
+			$rcur = $this->core->con->openCursor($this->core->prefix.'revision');
+			$rcur->revision_id = $revision_id;
+			$rcur->post_id = $post_id;
+			$rcur->user_id = $this->core->auth->userID();
+			$rcur->blog_id = $this->core->blog->id;
+			$rcur->revision_dt = date('Y-m-d H:i:s');
+			$rcur->revision_tz = $this->core->auth->getInfo('user_tz');
+			$rcur->revision_type = $pcur->post_type;
+			$rcur->revision_excerpt_diff = $diff['post_excerpt'];
+			$rcur->revision_excerpt_xhtml_diff = $diff['post_excerpt_xhtml'];
+			$rcur->revision_content_diff = $diff['post_content'];
+			$rcur->revision_content_xhtml_diff = $diff['post_content_xhtml'];
+	 
+			$this->core->con->writeLock($this->core->prefix.'revision');
+			$rcur->insert();
+			$this->core->con->unlock();
+		}
+	}
+	
+	public function getDiff($n,$o)
+	{
+		$diff = array(
+			'post_excerpt' => '',
+			'post_excerpt_xhtml' => '',
+			'post_content' => '',
+			'post_content_xhtml' => ''
+		);
+		
+		try {
+			foreach ($diff as $k => $v) {
+				$diff[$k] = uDiff::diff($n[$k],$o[$k]);
+			}
+		
+			return $diff;
+		}
+		catch (Exception $e)
+		{
+			$this->core->error->add($e->getMessage());
+		}
+	}
+	
+	public function setPatch($pid,$rid)
+	{
+		if (!$this->canPatch($rid)) {
+			throw new Exception(__('You are not allowed to patch this entry with this revision'));
+		}
+		
+  		try
+		{
+			$patch = $this->getPatch($pid,$rid);
+
+			$p = $this->core->blog->getPosts(array('post_id' => $pid));
+
+			$cur = $this->core->con->openCursor($this->core->prefix.'post');
+
+			$cur->post_title = $p->post_title;
+			$cur->cat_id = $p->cat_id ? $p->cat_id : null;
+			$cur->post_dt = $p->post_dt ? date('Y-m-d H:i:00',strtotime($p->post_dt)) : '';
+			$cur->post_format = $p->post_format;
+			$cur->post_password = $p->post_password;
+			$cur->post_lang = $p->post_lang;
+			$cur->post_notes = $p->post_notes;
+			$cur->post_status = $p->post_status;
+			$cur->post_selected = (integer) $p->post_selected;
+			$cur->post_open_comment = (integer) $p->post_open_comment;
+			$cur->post_open_tb = (integer) $p->post_open_tb;
+
+			$cur->post_excerpt = $patch['post_excerpt'];
+			$cur->post_excerpt_xhtml = $patch['post_excerpt_xhtml'];
+			$cur->post_content = $patch['post_content'];
+			$cur->post_content_xhtml = $patch['post_content_xhtml'];
+
+			# --BEHAVIOR-- adminBeforePostUpdate
+			$this->core->callBehavior('adminBeforePostUpdate',$cur,$pid);
+			
+			$this->core->auth->sudo(array($this->core->blog,'updPost'),$pid,$cur);
+			
+			# --BEHAVIOR-- adminAfterPostUpdate
+			$this->core->callBehavior('adminAfterPostUpdate',$cur,$pid);
+			
+			http::redirect('post.php?id='.$pid.'&upd=1');
+		}
+		catch (Exception $e)
+		{
+			$this->core->error->add($e->getMessage());
+		}
+	}
+	
+	public function getPatch($pid,$rid)
+	{
+		$params = array(
+			'post_id' => $pid
+		);
+		
+		$p = $this->core->blog->getPosts($params);
+		$r = $this->getRevisions($params);
+          
+		$patch = array(
+			'post_excerpt' => $p->post_excerpt,
+			'post_excerpt_xhtml' => $p->post_excerpt_xhtml,
+			'post_content' => $p->post_content,
+			'post_content_xhtml' => $p->post_content_xhtml
+		);
+
+		while ($r->fetch()) {
+			foreach ($patch as $k => $v) {
+				if ($k === 'post_excerpt') { $f = 'revision_excerpt_diff'; }
+				if ($k === 'post_excerpt_xhtml') { $f = 'revision_excerpt_xhtml_diff'; }
+				if ($k === 'post_content') { $f = 'revision_content_diff'; }
+				if ($k === 'post_content_xhtml') { $f = 'revision_content_xhtml_diff'; }
+				
+				uDiff::check($r->{$f});
+				$patch[$k] = uDiff::patch($v,$r->{$f});
+			}
+
+			if ($r->revision_id === $rid) {
+				break;
+			}
+		}
+		
+		return $patch;
+	}
+	
+	protected function canPatch($ird)
+	{
+		$r = $this->getRevisions(array('revision_id' => $rid));
+		
+		return ($r->canPatch());
+	}
+}
+
+?>
Index: plugins/dcRevisions/js/_revision.js
===================================================================
--- plugins/dcRevisions/js/_revision.js	(revision 338)
+++ plugins/dcRevisions/js/_revision.js	(revision 338)
@@ -0,0 +1,132 @@
+/*
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+*/
+dotclear.revisionExpander = function() {
+	$('#revisions-list tr.line').each(function() {
+		var img = document.createElement('img');
+		img.src = dotclear.img_plus_src;
+		img.alt = dotclear.img_plus_alt;
+		img.className = 'expand';
+		$(img).css('cursor','pointer');
+		img.line=this;
+		img.onclick = function() {
+			dotclear.viewRevisionContent(this,this.line);
+		};
+		$(this).find('td.rid').prepend(img);
+	});
+};
+
+dotclear.viewRevisionContent = function(img,line) {
+	var revisionId = line.id.substr(1);
+	var postId = $("#id").val();
+	var tr = document.getElementById('re'+revisionId);
+	if(!tr){
+		tr = document.createElement('tr');
+		tr.id = 're'+revisionId;
+		var td = document.createElement('td');
+		td.colSpan = 5;
+		td.className = 'expand';
+		tr.appendChild(td);
+		img.src = dotclear.img_minus_src;
+		img.alt = dotclear.img_minus_alt;
+		$.get(
+			'services.php',{
+				f: 'getPatch',
+				pid: postId,
+				rid: revisionId
+			},
+			function(data){
+				var rsp = $(data).children('rsp')[0];
+				if(rsp.attributes[0].value == 'ok'){
+					var excerpt = $(rsp).find('post_excerpt_xhtml');
+					var content = $(rsp).find('post_content_xhtml');
+					var table = '<table class="preview-rev">';
+					table += dotclear.viewRevisionRender($(rsp).find('post_excerpt_xhtml'),dotclear.msg.excerpt,revisionId);
+					table += dotclear.viewRevisionRender($(rsp).find('post_content_xhtml'),dotclear.msg.content,revisionId);
+					table += '</table>';
+					$(td).append(table)
+				}
+				else {
+					alert($(rsp).find('message').text());
+				}
+			}
+		);
+		$(line).toggleClass('expand');
+		line.parentNode.insertBefore(tr,line.nextSibling);
+	}
+	else if (tr.style.display=='none') {
+		$(tr).toggle();
+		$(line).toggleClass('expand');
+		img.src = dotclear.img_minus_src;
+		img.alt = dotclear.img_minus_alt
+	}
+	else {
+		$(tr).toggle();
+		$(line).toggleClass('expand');
+		img.src = dotclear.img_plus_src;
+		img.alt = dotclear.img_plus_alt;
+	}
+};
+
+dotclear.viewRevisionRender = function(content,title,revisionId){
+	var res = '<thead><tr class="rev-header"><th colspan="3">'+title+'</th></tr>'+
+	'<tr class="rev-number"><th class="minimal nowrap">'+dotclear.msg.current+
+	'</th><th class="minimal nowrap">r'+revisionId+
+	'</th><th class="maximal"></th></tr></thead><tbody>';
+	if (content.size() > 0) {
+		var previous = '';
+		content.find('line').each(function() {
+			var class = '';
+			
+			var o = this.attributes[0].value;
+			var n = this.attributes[1].value;
+			var line = this.attributes[2].value;
+			console.log(previous+" - "+line);
+			if (o != '' && n == '') {
+				class = ' delete';
+				if (previous == '') class += ' start';
+				previous = 'o';
+			} 
+			if (o == '' && n != '') {
+				class = ' insert';
+				if (previous == '') class += ' start';
+				previous = 'n';
+			}
+			if (o != '' && n != '') {
+				if (previous == 'o') class = ' delete-end';
+				if (previous == 'n') class = ' insert-end';
+				previous = '';
+			}
+			res += '<tr><td class="minimal col-line">'+o+
+			'</td><td class="minimal col-line">'+n+
+			'</td><td class="maximal'+class+'">'+line+
+			'</td></tr>';
+		});
+	}
+	res += '</tbody>';
+	return res;
+};
+
+$(function() {
+	$('#edit-entry').onetabload(function() {
+		$('#revisions-area label').toggleWithLegend(
+			$('#revisions-area').children().not('label'),{
+				cookie:'dcx_post_revisions',
+				hide:$('#revisions_area').val() == '<p></p>',
+				fn:dotclear.revisionExpander()
+			}
+		);
+		$('#revisions-list tr.line a.patch').click(function() {
+			return window.confirm(dotclear.msg.confirm_apply_patch);
+		});
+	});
+});
Index: plugins/dcRevisions/style.css
===================================================================
--- plugins/dcRevisions/style.css	(revision 338)
+++ plugins/dcRevisions/style.css	(revision 338)
@@ -0,0 +1,66 @@
+/*
+# -- BEGIN LICENSE BLOCK ----------------------------------
+# This file is part of dcRevisions, a plugin for Dotclear.
+#
+# Copyright (c) 2010 Tomtom and contributors
+# http://blog.zenstyle.fr/
+#
+# Licensed under the GPL version 2.0 license.
+# A copy of this license is available in LICENSE file or at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# -- END LICENSE BLOCK ------------------------------------
+*/
+#revisions-area { padding-bottom: 1em; }
+table#revisions-list { display: none; }
+table.preview-rev { width: 100%; }
+table.preview-rev, table.preview-rev tr, table.preview-rev th, table.preview-rev td  { border: none; }
+table.preview-rev thead {
+	border: 1px dotted #aaa;
+	background-color: #f3f3f3;
+}
+table.preview-rev thead tr.rev-header th, table.preview-rev thead tr.rev-number th {
+	border: 1px dotted #aaa;
+	text-align: center;
+}
+table.preview-rev td.center { text-align: center; }
+table.preview-rev td.col-line {
+	background-color: #eceade;
+	color: #aaa;
+	border-top: 1px solid #aaa;
+	/*border-right: 1px solid #ccc;*/
+	border-bottom: 1px solid #aaa;
+	border-left: 1px solid #ccc;
+}
+table.preview-rev td.delete {
+	background-color: #fdd;
+	border-left: 1px solid #c00;
+	border-right: 1px solid #c00;
+}
+table.preview-rev td.delete.start {
+	border-top: 1px solid #c00;
+}
+table.preview-rev td.delete-end {
+	border-top: 1px solid #c00;
+}
+table.preview-rev td.insert {
+	background-color: #dfd;
+	border-left: 1px solid #0a0;
+	border-right: 1px solid #0a0;
+}
+table.preview-rev td.insert.start {
+	border-top: 1px solid #0a0;
+}
+table.preview-rev td.insert-end {
+	border-top: 1px solid #0a0;
+}
+
+del {
+	text-decoration: none;
+	background-color: #e99;
+	padding: 0.2em 0 0.2em 0;
+}
+ins {
+	text-decoration: none;
+	background-color: #9e9;
+	padding: 0.2em 0 0.2em 0;
+}
Index: plugins/fairTrackbacks/_define.php
===================================================================
--- plugins/fairTrackbacks/_define.php	(revision 0)
+++ plugins/fairTrackbacks/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/fairTrackbacks/_prepend.php
===================================================================
--- plugins/fairTrackbacks/_prepend.php	(revision 0)
+++ plugins/fairTrackbacks/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/fairTrackbacks/_public.php
===================================================================
--- plugins/fairTrackbacks/_public.php	(revision 0)
+++ plugins/fairTrackbacks/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/fairTrackbacks/class.dc.filter.fairtrackbacks.php
===================================================================
--- plugins/fairTrackbacks/class.dc.filter.fairtrackbacks.php	(revision 0)
+++ plugins/fairTrackbacks/class.dc.filter.fairtrackbacks.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/_admin.php
===================================================================
--- plugins/importExport/_admin.php	(revision 3)
+++ plugins/importExport/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/_define.php
===================================================================
--- plugins/importExport/_define.php	(revision 0)
+++ plugins/importExport/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/class.dc.export.flat.php
===================================================================
--- plugins/importExport/inc/class.dc.export.flat.php	(revision 125)
+++ plugins/importExport/inc/class.dc.export.flat.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -106,4 +106,5 @@
 				$exp->exportTable('setting');
 				$exp->exportTable('user');
+				$exp->exportTable('pref');
 				$exp->exportTable('permissions');
 				$exp->exportTable('post');
Index: plugins/importExport/inc/class.dc.ieModule.php
===================================================================
--- plugins/importExport/inc/class.dc.ieModule.php	(revision 0)
+++ plugins/importExport/inc/class.dc.ieModule.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/class.dc.import.dc1.php
===================================================================
--- plugins/importExport/inc/class.dc.import.dc1.php	(revision 82)
+++ plugins/importExport/inc/class.dc.import.dc1.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/class.dc.import.feed.php
===================================================================
--- plugins/importExport/inc/class.dc.import.feed.php	(revision 82)
+++ plugins/importExport/inc/class.dc.import.feed.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/class.dc.import.flat.php
===================================================================
--- plugins/importExport/inc/class.dc.import.flat.php	(revision 82)
+++ plugins/importExport/inc/class.dc.import.flat.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/class.dc.import.wp.php
===================================================================
--- plugins/importExport/inc/class.dc.import.wp.php	(revision 82)
+++ plugins/importExport/inc/class.dc.import.wp.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/flat/class.backupFile.php
===================================================================
--- plugins/importExport/inc/flat/class.backupFile.php	(revision 0)
+++ plugins/importExport/inc/flat/class.backupFile.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/flat/class.db.export.php
===================================================================
--- plugins/importExport/inc/flat/class.db.export.php	(revision 0)
+++ plugins/importExport/inc/flat/class.db.export.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/importExport/inc/flat/class.dc.import.php
===================================================================
--- plugins/importExport/inc/flat/class.dc.import.php	(revision 0)
+++ plugins/importExport/inc/flat/class.dc.import.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -84,4 +84,5 @@
 		$this->cur_setting     = $this->con->openCursor($this->prefix.'setting');
 		$this->cur_user        = $this->con->openCursor($this->prefix.'user');
+		$this->cur_pref        = $this->con->openCursor($this->prefix.'pref');
 		$this->cur_permissions = $this->con->openCursor($this->prefix.'permissions');
 		$this->cur_post        = $this->con->openCursor($this->prefix.'post');
@@ -253,4 +254,7 @@
 						$this->insertUser($line);
 						break;
+					case 'pref':
+						$this->insertPref($line);
+						break;
 					case 'permissions':
 						$this->insertPermissions($line);
@@ -363,4 +367,18 @@
 		
 		$this->cur_setting->insert();
+	}
+	
+	private function insertPref($pref)
+	{
+		$this->cur_pref->clean();
+		
+		$this->cur_pref->pref_id    = (string) $pref->pref_id;
+		$this->cur_pref->user_id    = !$pref->user_id ? null : (string) $pref->user_id;
+		$this->cur_pref->pref_ws    = (string) $pref->pref_ws;
+		$this->cur_pref->pref_value = (string) $pref->pref_value;
+		$this->cur_pref->pref_type  = (string) $pref->pref_type;
+		$this->cur_pref->pref_label = (string) $pref->pref_label;
+		
+		$this->cur_pref->insert();
 	}
 	
Index: plugins/importExport/index.php
===================================================================
--- plugins/importExport/index.php	(revision 0)
+++ plugins/importExport/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/maintenance/_admin.php
===================================================================
--- plugins/maintenance/_admin.php	(revision 3)
+++ plugins/maintenance/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/maintenance/_define.php
===================================================================
--- plugins/maintenance/_define.php	(revision 0)
+++ plugins/maintenance/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/maintenance/index.php
===================================================================
--- plugins/maintenance/index.php	(revision 186)
+++ plugins/maintenance/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/_admin.php
===================================================================
--- plugins/pages/_admin.php	(revision 130)
+++ plugins/pages/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/_define.php
===================================================================
--- plugins/pages/_define.php	(revision 0)
+++ plugins/pages/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/_prepend.php
===================================================================
--- plugins/pages/_prepend.php	(revision 0)
+++ plugins/pages/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/_public.php
===================================================================
--- plugins/pages/_public.php	(revision 82)
+++ plugins/pages/_public.php	(revision 306)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -33,7 +33,9 @@
 			$core->blog->withoutPassword(false);
 			
-			$params = new ArrayObject();
-			$params['post_type'] = 'page';
-			$params['post_url'] = $args;
+			$params = new ArrayObject(array(
+				'post_type' => 'page',
+				'post_url' => $args));
+			
+			$core->callBehavior('publicPagesBeforeGetPosts',$params,$args);
 			
 			$_ctx->posts = $core->blog->getPosts($params);
Index: plugins/pages/_widgets.php
===================================================================
--- plugins/pages/_widgets.php	(revision 0)
+++ plugins/pages/_widgets.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/index.php
===================================================================
--- plugins/pages/index.php	(revision 0)
+++ plugins/pages/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/list.php
===================================================================
--- plugins/pages/list.php	(revision 198)
+++ plugins/pages/list.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pages/locales/en/help/page.html
===================================================================
--- plugins/pages/locales/en/help/page.html	(revision 198)
+++ plugins/pages/locales/en/help/page.html	(revision 232)
@@ -71,10 +71,4 @@
   URL for your page. If the URL you're trying to use is already used by another
   page, a number will be added to it.</dd>
-  
-  <dt>Attachments</dt>
-  <dd>The attachments are all the medias you joined to the page. The link <em>add
-  file to this page</em> allows you to attach other files to the page. Remember
-  to save your changes before clicking on this link. For further information,
-  see the media manager help.</dd>
 </dl>
 
Index: plugins/pages/locales/fr/help/page.html
===================================================================
--- plugins/pages/locales/fr/help/page.html	(revision 198)
+++ plugins/pages/locales/fr/help/page.html	(revision 232)
@@ -13,5 +13,5 @@
   
   <dt>Extrait</dt>
-  <dd>Ce champ est optionel.</dd>
+  <dd>Ce champ est optionnel.</dd>
   
   <dt>Contenu</dt>
@@ -33,5 +33,5 @@
   </dd>
   
-  <dt>Publié le</dt>
+  <dt>Publiée le</dt>
   <dd>Permet de modifier la date et l'heure de publication de la page. Si vous avez
   choisi le statut <em>programmée</em> elle sera mise en ligne aux date et heure
@@ -77,10 +77,4 @@
   après avoir cliqué sur le petit verrou placé à sa droite. Si vous essayez
   d'utiliser une URL déjà existante, celle-ci se verra incrémentée d'un chiffre.</dd>
-  
-  <dt>Pièces jointes</dt>
-  <dd>Les pièces jointes sont tous les médias attachés à la page. Le lien
-  d'ajout d'une pièce jointe permet de choisir un fichier à ajouter à la page.
-  Pensez à sauvegarder votre page avant de choisir une pièce jointe. Consultez
-  l'aide du gestionnaire de média pour plus de détails.</dd>
 </dl>
 
Index: plugins/pages/page.php
===================================================================
--- plugins/pages/page.php	(revision 219)
+++ plugins/pages/page.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pings/_admin.php
===================================================================
--- plugins/pings/_admin.php	(revision 3)
+++ plugins/pings/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pings/_define.php
===================================================================
--- plugins/pings/_define.php	(revision 0)
+++ plugins/pings/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pings/index.php
===================================================================
--- plugins/pings/index.php	(revision 217)
+++ plugins/pings/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/pings/lib.pings.php
===================================================================
--- plugins/pings/lib.pings.php	(revision 120)
+++ plugins/pings/lib.pings.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/_admin.php
===================================================================
--- plugins/tags/_admin.php	(revision 330)
+++ plugins/tags/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -39,6 +39,4 @@
 
 $core->addBehavior('adminDashboardFavs',array('tagsBehaviors','dashboardFavs'));
-
-$core->addBehavior('adminToolbar',array('tagsBehaviors','adminToolbar'));
 
 # BEHAVIORS
@@ -121,4 +119,6 @@
 		"metaEditor.prototype.text_all = '".html::escapeJS(__('all'))."';\n".
 		"metaEditor.prototype.text_separation = '';\n".
+		"jsToolBar.prototype.elements.tag.title = '".html::escapeJS(__('Tag'))."';\n".
+		"jsToolBar.prototype.elements.tag.url = '".html::escapeJS($tag_url)."';\n".
 		"dotclear.msg.tags_autocomplete = '".html::escapeJS(__('used in %e - frequency %p%'))."';\n".
 		"dotclear.msg.entry = '".html::escapeJS(__('entry'))."';\n".
@@ -131,4 +131,6 @@
 	public static function postsActionsHeaders()
 	{
+		$tag_url = $GLOBALS['core']->blog->url.$GLOBALS['core']->url->getBase('tag');
+		
 		$opts = $GLOBALS['core']->auth->getOptions();
 		$type = isset($opts['tag_list_format']) ? $opts['tag_list_format'] : 'more';
@@ -319,13 +321,4 @@
 		}
 	}
-	
-	public static function adminToolbar($tb)
-	{
-		$tag_url = $GLOBALS['core']->blog->getQMarkURL().$GLOBALS['core']->url->getBase('tag');
-		
-		$tb->addSettings('xhtml',array('tag_url_pattern' => $tag_url));
-		$tb->addPlugins('xhtml',array('dcTag' => false));
-		$tb->addButtons('xhtml',array(3 => array('tag')));
-	}
 }
 ?>
Index: plugins/tags/_define.php
===================================================================
--- plugins/tags/_define.php	(revision 0)
+++ plugins/tags/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/_prepend.php
===================================================================
--- plugins/tags/_prepend.php	(revision 0)
+++ plugins/tags/_prepend.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/_public.php
===================================================================
--- plugins/tags/_public.php	(revision 0)
+++ plugins/tags/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/_widgets.php
===================================================================
--- plugins/tags/_widgets.php	(revision 0)
+++ plugins/tags/_widgets.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/_xmlrpc.php
===================================================================
--- plugins/tags/_xmlrpc.php	(revision 0)
+++ plugins/tags/_xmlrpc.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/index.php
===================================================================
--- plugins/tags/index.php	(revision 0)
+++ plugins/tags/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/js/post.js
===================================================================
--- plugins/tags/js/post.js	(revision 330)
+++ plugins/tags/js/post.js	(revision 0)
@@ -57,56 +57,46 @@
 		});
 	});
+});
 
-	tinymce.create('tinymce.plugins.dcTag', {
-		init : function(ed, url) {
-			this.editor = ed;
-			
-			ed.addCommand('dcTag', function() {
-				var se = ed.selection;
-				
-				if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) {
-					 return;
-				}
-				
-				window.dc_tag_editor.addMeta(se.getContent());
-				tinymce.execCommand('mceInsertLink', false, '#mce_temp_url#', {skip_undo : 1});
-		
-				elementArray = tinymce.grep(ed.dom.select("a"),function(n) {return ed.dom.getAttrib(n,'href') == '#mce_temp_url#';});
-				for (i=0; i<elementArray.length; i++) {
-					var node = elementArray[i];
-					ed.dom.setAttrib(node,'href',ed.getParam('tag_url_pattern')+'/'+se.getContent());
-					ed.dom.setAttrib(node,'title','Tag: ' + se.getContent());
-				}
-				ed.focus();
-				ed.selection.select(node);
-				ed.selection.collapse(0);
-				tinymce.storeSelection();
-				tinymce.execCommand('mceEndUndoLevel');
-			});
-			
-			ed.addButton('tag', {
-				title : 'dcTag.tag_desc',
-				cmd : 'dcTag',
-				image :'index.php?pf=tags/img/tag-add.png'
-			});
-			
-			ed.addShortcut('ctrl+alt+t', 'dcTag.ta_desc', 'dcTag');
-			
-			ed.onNodeChange.add(function(ed, cm, n, co) {
-				cm.setDisabled('tag', co || ed.dom.getParent(n, 'A'));
-			});
-		},
-		
-		getInfo : function() {
-			return {
-				longname : 'Dotclear tag',
-				author : 'Tomtom for dotclear',
-				authorurl : 'http://dotclear.org',
-				infourl : '',
-				version : tinymce.majorVersion + "." + tinymce.minorVersion
-			};
+// Toolbar button for tags
+jsToolBar.prototype.elements.tagSpace = {type: 'space'};
+
+jsToolBar.prototype.elements.tag = {type: 'button', title: 'Keyword', fn:{} };
+jsToolBar.prototype.elements.tag.context = 'post';
+jsToolBar.prototype.elements.tag.icon = 'index.php?pf=tags/img/tag-add.png';
+jsToolBar.prototype.elements.tag.fn.wiki = function() {
+	this.encloseSelection('','',function(str) {
+		if (str == '') { window.alert(dotclear.msg.no_selection); return ''; }
+		if (str.indexOf(',') != -1) {
+			return str;
+		} else {
+			window.dc_tag_editor.addMeta(str);
+			return '['+str+'|tag:'+str+']';
 		}
 	});
+};
+jsToolBar.prototype.elements.tag.fn.xhtml = function() {
+	var url = this.elements.tag.url;
+	this.encloseSelection('','',function(str) {
+		if (str == '') { window.alert(dotclear.msg.no_selection); return ''; }
+		if (str.indexOf(',') != -1) {
+			return str;
+		} else {
+			window.dc_tag_editor.addMeta(str);
+			return '<a href="'+this.stripBaseURL(url+'/'+str)+'">'+str+'</a>';
+		}
+	});
+};
+jsToolBar.prototype.elements.tag.fn.wysiwyg = function() {
+	var t = this.getSelectedText();
 	
-	tinymce.PluginManager.add('dcTag', tinymce.plugins.dcTag);
-});
+	if (t == '') { window.alert(dotclear.msg.no_selection); return; }
+	if (t.indexOf(',') != -1) { return; }
+	
+	var n = this.getSelectedNode();
+	var a = document.createElement('a');
+	a.href = this.stripBaseURL(this.elements.tag.url+'/'+t);
+	a.appendChild(n);
+	this.insertNode(a);
+	window.dc_tag_editor.addMeta(t);
+};
Index: plugins/tags/style.css
===================================================================
--- plugins/tags/style.css	(revision 311)
+++ plugins/tags/style.css	(revision 0)
@@ -99,8 +99,2 @@
 	color: white;
 }
-
-.defaultSkin a.mce_tag img{
-	width: 16px;
-	height: 16px;
-	padding: 2px;
-}
Index: plugins/tags/tag_posts.php
===================================================================
--- plugins/tags/tag_posts.php	(revision 217)
+++ plugins/tags/tag_posts.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/tags/tags.php
===================================================================
--- plugins/tags/tags.php	(revision 0)
+++ plugins/tags/tags.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/themeEditor/_admin.php
===================================================================
--- plugins/themeEditor/_admin.php	(revision 0)
+++ plugins/themeEditor/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/themeEditor/_define.php
===================================================================
--- plugins/themeEditor/_define.php	(revision 0)
+++ plugins/themeEditor/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/themeEditor/class.themeEditor.php
===================================================================
--- plugins/themeEditor/class.themeEditor.php	(revision 0)
+++ plugins/themeEditor/class.themeEditor.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/themeEditor/index.php
===================================================================
--- plugins/themeEditor/index.php	(revision 219)
+++ plugins/themeEditor/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/userPref/index.php
===================================================================
--- plugins/userPref/index.php	(revision 220)
+++ plugins/userPref/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/_admin.php
===================================================================
--- plugins/widgets/_admin.php	(revision 159)
+++ plugins/widgets/_admin.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/_default_widgets.php
===================================================================
--- plugins/widgets/_default_widgets.php	(revision 0)
+++ plugins/widgets/_default_widgets.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -58,5 +58,5 @@
 $categories = array('' => '', __('Uncategorized') => 'null');
 while ($rs->fetch()) {
-	$categories[str_repeat('&nbsp;&nbsp;',$rs->level-1).'&bull; '.html::escapeHTML($rs->cat_title)] = $rs->cat_id;
+	$categories[str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title)] = $rs->cat_id;
 }
 $__widgets->lastposts->setting('category',__('Category:'),'','combo',$categories);
Index: plugins/widgets/_define.php
===================================================================
--- plugins/widgets/_define.php	(revision 0)
+++ plugins/widgets/_define.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/_install.php
===================================================================
--- plugins/widgets/_install.php	(revision 175)
+++ plugins/widgets/_install.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of widgets, a plugin for Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/_public.php
===================================================================
--- plugins/widgets/_public.php	(revision 0)
+++ plugins/widgets/_public.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/_widgets_functions.php
===================================================================
--- plugins/widgets/_widgets_functions.php	(revision 75)
+++ plugins/widgets/_widgets_functions.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/class.widgets.php
===================================================================
--- plugins/widgets/class.widgets.php	(revision 117)
+++ plugins/widgets/class.widgets.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: plugins/widgets/index.php
===================================================================
--- plugins/widgets/index.php	(revision 183)
+++ plugins/widgets/index.php	(revision 270)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
