Index: plugins/pages/_admin.php
===================================================================
--- plugins/pages/_admin.php	(revision 1886)
+++ plugins/pages/_admin.php	(revision 1891)
@@ -16,5 +16,4 @@
 $core->addBehavior('adminDashboardFavsIcon','pages_dashboard_favs_icon');
 $core->addBehavior('adminUsersActionsHeaders','pages_users_actions_headers');
-$core->addBehavior('adminPostsActionsContent','pages_posts_actions_content');
 
 function pages_dashboard($core,$icons)
@@ -44,39 +43,4 @@
 	}
 }
-
-function pages_posts_actions_content($core,$action,$hidden_fields,$form_uri="posts_actions.php")
-{
-	
-	if ($action == 'reorder' && !empty($_POST['order'])) {
-		try {
-			
-			foreach($_POST['order'] as $post_id => $value) {
-				
-				if (!$core->auth->check('publish,contentadmin',$core->blog->id))
-					throw new Exception(__('You are not allowed to change this entry status'));
-				
-				$strReq = "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ".
-						"AND post_id ".$core->con->in($post_id);
-				
-				#If user can only publish, we need to check the post's owner
-				if (!$core->auth->check('contentadmin',$core->blog->id))
-					$strReq .= "AND user_id = '".$core->con->escape($core->auth->userID())."' ";
-				
-				$cur = $core->con->openCursor($core->prefix.'post');
-				
-				$cur->post_position = (integer) $value-1;
-				$cur->post_upddt = date('Y-m-d H:i:s');
-				
-				$cur->update($strReq);
-				$core->blog->triggerBlog();
-				
-			}
-
-			http::redirect($_POST['redir']);
-		} catch (Exception $e) {
-			$core->error->add($e->getMessage());
-		}
-	}
-}
 function pages_users_actions_headers()
 {
Index: plugins/pages/page.php
===================================================================
--- plugins/pages/page.php	(revision 1553)
+++ plugins/pages/page.php	(revision 1625)
@@ -139,5 +139,7 @@
 			$core->media = new dcMedia($core);
 			$post_media = $core->media->getPostMedia($post_id);
-		} catch (Exception $e) {}
+		} catch (Exception $e) {
+			$core->error->add($e->getMessage());
+		}
 	}
 }
@@ -392,8 +394,110 @@
 
 
-/* Post form if we can edit post
+/* Post form if we can edit page
 -------------------------------------------------------- */
 if ($can_edit_page)
 {
+	$sidebar_items = new ArrayObject(array(
+		'status-box' => array(
+			'title' => __('Status'),
+			'items' => array(
+				'post_status' => 
+					'<p><label for="post_status" class="ib">'.__('Page status:').'</label> '.
+					form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
+					'</p>',
+				'post_dt' => 
+					'<p><label for="post_dt" class="ib">'.__('Publication date and hour').'</label>'.
+					form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).
+					'</p>',
+				'post_lang' =>
+					'<p><label for="post_lang" class="ib">'.__('Page lang:').'</label>'.
+					form::combo('post_lang',$lang_combo,$post_lang).
+					'</p>',
+				'post_format' =>
+					'<div>'.
+					'<h5 id="label_format"><label for="post_format" class="ib">'.__('Text formating').'</label></h5>'.
+					'<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal').
+					'</p>'.
+					'<p>'.($post_id && $post_format != 'xhtml' ? 
+					'<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'.
+					__('Convert to XHTML').'</a>' : '').'</p></div>')),
+		'metas-box' => array(
+			'title' => __('Ordering'),
+			'items' => array(
+				'post_position' => 
+					'<p><label for="post_position" class="classic">'.__('Page position:').'</label> '.
+					form::field('post_position',3,3,(string) $post_position).
+					'</p>')),
+		'options-box' => array(
+			'title' => __('Options'),
+			'items' => array(
+				'post_open_comment' =>
+					'<p><label for="post_open_comment" class="classic">'.
+					form::checkbox('post_open_comment',1,$post_open_comment).' '.
+					__('Accept comments').'</label></p>'.
+					($core->blog->settings->system->allow_comments ? 
+						(isContributionAllowed($post_id,strtotime($post_dt),true) ? 
+							'' :
+							'<p class="form-note warn">'.
+							__('Warning: Comments are not more accepted for this entry.').'</p>') : 
+						'<p class="form-note warn">'.
+						__('Comments are not accepted on this blog so far.').'</p>'),
+				'post_open_tb' =>
+					'<p><label for="post_open_tb" class="classic">'.
+					form::checkbox('post_open_tb',1,$post_open_tb).' '.
+					__('Accept trackbacks').'</label></p>'.
+					($core->blog->settings->system->allow_trackbacks ? 
+						(isContributionAllowed($post_id,strtotime($post_dt),false) ? 
+							'' :
+							'<p class="form-note warn">'.
+							__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
+						'<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>'),
+				'post_hide' =>	
+					'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
+					__('Hide in widget Pages').'</label>'.
+					'</p>',
+				'post_password' =>
+					'<p><label for="post_password" class="ib">'.__('Password').'</label>'.
+					form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
+					'</p>',
+				'post_url' =>
+					'<div class="lockable">'.
+					'<p><label for="post_url" class="ib">'.__('Edit basename').'</label>'.
+					form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
+					'</p>'.
+					'<p class="form-note warn">'.
+					__('Warning: If you set the URL manually, it may conflict with another entry.').
+					'</p></div>'
+	))));
+	$main_items = new ArrayObject(array(
+		"post_title" =>
+			'<p class="col">'.
+			'<label class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
+			form::field('post_title',20,255,html::escapeHTML($post_title),'maximal').
+			'</p>',
+		
+		"post_excerpt" =>
+			'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'.
+			__('Add an introduction to the post.').'</span></label> '.
+			form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
+			'</p>',
+		
+		"post_content" =>
+			'<p class="area"><label class="required" '.
+			'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
+			form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)).
+			'</p>',
+		
+		"post_notes" =>
+			'<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'.
+			__('Add unpublished notes.').'</span></label>'.
+			form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
+			'</p>'
+		)
+	);
+
+	# --BEHAVIOR-- adminPostFormItems
+	$core->callBehavior('adminPageFormItems',$main_items,$sidebar_items, isset($post) ? $post : null);
+
 	echo '<div class="multi-part" title="'.__('Edit page').'" id="edit-entry">';
 	echo '<form action="'.html::escapeURL($redir_url).'" method="post" id="entry-form">';
@@ -402,24 +506,8 @@
 	echo '<div id="entry-content"><div class="constrained">';
 	
-	echo
-	'<p class="col"><label for="post_title" class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
-	form::field('post_title',20,255,html::escapeHTML($post_title),'maximal').
-	'</p>'.
-	
-	'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').
-	'<span class="form-note">'.__('Add an introduction to the page.').'</span></label> '.
-	form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
-	'</p>'.
-	
-	'<p class="area"><label class="required" '.
-	'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
-	form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)).
-	'</p>';
-	
-	echo
-	'<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').
-	'<span class="form-note">'.__('Add unpublished notes.').'</span></label>'.
-	form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
-	'</p>';
+	
+	foreach ($main_items as $id => $item) {
+		echo $item;
+	}
 
 	# --BEHAVIOR-- adminPageForm
@@ -454,94 +542,11 @@
 	echo '<div id="entry-sidebar">';
 	
-	echo
-	'<p><label for="post_status" class="ib">'.__('Page status:').'</label> '.
-	form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
-	'</p>'.
-	
-	'<p><label for="post_dt" class="ib">'.__('Published on:').'</label>'.
-	form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).'</p>'.
-	
-	'<p><label for="post_format" class="ib">'.__('Text formating:').'</label>'.
-	form::combo('post_format',$formaters_combo,$post_format).
-	($post_id && $post_format != 'xhtml' ? '<a class="button" href="'.html::escapeURL($redir_url).'&amp;id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : '').
-	'</p>'.
-	
-	'<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '.
-	__('Accept comments').'</label></p>'.
-	($core->blog->settings->system->allow_comments ? 
-		(isContributionAllowed($post_id,strtotime($post_dt),true) ? 
-			'' :
-			'<p class="form-note warn">'.__('Warning: Comments are not more accepted for this page.').'</p>') : 
-		'<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>').
-
-	'<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '.
-	__('Accept trackbacks').'</label></p>'.
-	($core->blog->settings->system->allow_trackbacks ? 
-		(isContributionAllowed($post_id,strtotime($post_dt),false) ? 
-			'' :
-			'<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this page.').'</p>') : 
-		'<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>').
-	
-	'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
-	__('Hide').'</label></p>'.
-	'<p class="form-note">'.
-	__('If checked this page will be active but not listed in widget Pages.').
-	'</p>'.
-
-	'<p><label for="post_position" class="classic">'.__('Page position:').'</label> '.
-	form::field('post_position',3,3,(string) $post_position).
-	'</p>'.
-	
-	'<p><label for="post_lang" class="ib">'.__('Page lang:').'</label>'.
-	form::combo('post_lang',$lang_combo,$post_lang).'</p>'.
-	
-	'<p><label for="post_password" class="ib">'.__('Page password:').'</label>'.
-	form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
-	'</p>'.
-	
-	'<div class="lockable ib">'.
-	'<p><label for="post_url" class="ib">'.__('Basename:').'</label>'.
-	form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
-	'</p>'.
-	'<p class="form-note warn">'.
-	__('Warning: If you set the URL manually, it may conflict with another page.').
-	'</p>'.
-	'</div>';
-	
-	if ($post_id)
-	{
-		echo
-		'<h4 class="clear">'.__('Attachments').'</h4>';
-		foreach ($post_media as $f)
-		{
-			$ftitle = $f->media_title;
-			if (strlen($ftitle) > 18) {
-				$ftitle = substr($ftitle,0,16).'...';
-			}
-			echo
-			'<div class="media-item">'.
-			'<a class="media-icon" href="media_item.php?id='.$f->media_id.'">'.
-			'<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'.
-			'<ul>'.
-			'<li><a class="media-link" href="media_item.php?id='.$f->media_id.'"'.
-			'title="'.$f->basename.'">'.$ftitle.'</a></li>'.
-			'<li>'.$f->media_dtstr.'</li>'.
-			'<li>'.files::size($f->size).' - '.
-			'<a href="'.$f->file_url.'">'.__('open').'</a>'.'</li>'.
-			
-			'<li class="media-action"><a class="attachment-remove" id="attachment-'.$f->media_id.'" '.
-			'href="post_media.php?post_id='.$post_id.'&amp;media_id='.$f->media_id.'&amp;remove=1">'.
-			'<img src="images/check-off.png" alt="'.__('Remove').'" /></a>'.
-			'</li>'.
-			
-			'</ul>'.
-			'</div>';
-		}
-		unset($f);
-		
-		if (empty($post_media)) {
-			echo '<p class="form-note">'.__('No attachment.').'</p>';
-		}
-		echo '<p><a class="button" href="media.php?post_id='.$post_id.'">'.__('Add files to this page').'</a></p>';
+	foreach ($sidebar_items as $id => $c) {
+		echo '<div id="'.$id.'" class="box">'.
+			'<h4>'.$c['title'].'</h4>';
+		foreach ($c['items'] as $e_name=>$e_content) {
+			echo $e_content;
+		}
+		echo '</div>';
 	}
 	
@@ -552,5 +557,5 @@
 	
 	echo '</form>';
-	echo '</div>';
+	echo '</div>';		// End 
 	
 	if ($post_id && !empty($post_media))
@@ -595,4 +600,7 @@
 	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
 	
+	echo
+	'<p class="top-add"><a class="button add onblog_link" href="#comment-form">'.__('Add a comment').'</a></p>';
+
 	if ($has_action) {
 		echo '<form action="comments_actions.php" method="post">';
@@ -627,14 +635,9 @@
 		'</form>';
 	}
-	
-	echo '</div>';
-}
-
-/* Add a comment
--------------------------------------------------------- */
-if ($post_id)
-{
+		/* Add a comment
+	-------------------------------------------------------- */
+
 	echo
-	'<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'.
+	'<div class="fieldset clear">'.
 	'<h3>'.__('Add a comment').'</h3>'.
 	
@@ -653,5 +656,6 @@
 	'</p>'.
 	
-	'<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Comment:').'</label> '.
+	'<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '.
+	__('Comment:').'</label> '.
 	form::textarea('comment_content',50,8,html::escapeHTML('')).
 	'</p>'.
@@ -660,7 +664,9 @@
 	$core->formNonce().
 	'<input type="submit" name="add" value="'.__('Save').'" /></p>'.
-	'</div>'.
+	'</div>'. #constrained
+
 	'</form>'.
-	'</div>';
+	'</div>'. #add comment
+	'</div>'; #comments
 }
 
Index: plugins/pages/pages_actions.php
===================================================================
--- plugins/pages/pages_actions.php	(revision 1891)
+++ plugins/pages/pages_actions.php	(revision 1891)
@@ -0,0 +1,418 @@
+<?php
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
+
+if (!defined('DC_CONTEXT_ADMIN')) { return; }
+
+dcPage::check('usage,contentadmin');
+
+$params = array(
+	'post_type' => 'page'
+);
+
+/**
+* FieldsList - Compatibility class for hidden fields & entries[] fields
+*
+*/
+class FieldsList {
+	/** @var array list of hidden fields */
+	protected $hidden;
+	/** @var array list of selected entries */
+	protected $entries;
+
+
+   /**
+     * Class constructor
+	*/
+	public function __construct() {
+		$this->hidden=array();
+		$this->entries =array();
+	}
+
+    /**
+     * addHidden - adds a hidden field
+     * 
+     * @param string $name the field name.
+     * @param mixed $value the field value.
+     *
+     * @access public
+	 * @return the FieldsList instance, enabling to chain requests
+     */	
+	 public function addHidden($name,$value) {
+		$this->hidden[] = form::hidden($name,$value);
+		return $this;
+	}
+
+    /**
+     * addEntry - adds a antry field
+     * 
+     * @param string $id the entry id.
+     * @param mixed $title the entry title.
+     *
+     * @access public
+	 * @return the FieldsList instance, enabling to chain requests
+     */	
+	 public function addEntry($id,$title) {
+		$this->entries[$id]=$title;
+		return $this;
+	}
+
+    /**
+     * getHidden - returns the list of hidden fields, html encoded
+     *
+     * @access public
+	 * @return the list of hidden fields, html encoded
+     */
+	 public function getHidden() {
+		return join('',$this->hidden);
+	}
+	
+    /**
+     * getEntries - returns the list of entry fields, html encoded
+     *
+	 * @param boolean $hidden if set to true, returns entries as a list of hidden field
+	 *                if set to false, returns html code displaying the list of entries
+	 *                with a list of checkboxes to enable to select/deselect entries
+     * @access public
+	 * @return the list of entry fields, html encoded
+     */
+	public function getEntries ($hidden=false) {
+		$ret = '';
+		if ($hidden) {
+			foreach ($this->entries as $id=> $e) {
+				$ret .= form::hidden('entries[]',$id);
+			}
+		} else {
+			$ret = 
+				'<table class="posts-list"><tr>'.
+				'<th colspan="2">'.__('Title').'</th>'.
+				'</tr>';
+			foreach ($this->entries as $id=>$title) {
+				$ret .= 
+					'<tr><td>'.
+					form::checkbox(array('entries[]'),$id,true,'','').'</td>'.
+					'<td>'.	$title.'</td></tr>';
+			}
+			$ret .= '</table>';
+		}
+		return $ret;
+	}
+	
+    /**
+     * getEntriesQS - returns the list of entry fields as query string
+     *
+     * @access public
+	 * @return the list of entry fields, html encoded
+     */
+	public function getEntriesQS() {
+		$ret=array();
+		foreach ($this->entries as $id=>$title) {
+			$ret[] = 'entries[]='.$id;
+		}
+		return join('&',$ret);
+	}
+	
+    /**
+     * __toString - magic method. -- DEPRECATED here
+	 *              This method is only used to preserve compatibility with plugins 
+	 *				relying on previous versions of adminPostsActionsContent behavior, 
+	 *
+     * @access public
+	 * @return the list of hidden fields and entries (as hidden fields too), html encoded
+     */
+	public function __toString() {
+		return join('',$this->hidden).$this->getEntries(true);
+	}
+}
+
+$fields = new FieldsList();
+$posts_ids = array();
+
+if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false)
+{
+	$redir = $_POST['redir'];
+}
+else
+{
+	$redir =
+	'posts.php?user_id='.$_POST['user_id'].
+	'&cat_id='.$_POST['cat_id'].
+	'&status='.$_POST['status'].
+	'&selected='.$_POST['selected'].
+	'&month='.$_POST['month'].
+	'&lang='.$_POST['lang'].
+	'&sortby='.$_POST['sortby'].
+	'&order='.$_POST['order'].
+	'&page='.$_POST['page'].
+	'&nb='.$_POST['nb'];
+}
+$redir_sel = $redir;
+
+if (!empty($_POST['entries']))
+{
+	$entries = $_POST['entries'];
+	
+	foreach ($entries as $k => $v) {
+		$entries[$k] = (integer) $v;
+	}
+	
+	$params['sql'] = 'AND P.post_id IN('.implode(',',$entries).') ';
+	
+	if (!isset($_POST['full_content']) || empty($_POST['full_content'])) {
+		$params['no_content'] = true;
+	}
+	
+	if (isset($_POST['post_type'])) {
+		$params['post_type'] = $_POST['post_type'];
+	}
+	
+	$posts = $core->blog->getPosts($params);
+	while ($posts->fetch())	{
+		$posts_ids[] = $posts->post_id;
+		$fields->addEntry($posts->post_id,$posts->post_title);
+	}
+	// Redirection including selected entries
+	$redir_sel = $redir.'&'.$fields->getEntriesQS();
+
+} else {
+	$posts = $core->con->select("SELECT blog_id FROM ".$core->prefix."blog WHERE false");;
+}
+
+/* Actions
+-------------------------------------------------------- */
+if (!empty($_POST['reorder']))
+{
+ 	$action = 'reorder';
+}
+elseif (!empty($_POST['action']))
+{
+	$action = $_POST['action'];
+} 
+else
+{
+	$core->error->add(__('No action specified.'));
+	dcPage::open(
+		__('Entries'),'',dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Entries actions').'</span>' => ''
+		))
+	);
+	
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
+	dcPage::close();
+	exit;
+}
+
+# --BEHAVIOR-- adminPostsActions
+$core->callBehavior('adminPostsActions',$core,$posts,$action,$redir);
+
+if (preg_match('/^(publish|unpublish|schedule|pending)$/',$action))
+{
+	switch ($action) {
+		case 'unpublish' : $status = 0; break;
+		case 'schedule' : $status = -1; break;
+		case 'pending' : $status = -2; break;
+		default : $status = 1; break;
+	}
+	
+	try
+	{
+		$core->blog->updPostsStatus($posts_ids,$status);
+		
+		http::redirect($redir_sel.'&upd=1');
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ($action == 'delete')
+{
+	try
+	{
+		// Backward compatibility
+		foreach($posts_ids as $post_id)
+		{
+			# --BEHAVIOR-- adminBeforePostDelete
+			$core->callBehavior('adminBeforePostDelete',(integer) $post_id);
+		}
+		
+		# --BEHAVIOR-- adminBeforePostsDelete
+		$core->callBehavior('adminBeforePostsDelete',$posts_ids);
+		
+		$core->blog->delPosts($posts_ids);
+		
+		http::redirect($redir."&del=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+	
+}
+elseif ($action == 'author' && isset($_POST['new_auth_id']) && $core->auth->check('admin',$core->blog->id))
+{
+	$new_user_id = $_POST['new_auth_id'];
+	
+	try
+	{
+		if ($core->getUser($new_user_id)->isEmpty()) {
+			throw new Exception(__('This user does not exist'));
+		}
+		
+		$cur = $core->con->openCursor($core->prefix.'post');
+		$cur->user_id = $new_user_id;
+		$cur->update('WHERE post_id '.$core->con->in($posts_ids));
+		
+		http::redirect($redir_sel."&upd=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ( $action == 'reorder' && isset($_POST['order']))
+{
+	try {
+		
+		foreach($_POST['order'] as $post_id => $value) {
+			
+			if (!$core->auth->check('publish,contentadmin',$core->blog->id))
+				throw new Exception(__('You are not allowed to change this entry status'));
+			
+			$strReq = "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ".
+					"AND post_id ".$core->con->in($post_id);
+			
+			#If user can only publish, we need to check the post's owner
+			if (!$core->auth->check('contentadmin',$core->blog->id))
+				$strReq .= "AND user_id = '".$core->con->escape($core->auth->userID())."' ";
+			
+			$cur = $core->con->openCursor($core->prefix.'post');
+			
+			$cur->post_position = (integer) $value-1;
+			$cur->post_upddt = date('Y-m-d H:i:s');
+			
+			$cur->update($strReq);
+			$core->blog->triggerBlog();
+			
+		}
+
+		http::redirect($redir."&reo=1");
+	} catch (Exception $e) {
+		$core->error->add($e->getMessage());
+	}
+}
+
+/* DISPLAY
+-------------------------------------------------------- */
+// Get current users list
+$usersList = '';
+if ($action == 'author' && $core->auth->check('admin',$core->blog->id)) {
+	$params = array(
+		'limit' => 100,
+		'order' => 'nb_post DESC'
+		);
+	$rs = $core->getUsers($params);
+	while ($rs->fetch())
+	{
+		$usersList .= ($usersList != '' ? ',' : '').'"'.$rs->user_id.'"';
+	}
+}
+?>
+
+<html>
+<head>
+  <title><?php echo __('Pages'); ?></title>
+  <?php
+  	echo '<script type="text/javascript">'."\n".
+	"//<![CDATA[\n".
+	'usersList = ['.$usersList.']'."\n".
+	"\n//]]>\n".
+	"</script>\n".
+	dcPage::jsLoad('js/jquery/jquery.autocomplete.js').
+	dcPage::jsLoad('js/_posts_actions.js').
+	dcPage::jsMetaEditor().
+	# --BEHAVIOR-- adminBeforePostDelete
+	$core->callBehavior('adminPostsActionsHeaders');
+  ?>
+  <script type="text/javascript">
+  //<![CDATA[
+  <?php echo dcPage::jsVar('dotclear.msg.confirm_delete_posts',__("Are you sure you want to delete selected pages?")); ?>
+  //]]>
+  </script>
+</head>
+<body>
+
+<?php
+if (!isset($action)) {
+?>
+</body>
+</html>
+<?php
+	exit;
+}
+
+if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false)
+{
+	$fields->addHidden(array('redir'),html::escapeURL($_POST['redir']));
+}
+else
+{
+	$fields
+		->addHidden(array('user_id'),$_POST['user_id'])
+		->addHidden(array('cat_id'),$_POST['cat_id'])
+		->addHidden(array('status'),$_POST['status'])
+		->addHidden(array('selected'),$_POST['selected'])
+		->addHidden(array('month'),$_POST['month'])
+		->addHidden(array('lang'),$_POST['lang'])
+		->addHidden(array('sortby'),$_POST['sortby'])
+		->addHidden(array('order'),$_POST['order'])
+		->addHidden(array('page'),$_POST['page'])
+		->addHidden(array('nb'),$_POST['nb'])
+	;
+}
+
+if (isset($_POST['post_type'])) {
+	$fields->addHidden(array('post_type'),$_POST['post_type']);
+}
+
+# --BEHAVIOR-- adminPostsActionsContent
+$core->callBehavior('adminPostsActionsContent',$core,$action,$fields);
+
+if ($action == 'author' && $core->auth->check('admin',$core->blog->id))
+{
+	echo dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Change author for entries').'</span>' => ''
+	));
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
+	echo
+	'<form action="posts_actions.php" method="post">'.
+	$fields->getEntries().
+	'<p><label for="new_auth_id" class="classic">'.__('New author (author ID):').'</label> '.
+	form::field('new_auth_id',20,255);
+	
+	echo
+	$fields->getHidden().
+	$core->formNonce().
+	form::hidden(array('action'),'author').
+	'<input type="submit" value="'.__('Save').'" /></p>'.
+	'</form>';
+}
+?>
+</body>
+</html>
