Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 1317)
+++ admin/auth.php	(revision 1310)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -14,5 +14,6 @@
 
 # If we have a session cookie, go to index.php
-if (isset($_SESSION['sess_user_id'])) {
+if (isset($_SESSION['sess_user_id']))
+{
 	http::redirect('index.php');
 }
@@ -22,7 +23,18 @@
 $dlang = http::getAcceptLanguage();
 $dlang = ($dlang == '' ? 'en' : $dlang);
-if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang)) {
+if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang))
+{
 	l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main');
 }
+
+$page_url = http::getHost().$_SERVER['REQUEST_URI'];
+
+$change_pwd = $core->auth->allowPassChange() && isset($_POST['new_pwd']) && isset($_POST['new_pwd_c']) && isset($_POST['login_data']);
+$login_data = !empty($_POST['login_data']) ? html::escapeHTML($_POST['login_data']) : null;
+$recover = $core->auth->allowPassChange() && !empty($_REQUEST['recover']);
+$safe_mode = !empty($_REQUEST['safe_mode']);
+$akey = $core->auth->allowPassChange() && !empty($_GET['akey']) ? $_GET['akey'] : null;
+$user_id = $user_pwd = $user_key = $user_email = null;
+$err = $msg = null;
 
 # Auto upgrade
@@ -31,307 +43,390 @@
 	try {
 		if (($changes = dotclearUpgrade($core)) !== false) {
-			$_ctx->setAlert(__('Dotclear has been upgraded.').'<!-- '.$changes.' -->');
-		}
-	}
-	catch (Exception $e) {
-		$_ctx->addError($e->getMessage());
-	}
-}
-
-/**
-Actions for authentication on admin pages
-*/
-class adminPageAuth
-{
-	# Send new password from recover email
-	public static function send($akey)
-	{
-		global $core, $_ctx;
-		
-		$_ctx->akey = true;
-		
-		try	{
-			$recover_res = $core->auth->recoverUserPassword($akey);
-			
-			$subject = mb_encode_mimeheader('DotClear '.__('Your new password'),'UTF-8','B');
-			$message =
-			__('Username:').' '.$recover_res['user_id']."\n".
-			__('Password:').' '.$recover_res['new_pass']."\n\n".
-			preg_replace('/\?(.*)$/','',http::getHost().$_SERVER['REQUEST_URI']);
-			
-			$headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST'];
-			$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
-			
-			mail::sendMail($recover_res['user_email'],$subject,$message,$headers);
-			$_ctx->setAlert(__('Your new password is in your mailbox.'));
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-	}
-	
-	# Authentication process
-	public static function process($form,$user_id,$user_pwd,$user_key=null)
-	{
-		global $core, $_ctx;
-		
-		# We check the user
-		$check_user = $core->auth->checkUser($user_id,$user_pwd,$user_key) === true;
-		
-		$cookie_admin = http::browserUID(DC_MASTER_KEY.$user_id.
-			crypt::hmac(DC_MASTER_KEY,$user_pwd)).bin2hex(pack('a32',$user_id));
-		
-		if ($check_user && $core->auth->mustChangePassword())
-		{
-			$form->login_data = join('/',array(
-				base64_encode($user_id),
-				$cookie_admin,
-				$form->user_remember == '' ? '0' : '1'
-			));
-			
-			if (!$core->auth->allowPassChange()) {
-				$_ctx->addError(__('You have to change your password before you can login.'));
-			} else {
-				$_ctx->addError(__('In order to login, you have to change your password now.'));
-				$_ctx->change_pwd = true;
-			}
-		}
-		elseif ($check_user && $form->safe_mode != '' && !$core->auth->isSuperAdmin()) 
-		{
-			$_ctx->addError(__('Safe Mode can only be used for super administrators.'));
-		}
-		elseif ($check_user)
-		{
-			$core->session->start();
-			$_SESSION['sess_user_id'] = $user_id;
-			$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
-			
-			if ($form->blog != '') {
-				$_SESSION['sess_blog_id'] = $form->blog;
-			}
-			
-			if ($form->safe_mode != '' && $core->auth->isSuperAdmin()) {
-				$_SESSION['sess_safe_mode'] = true;
-			}
-			
-			if ($form->user_remember != '') {
-				setcookie('dc_admin',$cookie_admin,strtotime('+15 days'),'','',DC_ADMIN_SSL);
-			}
-			
-			http::redirect('index.php');
-		}
-		else
-		{
-			if (isset($_COOKIE['dc_admin'])) {
-				unset($_COOKIE['dc_admin']);
-				setcookie('dc_admin',false,-600,'','',DC_ADMIN_SSL);
-			}
-			$_ctx->addError(__('Wrong username or password'));
-		}
-	}
-	
-	# Login form action
-	public static function login($form)
-	{
-		global $_ctx;
-		
-		if ($form->user_id != '' && $form->user_pwd != '') {
-			self::process($form,$form->user_id,$form->user_pwd);
-		}
-		
-		# Send post values to form
-		$form->user_id = $form->user_id;
-	}
-
-	# Recover password form action
-	public static function recover($form)
-	{
-		global $core, $_ctx;
-		
-		if ($form->user_id == '' || $form->user_email == '') {
-			return;
-		}
-		
-		$user_id = $form->user_id;
-		$user_email = $form->user_email;
-		$page_url = http::getHost().$_SERVER['REQUEST_URI'];
-		
-		try {
-			$recover_key = $core->auth->setRecoverKey($user_id,$user_email);
-			
-			$subject = mail::B64Header('DotClear '.__('Password reset'));
-			$message =
-			__('Someone has requested to reset the password for the following site and username.')."\n\n".
-			$page_url."\n".__('Username:').' '.$user_id."\n\n".
-			__('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.')."\n".
-			$page_url.'?akey='.$recover_key;
-			
-			$headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
-			$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
-			
-			mail::sendMail($user_email,$subject,$message,$headers);
-			$_ctx->setAlert(sprintf(__('The e-mail was sent successfully to %s.'),$user_email));
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-		
-		# Send post values to form
-		$form->user_id = $form->user_id;
-		$form->user_email = $form->user_email;
-	}
-
-	# Change password form action
-	public static function change($form)
-	{
-		global $core, $_ctx;
-		
-		if ($form->login_data) {
-			return;
-		}
-		$_ctx->change_pwd = true;
-		
-		$new_pwd = (string) $form->new_pwd;
-		$new_pwd_c = (string) $form->new_pwd_c;
-		
-		try {
-			$tmp_data = explode('/',$form->login_data);
-			if (count($tmp_data) != 3) {
-				throw new Exception();
-			}
-			$data = array(
-				'user_id'=>base64_decode($tmp_data[0]),
-				'cookie_admin'=>$tmp_data[1],
-				'user_remember'=>$tmp_data[2]=='1'
-			);
-			if ($data['user_id'] === false) {
-				throw new Exception();
-			}
-			
-			# Check login informations
-			$check_user = false;
-			if (isset($data['cookie_admin']) && strlen($data['cookie_admin']) == 104)
-			{
-				$user_id = substr($data['cookie_admin'],40);
-				$user_id = @unpack('a32',@pack('H*',$user_id));
-				if (is_array($user_id))
-				{
-					$user_id = $user_id[1];
-					$user_key = substr($data['cookie_admin'],0,40);
-					$check_user = $core->auth->checkUser($user_id,null,$user_key) === true;
-				}
-			}
-			
-			if (!$core->auth->allowPassChange() || !$check_user) {
-				$_ctx->change_pwd = false;
-				throw new Exception();
-			}
-			
-			if ($new_pwd != $new_pwd_c) {
-				throw new Exception(__("Passwords don't match"));
-			}
-			
-			if ($core->auth->checkUser($user_id,$new_pwd) === true) {
-				throw new Exception(__("You didn't change your password."));
-			}
-			
-			$cur = $core->con->openCursor($core->prefix.'user');
-			$cur->user_change_pwd = 0;
-			$cur->user_pwd = $new_pwd;
-			$core->updUser($core->auth->userID(),$cur);
-			
-			$core->session->start();
-			$_SESSION['sess_user_id'] = $user_id;
-			$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
-			
-			if ($data['user_remember']) {
-				setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL);
-			}
-			
-			http::redirect('index.php');
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-		
-		# Send post values to form
-		$form->login_data = $form->login_data;
-	}
-}
-
-# Form fields
-$form = new dcForm($core,'auth','auth.php');
-$form
-	->addField(
-		new dcFieldText('user_id','',array(
-			"label" => __('Username:'))))
-	->addField(
-		new dcFieldPassword('user_pwd','',array(
-			"label" => __('Password:'))))
-	->addField(
-		new dcFieldText('user_email','',array(
-			"label" => __('Email:'))))
-	->addField(
-		new dcFieldPassword('new_pwd','',array(
-			"label" => __('New password:'))))
-	->addField(
-		new dcFieldPassword('new_pwd_c','',array(
-			"label" => __('Confirm password:'))))
-	->addField(
-		new dcFieldCheckbox ('user_remember',1,array(
-			"label" => __('Remember my ID on this computer'))))
-	->addField(
-		new dcFieldSubmit('auth_login',__('log in'),array(
-			'action' => array('adminPageAuth','login'))))
-	->addField(
-		new dcFieldSubmit('auth_recover',__('recover'),array(
-			'action' => array('adminPageAuth','recover'))))
-	->addField(
-		new dcFieldSubmit('auth_change',__('change'),array(
-			'action' => array('adminPageAuth','change'))))
-	->addField(
-		new dcFieldHidden ('safe_mode','0'))
-	->addField(
-		new dcFieldHidden ('recover','0'))
-	->addField(
-		new dcFieldHidden ('login_data',''))
-	->addField(
-		new dcFieldHidden ('blog',''));
-
-# Context variables
-$_ctx->allow_pass_change = $core->auth->allowPassChange();
-$_ctx->change_pwd = $core->auth->allowPassChange() && $form->new_pwd != '' && $form->new_pwd_c != '' && $form->login_data != '';
-$_ctx->recover = $form->recover = $core->auth->allowPassChange() && !empty($_REQUEST['recover']);
-$_ctx->setSafeMode(!empty($_REQUEST['safe_mode'])); 
-$form->safe_mode = !empty($_REQUEST['safe_mode']);
-$_ctx->akey = false;
-
-# If we have no POST login informations and have COOKIE login informations, go throug auth process
-if ($form->user_id == '' && $form->user_pwd == '' 
- && isset($_COOKIE['dc_admin']) && strlen($_COOKIE['dc_admin']) == 104) {
-
+			$msg = __('Dotclear has been upgraded.').'<!-- '.$changes.' -->';
+		}
+	} catch (Exception $e) {
+		$err = $e->getMessage();
+	}
+}
+
+# If we have POST login informations, go throug auth process
+if (!empty($_POST['user_id']) && !empty($_POST['user_pwd']))
+{
+	$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
+	$user_pwd = !empty($_POST['user_pwd']) ? $_POST['user_pwd'] : null;
+}
+# If we have COOKIE login informations, go throug auth process
+elseif (isset($_COOKIE['dc_admin']) && strlen($_COOKIE['dc_admin']) == 104)
+{
 	# If we have a remember cookie, go through auth process with user_key
 	$user_id = substr($_COOKIE['dc_admin'],40);
 	$user_id = @unpack('a32',@pack('H*',$user_id));
-	
-	if (is_array($user_id)) {
+	if (is_array($user_id))
+	{
 		$user_id = $user_id[1];
 		$user_key = substr($_COOKIE['dc_admin'],0,40);
-		$user_pwd = '';
-		
-		adminPageAuth::process($form,$user_id,$user_pwd,$user_key);
-	}
-}
-# If we have an akey, go throug send password process
-elseif ($core->auth->allowPassChange() && !empty($_GET['akey'])) {
-	adminPageAuth::send($_GET['akey']);
+		$user_pwd = null;
+	}
+	else
+	{
+		$user_id = null;
+	}
+}
+
+# Recover password
+if ($recover && !empty($_POST['user_id']) && !empty($_POST['user_email']))
+{
+	$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
+	$user_email = !empty($_POST['user_email']) ? $_POST['user_email'] : '';
+	try
+	{
+		$recover_key = $core->auth->setRecoverKey($user_id,$user_email);
+		
+		$subject = mail::B64Header('DotClear '.__('Password reset'));
+		$message =
+		__('Someone has requested to reset the password for the following site and username.')."\n\n".
+		$page_url."\n".__('Username:').' '.$user_id."\n\n".
+		__('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.')."\n".
+		$page_url.'?akey='.$recover_key;
+		
+		$headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
+		$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
+		
+		mail::sendMail($user_email,$subject,$message,$headers);
+		$msg = sprintf(__('The e-mail was sent successfully to %s.'),$user_email);
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Send new password
+elseif ($akey)
+{
+	try
+	{
+		$recover_res = $core->auth->recoverUserPassword($akey);
+		
+		$subject = mb_encode_mimeheader('DotClear '.__('Your new password'),'UTF-8','B');
+		$message =
+		__('Username:').' '.$recover_res['user_id']."\n".
+		__('Password:').' '.$recover_res['new_pass']."\n\n".
+		preg_replace('/\?(.*)$/','',$page_url);
+		
+		$headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST'];
+		$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
+		
+		mail::sendMail($recover_res['user_email'],$subject,$message,$headers);
+		$msg = __('Your new password is in your mailbox.');
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Change password and retry to log
+elseif ($change_pwd)
+{
+	try
+	{
+		$tmp_data = explode('/',$_POST['login_data']);
+		if (count($tmp_data) != 3) {
+			throw new Exception();
+		}
+		$data = array(
+			'user_id'=>base64_decode($tmp_data[0]),
+			'cookie_admin'=>$tmp_data[1],
+			'user_remember'=>$tmp_data[2]=='1'
+		);
+		if ($data['user_id'] === false) {
+			throw new Exception();
+		}
+		
+	# Check login informations
+	$check_user = false;
+	if (isset($data['cookie_admin']) && strlen($data['cookie_admin']) == 104)
+	{
+		$user_id = substr($data['cookie_admin'],40);
+		$user_id = @unpack('a32',@pack('H*',$user_id));
+		if (is_array($user_id))
+		{
+			$user_id = $user_id[1];
+			$user_key = substr($data['cookie_admin'],0,40);
+			$check_user = $core->auth->checkUser($user_id,null,$user_key) === true;
+		}
+	}
+	
+		if (!$core->auth->allowPassChange() || !$check_user) {
+			$change_pwd = false;
+			throw new Exception();
+		}
+		
+		if ($_POST['new_pwd'] != $_POST['new_pwd_c']) {
+			throw new Exception(__("Passwords don't match"));
+		}
+		
+		if ($core->auth->checkUser($user_id,$_POST['new_pwd']) === true) {
+			throw new Exception(__("You didn't change your password."));
+		}
+		
+		$cur = $core->con->openCursor($core->prefix.'user');
+		$cur->user_change_pwd = 0;
+		$cur->user_pwd = $_POST['new_pwd'];
+		$core->updUser($core->auth->userID(),$cur);
+		
+		$core->session->start();
+		$_SESSION['sess_user_id'] = $user_id;
+		$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
+		
+		if ($data['user_remember'])
+		{
+			setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL);
+		}
+		
+		http::redirect('index.php');
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Try to log
+elseif ($user_id !== null && ($user_pwd !== null || $user_key !== null))
+{
+	# We check the user
+	$check_user = $core->auth->checkUser($user_id,$user_pwd,$user_key) === true;
+	
+	$cookie_admin = http::browserUID(DC_MASTER_KEY.$user_id.
+		crypt::hmac(DC_MASTER_KEY,$user_pwd)).bin2hex(pack('a32',$user_id));
+	
+	if ($check_user && $core->auth->mustChangePassword())
+	{
+		$login_data = join('/',array(
+			base64_encode($user_id),
+			$cookie_admin,
+			empty($_POST['user_remember'])?'0':'1'
+		));
+		
+		if (!$core->auth->allowPassChange()) {
+			$err = __('You have to change your password before you can login.');
+		} else {
+			$err = __('In order to login, you have to change your password now.');
+			$change_pwd = true;
+		}
+	}
+	elseif ($check_user && !empty($_POST['safe_mode']) && !$core->auth->isSuperAdmin()) 
+	{
+		$err = __('Safe Mode can only be used for super administrators.');
+	}
+	elseif ($check_user)
+	{
+		$core->session->start();
+		$_SESSION['sess_user_id'] = $user_id;
+		$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
+		
+		if (!empty($_POST['blog'])) {
+			$_SESSION['sess_blog_id'] = $_POST['blog'];
+		}
+		
+		if (!empty($_POST['safe_mode']) && $core->auth->isSuperAdmin()) {
+			$_SESSION['sess_safe_mode'] = true;
+		}
+		
+		if (!empty($_POST['user_remember'])) {
+			setcookie('dc_admin',$cookie_admin,strtotime('+15 days'),'','',DC_ADMIN_SSL);
+		}
+		
+		http::redirect('index.php');
+	}
+	else
+	{
+		if (isset($_COOKIE['dc_admin'])) {
+			unset($_COOKIE['dc_admin']);
+			setcookie('dc_admin',false,-600,'','',DC_ADMIN_SSL);
+		}
+		$err = __('Wrong username or password');
+	}
 }
 
 if (isset($_GET['user'])) {
-	$form->user_id = $_GET['user'];
-}
-
-$form->setup();
-
-$core->tpl->display('auth.html.twig');
+	$user_id = $_GET['user'];
+}
+
+header('Content-Type: text/html; charset=UTF-8');
 ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+xml:lang="<?php echo $dlang; ?>" lang="<?php echo $dlang; ?>">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <meta http-equiv="Content-Style-Type" content="text/css" />
+  <meta http-equiv="Content-Language" content="<?php echo $dlang; ?>" />
+  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
+  <meta name="GOOGLEBOT" content="NOSNIPPET" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></title>
+  
+<?php
+echo dcPage::jsLoadIE7();
+echo dcPage::jsCommon();
+?>
+  
+	<link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />
+	 
+  <?php
+  # --BEHAVIOR-- loginPageHTMLHead
+  $core->callBehavior('loginPageHTMLHead');
+  ?>
+  
+  <script type="text/javascript">
+  //<![CDATA[
+  $(window).load(function() {
+    var uid = $('input[name=user_id]');
+    var upw = $('input[name=user_pwd]');
+    uid.focus();
+    
+    if (upw.length == 0) { return; }
+    
+    if ($.browser.mozilla) {
+      uid.keypress(processKey);
+    } else {
+      uid.keydown(processKey);
+    }
+    function processKey(evt) {
+      if (evt.keyCode == 13 && upw.val() == '') {
+         upw.focus();
+	    return false;
+      }
+	 return true;
+    };
+    $.cookie('dc_admin_test_cookie',true);
+    if ($.cookie('dc_admin_test_cookie')) {
+      $('#cookie_help').hide();
+      $.cookie('dc_admin_test_cookie', '', {'expires': -1});
+    } else {
+      $('#cookie_help').show();
+    }
+    $('#issue #more').toggleWithLegend($('#issue').children().not('#more'));
+  });
+  //]]>
+  </script>
+</head>
+
+<body id="dotclear-admin" class="auth">
+
+<form action="auth.php" method="post" id="login-screen">
+<h1><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></h1>
+
+<?php
+if ($err) {
+	echo '<div class="error">'.$err.'</div>';
+}
+if ($msg) {
+	echo '<p class="message">'.$msg.'</p>';
+}
+
+if ($akey)
+{
+	echo '<p><a href="auth.php">'.__('Back to login screen').'</a></p>';
+}
+elseif ($recover)
+{
+	echo
+	'<fieldset><legend>'.__('Request a new password').'</legend>'.
+	'<p><label for="user_id">'.__('Username:').'</label> '.
+	form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id)).'</p>'.
+	
+	'<p><label for="user_email">'.__('Email:').'</label> '.
+	form::field(array('user_email','user_email'),20,255,html::escapeHTML($user_email)).'</p>'.
+	
+	'<p><input type="submit" value="'.__('recover').'" />'.
+	form::hidden(array('recover'),1).'</p>'.
+	'</fieldset>'.
+	
+	'<div id="issue">'.
+	'<p><a href="auth.php">'.__('Back to login screen').'</a></p></div>';
+}
+elseif ($change_pwd)
+{
+	echo
+	'<fieldset><legend>'.__('Change your password').'</legend>'.
+	'<p><label for="new_pwd">'.__('New password:').'</label> '.
+	form::password(array('new_pwd','new_pwd'),20,255).'</p>'.
+	
+	'<p><label for="new_pwd_c">'.__('Confirm password:').'</label> '.
+	form::password(array('new_pwd_c','new_pwd_c'),20,255).'</p>'.
+	'</fielset>'.
+	
+	'<p><input type="submit" value="'.__('change').'" />'.
+	form::hidden('login_data',$login_data).'</p>';
+}
+else
+{
+	if (is_callable(array($core->auth,'authForm')))
+	{
+		echo $core->auth->authForm($user_id);
+	}
+	else
+	{
+		if ($safe_mode) {
+			echo '<fieldset>';
+			echo '<legend>'.__('Safe mode login').'</legend>';
+			echo 
+				'<p class="form-note info">'.
+				__('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems').'&nbsp;<br />'.
+				__('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.').
+				'</p>';
+		}
+		else {
+			echo '<div class="fieldset">';
+		}
+
+		echo
+		'<p><label for="user_id">'.__('Username:').'</label> '.
+		form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id)).'</p>'.
+		
+		'<p><label for="user_pwd">'.__('Password:').'</label> '.
+		form::password(array('user_pwd','user_pwd'),20,255).'</p>'.
+		
+		'<p>'.
+		form::checkbox(array('user_remember','user_remember'),1).
+		'<label for="user_remember" class="classic">'.
+		__('Remember my ID on this computer').'</label></p>'.
+		
+		'<p><input class="add button" type="submit" value="'.__('log in').'" /></p>';
+		
+		if (!empty($_REQUEST['blog'])) {
+			echo form::hidden('blog',html::escapeHTML($_REQUEST['blog']));
+		}
+		if($safe_mode) {
+			echo 
+			form::hidden('safe_mode',1).
+			'</fieldset>';
+		}
+		else {
+			echo '</div>';
+		}
+		echo
+		'<p id="cookie_help" class="error">'.__('You must accept cookies in order to use the private area.').'</p>';
+
+		echo '<div id="issue">';
+		
+		if ($safe_mode) {
+			echo
+			'<p><a href="auth.php" id="normal_mode_link">'.__('Get back to normal authentication').'</a></p>';
+		} else {
+			echo '<p id="more"><strong>'.__('Connection issue?').'</strong></p>';
+			if ($core->auth->allowPassChange()) {
+				echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
+			}
+			echo '<p><a href="auth.php?safe_mode=1" id="safe_mode_link">'.__('I want to log in in safe mode').'</a></p>';
+		}
+		
+		echo '</div>';
+	}
+}
+?>
+</form>
+</body>
+</html>
Index: admin/blog.php
===================================================================
--- admin/blog.php	(revision 1328)
+++ admin/blog.php	(revision 1399)
@@ -67,27 +67,27 @@
 else
 {
-	dcPage::open(__('New blog'),dcPage::jsConfirmClose('blog-form'));
-	
-	echo dcPage::breadcrumb(
-		array(
-			__('System') => '',
-			__('Blogs') => 'blogs.php',
-			'<span class="page-title">'.__('New blog').'</span>' => ''
-		));
+	dcPage::open(__('New blog'),dcPage::jsConfirmClose('blog-form'),
+		dcPage::breadcrumb(
+			array(
+				__('System') => '',
+				__('Blogs') => 'blogs.php',
+				'<span class="page-title">'.__('New blog').'</span>' => ''
+			))
+	);
 	
 	echo
-	'<form action="blog.php" method="post" id="blog-form" class="fieldset">'.
+	'<form action="blog.php" method="post" id="blog-form">'.
 	
 	$core->formNonce().
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').' '.
-	form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</label></p>'.
+	'<p><label class="required" for="blog_id"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').'</label> '.
+	form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</p>'.
 	'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '.
 	'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>'.
 	
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').' '.
-	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</label></p>'.
+	'<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '.
+	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</p>'.
 	
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').' '.
-	form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</label></p>'.
+	'<p><label class="required" for="blog_url"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').'</label> '.
+	form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</p>'.
 	
 	'<p class="area"><label for="blog_desc">'.__('Blog description:').'</label> '.
Index: admin/blog_del.php
===================================================================
--- admin/blog_del.php	(revision 1332)
+++ admin/blog_del.php	(revision 1399)
@@ -49,15 +49,15 @@
 }
 
-dcPage::open(__('Delete a blog'));
-
-if (!$core->error->flag())
-{
-	echo dcPage::breadcrumb(
+dcPage::open(__('Delete a blog'),'',
+	dcPage::breadcrumb(
 		array(
 			__('System') => '',
 			__('Blogs') => 'blogs.php',
 			'<span class="page-title">'.__('Delete a blog').'</span>' => ''
-		));
+		))
+);
 
+if (!$core->error->flag())
+{
 	echo
 	'<p class="message">'.__('Warning').'</p>'.
@@ -69,6 +69,6 @@
 	'<form action="blog_del.php" method="post">'.
 	'<div>'.$core->formNonce().'</div>'.
-	'<p><label for="pwd">'.__('Your password:').' '.
-	form::password('pwd',20,255).'</label></p>'.
+	'<p><label for="pwd">'.__('Your password:').'</label> '.
+	form::password('pwd',20,255).'</p>'.
 	'<p><input type="submit" class="delete" name="del" value="'.__('Delete this blog').'" />'.
 	form::hidden('blog_id',$blog_id).'</p>'.
Index: admin/blog_pref.php
===================================================================
--- admin/blog_pref.php	(revision 1332)
+++ admin/blog_pref.php	(revision 1399)
@@ -252,4 +252,19 @@
 }
 
+if ($standalone) {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($blog_name) => '',
+			'<span class="page-title">'.__('Blog settings').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Blogs') => 'blogs.php',
+			'<span class="page-title">'.__('Blog settings').' : '.html::escapeHTML($blog_name).'</span>' => ''
+		));
+}
+
 dcPage::open(__('Blog settings'),
 	'<script type="text/javascript">'."\n".
@@ -268,24 +283,10 @@
 	$core->callBehavior('adminBlogPreferencesHeaders').
 	
-	dcPage::jsPageTabs()
+	dcPage::jsPageTabs(),
+	$breadcrumb
 );
 
 if ($blog_id)
 {
-	if ($standalone) {
-		echo dcPage::breadcrumb(
-			array(
-				html::escapeHTML($blog_name) => '',
-				'<span class="page-title">'.__('Blog settings').'</span>' => ''
-			));
-	} else {
-		echo dcPage::breadcrumb(
-			array(
-				__('System') => '',
-				__('Blogs') => 'blogs.php',
-				'<span class="page-title">'.__('Blog settings').' : '.html::escapeHTML($blog_name).'</span>' => ''
-			));
-	}
-	
 	if (!empty($_GET['add'])) {
 		dcPage::message(__('Blog has been successfully created.'));
@@ -308,6 +309,6 @@
 	{
 		echo
-		'<p><label for="blog_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').
-		form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</label></p>'.
+		'<p><label for="blog_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').'</label>'.
+		form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</p>'.
 		'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '.
 		'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';
@@ -315,18 +316,18 @@
 	
 	echo
-	'<p><label for="blog_name" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').
-	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</label></p>';
+	'<p><label for="blog_name" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label>'.
+	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</p>';
 	
 	if ($core->auth->isSuperAdmin())
 	{
 		echo
-		'<p><label for="blog_url" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').
-		form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</label></p>'.
-		
-		'<p><label for="url_scan">'.__('URL scan method:').
-		form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'</label></p>'.
-		
-		'<p><label for="blog_status">'.__('Blog status:').
-		form::combo('blog_status',$status_combo,$blog_status).'</label></p>';
+		'<p><label for="blog_url" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').'</label>'.
+		form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</p>'.
+		
+		'<p><label for="url_scan">'.__('URL scan method:').'</label>'.
+		form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'</p>'.
+		
+		'<p><label for="blog_status">'.__('Blog status:').'</label>'.
+		form::combo('blog_status',$status_combo,$blog_status).'</p>';
 	}
 	
@@ -341,33 +342,33 @@
 	'<div class="two-cols">'.
 	'<div class="col">'.
-	'<p><label for="editor">'.__('Blog editor name:').
+	'<p><label for="editor">'.__('Blog editor name:').'</label>'.
 	form::field('editor',30,255,html::escapeHTML($blog_settings->system->editor)).
-	'</label></p>'.
-	
-	'<p><label for="lang">'.__('Default language:').
+	'</p>'.
+	
+	'<p><label for="lang">'.__('Default language:').'</label>'.
 	form::combo('lang',$lang_combo,$blog_settings->system->lang,'l10n').
-	'</label></p>'.
-	
-	'<p><label for="blog_timezone">'.__('Blog timezone:').
+	'</p>'.
+	
+	'<p><label for="blog_timezone">'.__('Blog timezone:').'</label>'.
 	form::combo('blog_timezone',dt::getZones(true,true),html::escapeHTML($blog_settings->system->blog_timezone)).
-	'</label></p>'.
-
-	'<p><label for="copyright_notice">'.__('Copyright notice:').
+	'</p>'.
+
+	'<p><label for="copyright_notice">'.__('Copyright notice:').'</label>'.
 	form::field('copyright_notice',30,255,html::escapeHTML($blog_settings->system->copyright_notice)).
-	'</label></p>'.
-	'</div>'.
-	
-	'<div class="col">'.
-	'<p><label for="post_url_format">'.__('New post URL format:').
+	'</p>'.
+	'</div>'.
+	
+	'<div class="col">'.
+	'<p><label for="post_url_format">'.__('New post URL format:').'</label>'.
 	form::combo('post_url_format',$post_url_combo,html::escapeHTML($blog_settings->system->post_url_format)).
-	'</label></p>'.
-
-	'<p><label for="note_title_tag">'.__('Note title HTML tag:').
+	'</p>'.
+
+	'<p><label for="note_title_tag">'.__('Note title HTML tag:').'</label>'.
 	form::combo('note_title_tag',$note_title_tag_combo,$blog_settings->system->note_title_tag).
-	'</label></p>'.
-		
-	'<p><label for="enable_xmlrpc" class="classic">'.
+	'</p>'.
+		
+	'<p><label for="enable_xmlrpc" class="classic">'.'</label>'.
 	form::checkbox('enable_xmlrpc','1',$blog_settings->system->enable_xmlrpc).
-	__('Enable XML/RPC interface').'</label></p>';
+	__('Enable XML/RPC interface').'</p>';
 
 	echo
@@ -441,11 +442,11 @@
 	'<div class="two-cols">'.
 	'<div class="col">'.
-	'<p><label for="date_format">'.__('Date format:').
+	'<p><label for="date_format">'.__('Date format:').'</label>'.
 	form::field('date_format',30,255,html::escapeHTML($blog_settings->system->date_format)).
-	'</label></p>'.
-	
-	'<p><label for="time_format">'.__('Time format:').
+	'</p>'.
+	
+	'<p><label for="time_format">'.__('Time format:').'</label>'.
 	form::field('time_format',30,255,html::escapeHTML($blog_settings->system->time_format)).
-	'</label></p>'.
+	'</p>'.
 	
 	'<p><label for="use_smilies" class="classic">'.
@@ -499,11 +500,11 @@
 
 	'<h4>'.__('Default image insertion attributes').'</h4>'.
-	'<p><label for="media_img_default_size">'.__('Image size:').
+	'<p><label for="media_img_default_size">'.__('Image size:').'</label>'.
 	form::combo('media_img_default_size',$img_default_size_combo,
 		(html::escapeHTML($blog_settings->system->media_img_default_size) != '' ? html::escapeHTML($blog_settings->system->media_img_default_size) : 'm')).
-	'</label></p>'.
-	'<p><label for="media_img_default_alignment">'.__('Image alignment').
+	'</p>'.
+	'<p><label for="media_img_default_alignment">'.__('Image alignment').'</label>'.
 	form::combo('media_img_default_alignment',$img_default_alignment_combo,html::escapeHTML($blog_settings->system->media_img_default_alignment)).
-	'</label></p>'.
+	'</p>'.
 	'<p><label for="media_img_default_link" class="classic">'.
 	form::checkbox('media_img_default_link','1',$blog_settings->system->media_img_default_link).
Index: admin/blog_theme.php
===================================================================
--- admin/blog_theme.php	(revision 1332)
+++ admin/blog_theme.php	(revision 1399)
@@ -207,18 +207,29 @@
 }
 
-dcPage::open(__('Blog appearance'),
-	(!$theme_conf_mode ? dcPage::jsLoad('js/_blog_theme.js') : '').
-	dcPage::jsPageTabs($default_tab).
-	dcPage::jsColorPicker()
-);
-
 if (!$theme_conf_mode)
 {
-	echo dcPage::breadcrumb(
+	$breadcrumb = dcPage::breadcrumb(
 		array(
 			html::escapeHTML($core->blog->name) => '',
 			'<span class="page-title">'.__('Blog appearance').'</span>' => ''
 		));
-	
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Blog appearance') => 'blog_theme.php',
+			'<span class="page-title">'.__('Theme configuration').'</span>' => ''
+		));
+}
+
+dcPage::open(__('Blog appearance'),
+	(!$theme_conf_mode ? dcPage::jsLoad('js/_blog_theme.js') : '').
+	dcPage::jsPageTabs($default_tab).
+	dcPage::jsColorPicker(),
+	$breadcrumb
+);
+
+if (!$theme_conf_mode)
+{
 	if (!empty($_GET['upd'])) {
 		dcPage::message(__('Theme has been successfully changed.'));
@@ -296,8 +307,8 @@
 			'<fieldset>'.
 			'<legend>'.__('Upload a zip file').'</legend>'.
-			'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file:').' '.
-			'<input type="file" name="pkg_file" id="pkg_file" /></label></p>'.
-			'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-			form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
+			'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file:').'</label> '.
+			'<input type="file" name="pkg_file" id="pkg_file" /></p>'.
+			'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+			form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
 			'<input type="submit" name="upload_pkg" value="'.__('Upload theme').'" />'.
 			$core->formNonce().
@@ -310,8 +321,8 @@
 			'<fieldset>'.
 			'<legend>'.__('Download a zip file').'</legend>'.
-			'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file URL:').' '.
-			form::field(array('pkg_url','pkg_url'),40,255).'</label></p>'.
-			'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-			form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
+			'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file URL:').'</label> '.
+			form::field(array('pkg_url','pkg_url'),40,255).'</p>'.
+			'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+			form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
 			'<input type="submit" name="fetch_pkg" value="'.__('Download theme').'" />'.
 			$core->formNonce().
@@ -334,11 +345,4 @@
 	$core->themes->loadModuleL10Nresources($core->blog->settings->system->theme,$_lang);
 
-	echo dcPage::breadcrumb(
-		array(
-			html::escapeHTML($core->blog->name) => '',
-			__('Blog appearance') => 'blog_theme.php',
-			'<span class="page-title">'.__('Theme configuration').'</span>' => ''
-		));
-
 	echo
 	'<p><a class="back" href="blog_theme.php">'.__('back').'</a></p>';
Index: admin/blogs.php
===================================================================
--- admin/blogs.php	(revision 1332)
+++ admin/blogs.php	(revision 1358)
@@ -73,15 +73,15 @@
 	$starting_script .= dcPage::jsLoad('js/filter-controls.js');
 }
-dcPage::open(__('List of blogs'),$starting_script);
+dcPage::open(__('List of blogs'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('List of blogs').'</span>' => ''
+		))
+);
 
 if (!empty($_GET['del'])) {
 	dcPage::message(__('Blog has been successfully deleted.'));
 }
-
-echo dcPage::breadcrumb(
-	array(
-		__('System') => '',
-		'<span class="page-title">'.__('List of blogs').'</span>' => ''
-	));
 
 if (!$core->error->flag())
Index: admin/categories.php
===================================================================
--- admin/categories.php	(revision 1332)
+++ admin/categories.php	(revision 1399)
@@ -73,5 +73,10 @@
 dcPage::open(__('Categories'),
 	dcPage::jsToolMan()."\n".
-	dcPage::jsLoad('js/_categories.js')
+	dcPage::jsLoad('js/_categories.js'),
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Categories').'</span>' => ''
+		))
 );
 
@@ -88,10 +93,4 @@
 	dcPage::message(__('The category has been successfully moved.'));
 }
-
-echo dcPage::breadcrumb(
-	array(
-		html::escapeHTML($core->blog->name) => '',
-		'<span class="page-title">'.__('Categories').'</span>' => ''
-	));
 
 $rs = $core->blog->getCategories(array('post_type'=>'post'));
@@ -148,8 +147,8 @@
 
 '<form action="category.php" method="post">'.
-'<fieldset><legend>'.__('Add a new category').'</legend>'.
-'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '.
-form::field('cat_title',30,255).'</label></p>'.
-'<p><label for="new_cat_parent">'.__('Parent:').' '.
+'<h3>'.__('Add a new category').'</h3>'.
+'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label> '.
+form::field('cat_title',30,255).'</p>'.
+'<p><label for="new_cat_parent">'.__('Parent:').'</label> '.
 '<select id="new_cat_parent" name="new_cat_parent">'.
 '<option value="0">'.__('Top level').'</option>';
@@ -160,8 +159,7 @@
 }
 echo
-'</select></label></p>'.
-'<p><input type="submit" value="'.__('Create').'" /></p>'.
-$core->formNonce().
-'</fieldset>'.
+'</select></p>'.
+'<p><input type="submit" value="'.__('Create').'" />'.
+$core->formNonce().'</p>'.
 '</form>';
 
@@ -188,23 +186,21 @@
 	
 	echo
-	'<form action="categories.php" method="post" id="delete-category">'.
-	'<fieldset><legend>'.__('Remove a category').'</legend>'.
-	'<p><label for="del_cat">'.__('Choose a category to remove:').' '.
-	form::combo('del_cat',$cats).'</label></p> '.
-	'<p><label for="mov_cat">'.__('And choose the category which will receive its entries:').' '.
-	form::combo('mov_cat',$dest).'</label></p> '.
-	'<p><input type="submit" value="'.__('Delete').'" class="delete" /></p>'.
-	$core->formNonce().
-	'</fieldset>'.
+	'<form action="categories.php" method="post" id="delete-category" class="border-top">'.
+	'<h3>'.__('Remove a category').'</h3>'.
+	'<p><label for="del_cat">'.__('Choose a category to remove:').'</label> '.
+	form::combo('del_cat',$cats).'</p> '.
+	'<p><label for="mov_cat">'.__('And choose the category which will receive its entries:').'</label> '.
+	form::combo('mov_cat',$dest).'</p> '.
+	'<p><input type="submit" value="'.__('Delete').'" class="delete" />'.
+	$core->formNonce().'</p>'.
 	'</form>';
 	
 	echo
-	'<form action="categories.php" method="post" id="reset-order">'.
-	'<fieldset><legend>'.__('Reorder categories').'</legend>'.
+	'<form action="categories.php" method="post" id="reset-order" class="border-top">'.
+	'<h3>'.__('Reorder categories').'</h3>'.
 	'<p>'.__('This will relocate all categories on the top level').'</p> '.
-	'<p><input type="submit" value="'.__('Reorder').'" /></p>'.
+	'<p><input type="submit" value="'.__('Reorder').'" />'.
 	form::hidden(array('reset'),1).
-	$core->formNonce().
-	'</fieldset>'.
+	$core->formNonce().'</p>'.
 	'</form>';
 }
Index: admin/category.php
===================================================================
--- admin/category.php	(revision 1332)
+++ admin/category.php	(revision 1399)
@@ -157,14 +157,4 @@
 $title = $cat_id ? html::escapeHTML($cat_title) : __('New category');
 
-dcPage::open($title,
-	dcPage::jsConfirmClose('category-form').
-	dcPage::jsToolBar().
-	dcPage::jsLoad('js/_category.js')
-);
-
-if (!empty($_GET['upd'])) {
-	dcPage::message(__('Category has been successfully updated.'));
-}
-
 $elements = array(
 	html::escapeHTML($core->blog->name) => '',
@@ -177,12 +167,22 @@
 }
 $elements['<span class="page-title">'.$title.'</span>'] = '';
-echo dcPage::breadcrumb($elements);
+
+dcPage::open($title,
+	dcPage::jsConfirmClose('category-form').
+	dcPage::jsToolBar().
+	dcPage::jsLoad('js/_category.js'),
+	dcPage::breadcrumb($elements)
+);
+
+if (!empty($_GET['upd'])) {
+	dcPage::message(__('Category has been successfully updated.'));
+}
 
 echo
 '<form action="category.php" method="post" id="category-form">'.
-'<fieldset><legend>'.__('Category information').'</legend>'.
-'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '.
+'<h3>'.__('Category information').'</h3>'.
+'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label> '.
 form::field('cat_title',40,255,html::escapeHTML($cat_title)).
-'</label></p>';
+'</p>';
 if (!$cat_id)
 {
@@ -202,6 +202,7 @@
 echo
 '<div class="lockable">'.
-'<p><label for="cat_url">'.__('URL:').' '.form::field('cat_url',40,255,html::escapeHTML($cat_url)).
-'</label></p>'.
+'<p><label for="cat_url">'.__('URL:').'</label> '
+.form::field('cat_url',40,255,html::escapeHTML($cat_url)).
+'</p>'.
 '<p class="form-note warn" id="note-cat-url">'.
 __('Warning: If you set the URL manually, it may conflict with another category.').'</p>'.
@@ -216,5 +217,4 @@
 $core->formNonce().
 '</p>'.
-'</fieldset>'.
 '</form>';
 
@@ -222,5 +222,5 @@
 {
 	echo
-	'<h3>'.__('Move this category').'</h3>'.
+	'<h3 class="border-top">'.__('Move this category').'</h3>'.
 	'<div class="two-cols">'.
 	'<div class="col">'.
@@ -228,6 +228,6 @@
 	'<form action="category.php" method="post">'.
 	'<fieldset><legend>'.__('Category parent').'</legend>'.
-	'<p><label for="cat_parent" class="classic">'.__('Parent:').' '.
-	form::combo('cat_parent',$allowed_parents,$cat_parent).'</label></p>'.
+	'<p><label for="cat_parent" class="classic">'.__('Parent:').'</label> '.
+	form::combo('cat_parent',$allowed_parents,$cat_parent).'</p>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 	form::hidden(array('id'),$cat_id).$core->formNonce().'</p>'.
Index: admin/comment.php
===================================================================
--- admin/comment.php	(revision 1332)
+++ admin/comment.php	(revision 1399)
@@ -160,4 +160,20 @@
 /* DISPLAY
 -------------------------------------------------------- */
+if ($comment_id) {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			html::escapeHTML($post_title) => $core->getPostAdminURL($post_type,$post_id).'&amp;co=1#c'.$comment_id,
+			'<span class="page-title">'.__('Edit comment').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			html::escapeHTML($post_title) => $core->getPostAdminURL($post_type,$post_id),
+			'<span class="page-title">'.__('Edit comment').'</span>' => ''
+		));
+}
+
 dcPage::open(__('Edit comment'),
 	dcPage::jsConfirmClose('comment-form').
@@ -165,5 +181,6 @@
 	dcPage::jsLoad('js/_comment.js').
 	# --BEHAVIOR-- adminCommentHeaders
-	$core->callBehavior('adminCommentHeaders')
+	$core->callBehavior('adminCommentHeaders'),
+	$breadcrumb
 );
 
@@ -183,36 +200,33 @@
 		.'">'.__('Send an e-mail').'</a>';
 	}
-	
-	echo dcPage::breadcrumb(
-		array(
-			html::escapeHTML($core->blog->name) => '',
-			html::escapeHTML($post_title) => $core->getPostAdminURL($post_type,$post_id).'&amp;co=1#c'.$comment_id,
-			'<span class="page-title">'.__('Edit comment').'</span>' => ''
-		));
 
 	echo
 	'<form action="comment.php" method="post" id="comment-form">'.
-	'<p>'.__('IP address:').'<br /> '.
+	'<div class="fieldset">'.
+	'<h3>'.__('Information collected').'</h3>'.
+	'<p>'.__('IP address:').' '.
 	'<a href="comments.php?ip='.$comment_ip.'">'.$comment_ip.'</a></p>'.
 	
-	'<p>'.__('Date:').'<br /> '.
+	'<p>'.__('Date:').' '.
 	dt::dt2str(__('%Y-%m-%d %H:%M'),$comment_dt).'</p>'.
-	
-	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr>'.__('Author:').
+	'</div>'.
+
+	'<h3>'.__('Comment submitted').'</h3>'.	
+	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr>'.__('Author:').'</label>'.
 	form::field('comment_author',30,255,html::escapeHTML($comment_author)).
-	'</label></p>'.
-	
-	'<p><label for="comment_email">'.__('Email:').
+	'</p>'.
+	
+	'<p><label for="comment_email">'.__('Email:').'</label>'.
 	form::field('comment_email',30,255,html::escapeHTML($comment_email)).
-	$comment_mailto.
-	'</label></p>'.
-	
-	'<p><label for="comment_site">'.__('Web site:').
+	'<span>'.$comment_mailto.'</span>'.
+	'</p>'.
+	
+	'<p><label for="comment_site">'.__('Web site:').'</label>'.
 	form::field('comment_site',30,255,html::escapeHTML($comment_site)).
-	'</label></p>'.
-	
-	'<p><label for="comment_status">'.__('Status:').
+	'</p>'.
+	
+	'<p><label for="comment_status">'.__('Status:').'</label>'.
 	form::combo('comment_status',$status_combo,$comment_status,'','',!$can_publish).
-	'</label></p>'.
+	'</p>'.
 	
 	# --BEHAVIOR-- adminAfterCommentDesc
Index: admin/comments.php
===================================================================
--- admin/comments.php	(revision 1332)
+++ admin/comments.php	(revision 1358)
@@ -169,11 +169,11 @@
 $starting_script .= $core->callBehavior('adminCommentsHeaders');
 
-dcPage::open(__('Comments and trackbacks'),$starting_script);
-
-echo dcPage::breadcrumb(
-	array(
-		html::escapeHTML($core->blog->name) => '',
-		'<span class="page-title">'.__('Comments and trackbacks').'</span>' => ''
-	));
+dcPage::open(__('Comments and trackbacks'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Comments and trackbacks').'</span>' => ''
+		))
+);
 
 if (!$core->error->flag())
Index: admin/index.php
===================================================================
--- admin/index.php	(revision 1414)
+++ admin/index.php	(revision 1399)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -13,9 +13,4 @@
 if (!empty($_GET['pf'])) {
 	require dirname(__FILE__).'/../inc/load_plugin_file.php';
-	exit;
-}
-if (!empty($_GET['tf'])) {
-	define('DC_CONTEXT_ADMIN',true);
-	require dirname(__FILE__).'/../inc/load_theme_file.php';
 	exit;
 }
@@ -48,35 +43,6 @@
 $plugins_install = $core->plugins->installModules();
 
-# Send plugins install messages to templates
-if (!empty($plugins_install['success'])) {
-	$_ctx->addMessagesList(__('Following plugins have been installed:'),$plugins_install['success']);
-}
-if (!empty($plugins_install['failure'])) {
-	$_ctx->addMessagesList(__('Following plugins have not been installed:'),$plugins_install['failure']);
-}
-
-# Send plugins errors messages to templates
-$_ctx->modules_errors = $core->auth->isSuperAdmin() ? $core->plugins->getErrors() : array();
-
-# Send Dotclear updates notifications to tempaltes
-$_ctx->updater = array();
-if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) {
-
-	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
-	$new_v = $updater->check(DC_VERSION);
-	$version_info = $new_v ? $updater->getInfoURL() : '';
-	
-	if ($updater->getNotify() && $new_v) {
-		$_ctx->updater = array(
-			'new_version'	=> $new_v,
-			'version_info'	=> $version_info
-		);
-	}
-}
-
 # Check dashboard module prefs
 $ws = $core->auth->user_prefs->addWorkspace('dashboard');
-
-# Doclinks prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('doclinks')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('doclinks',true)) {
@@ -85,12 +51,4 @@
 	$core->auth->user_prefs->dashboard->put('doclinks',true,'boolean');
 }
-
-# Send doclinks to templates
-$_ctx->dashboard_doclinks = array();
-if ($core->auth->user_prefs->dashboard->doclinks && !empty($__resources['doc'])) {
-	$_ctx->dashboard_doclinks = $__resources['doc'];
-}
-
-# Dcnews prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('dcnews')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('dcnews',true)) {
@@ -99,35 +57,4 @@
 	$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean');
 }
-
-# Send dcnews to templates
-$_ctx->dashboard_dcnews = array();
-if ($core->auth->user_prefs->dashboard->dcnews && !empty($__resources['rss_news'])) {
-	try
-	{
-		$feed_reader = new feedReader;
-		$feed_reader->setCacheDir(DC_TPL_CACHE);
-		$feed_reader->setTimeout(2);
-		$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
-		$feed = $feed_reader->parse($__resources['rss_news']);
-		if ($feed) {
-			$items = array();
-			$i = 1;
-			foreach ($feed->items as $item) {
-				$items[] = array(
-					'title' => $item->title,
-					'link' => isset($item->link) ? $item->link : '',
-					'date' => dt::dt2str(__('%d %B %Y'),$item->pubdate,'Europe/Paris'),
-					'content' => html::clean($item->content)
-				);
-				$i++;
-				if ($i > 3) { break; }
-			}
-			$_ctx->dashboard_dcnews = $items;
-		}
-	}
-	catch (Exception $e) {}
-}
-
-# Quick entry prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) {
@@ -135,55 +62,4 @@
 	}
 	$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean');
-}
-
-# Send quick entry to templates
-$_ctx->dashboard_quickentry = false;
-if ($core->auth->user_prefs->dashboard->quickentry &&$core->auth->check('usage,contentadmin',$core->blog->id))
-{
-	$categories_combo = array('&nbsp;' => '');
-	try {
-		$categories = $core->blog->getCategories(array('post_type'=>'post'));
-		while ($categories->fetch()) {
-			$categories_combo[$categories->cat_id] = 
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).
-				($categories->level-1 == 0 ? '' : '&bull; ').
-				html::escapeHTML($categories->cat_title);
-		}
-	} catch (Exception $e) { }
-	
-	$form = new dcForm($core,array('quickentry','quick-entry'),'post.php');
-	$form
-		->addField(
-			new dcFieldText('post_title','', array(
-				'size'		=> 20,
-				'required'	=> true,
-				'label'		=> __('Title'))))
-		->addField(
-			new dcFieldTextArea('post_content','', array(
-				'required'	=> true,
-				'label'		=> __("Content:"))))
-		->addField(
-			new dcFieldCombo('cat_id','',$categories_combo,array(
-				"label" => __('Category:'))))
-		->addField(
-			new dcFieldSubmit('save',__('Save'),array(
-				'action' => 'savePost')))
-		->addField(
-			new dcFieldHidden ('post_status',-2))
-		->addField(
-			new dcFieldHidden ('post_format',$core->auth->getOption('post_format')))
-		->addField(
-			new dcFieldHidden ('post_excerpt',''))
-		->addField(
-			new dcFieldHidden ('post_lang',$core->auth->getInfo('user_lang')))
-		->addField(
-			new dcFieldHidden ('post_notes',''))
-	;
-	if ($core->auth->check('publish',$core->blog->id)) {
-		$form->addField(
-			new dcFieldHidden ('save-publish',__('Save and publish')));
-	}
-	
-	$_ctx->dashboard_quickentry = true;
 }
 
@@ -242,67 +118,254 @@
 }
 
-# Send dashboard icons to templates
-$icons = array();
-foreach ($__dashboard_icons as $i) {
-	$icons[] = array(
-		'title' 	=> $i[0],
-		'url' 	=> $i[1],
-		'img' 	=> dc_admin_icon_url($i[2])
-	);
-}
-$_ctx->dashboard_icons = $icons;
-
-# Dashboard items
+# Latest news for dashboard
 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject));
+
+$dashboardItem = 0;
+
+if ($core->auth->user_prefs->dashboard->dcnews) {
+	try
+	{
+		if (empty($__resources['rss_news'])) {
+			throw new Exception();
+		}
+	
+		$feed_reader = new feedReader;
+		$feed_reader->setCacheDir(DC_TPL_CACHE);
+		$feed_reader->setTimeout(2);
+		$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
+		$feed = $feed_reader->parse($__resources['rss_news']);
+		if ($feed)
+		{
+			$latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">';
+			$i = 1;
+			foreach ($feed->items as $item)
+			{
+				$dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' '.__('(external link)').'">'.
+					$item->title.'</a>' : $item->title;
+			
+				if ($i < 3) {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd><p><strong>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</strong> '.
+					'<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>';
+				} else {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</dd>';
+				}
+				$i++;
+				if ($i > 3) { break; }
+			}
+			$latest_news .= '</dl>';
+			$__dashboard_items[$dashboardItem][] = $latest_news;
+			$dashboardItem++;
+		}
+	}
+	catch (Exception $e) {}
+}
+
+# Documentation links
+if ($core->auth->user_prefs->dashboard->doclinks) {
+	if (!empty($__resources['doc']))
+	{
+		$doc_links = '<h3>'.__('Documentation and support').'</h3><ul>';
+	
+		foreach ($__resources['doc'] as $k => $v) {
+			$doc_links .= '<li><a href="'.$v.'" title="'.$k.' '.__('(external link)').'">'.$k.'</a></li>';
+		}
+	
+		$doc_links .= '</ul>';
+		$__dashboard_items[$dashboardItem][] = $doc_links;
+		$dashboardItem++;
+	}
+}
+
 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
 
-# Send dashboard items to templates
-$items = array();
-foreach ($__dashboard_items as $i) {	
-	if ($i->count() > 0) {
-		foreach ($i as $v) {
-			$items[] = $v;
-		}
-	}
-}
-$_ctx->dashboard_items = $items;
-
 # Dashboard content
+$dashboardContents = '';
 $__dashboard_contents = new ArrayObject(array(new ArrayObject,new ArrayObject));
 $core->callBehavior('adminDashboardContents', $core, $__dashboard_contents);
 
-# Send dashboard contents to templates
-$contents = array();
-foreach ($__dashboard_contents as $i) {	
-	if ($i->count() > 0) {
+/* DISPLAY
+-------------------------------------------------------- */
+dcPage::open(__('Dashboard'),
+	dcPage::jsToolBar().
+	dcPage::jsLoad('js/_index.js').
+	# --BEHAVIOR-- adminDashboardHeaders
+	$core->callBehavior('adminDashboardHeaders'),
+	dcPage::breadcrumb(
+		array(
+		'<span class="page-title">'.__('Dashboard').' : '.html::escapeHTML($core->blog->name).'</span>' => ''
+		),
+		false)
+);
+
+if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) {
+	echo
+	'<p><a href="index.php?default_blog=1" class="button">'.__('Make this blog my default blog').'</a></p>';
+}
+
+if ($core->blog->status == 0) {
+	echo '<p class="static-msg">'.__('This blog is offline').'</p>';
+} elseif ($core->blog->status == -1) {
+	echo '<p class="static-msg">'.__('This blog is removed').'</p>';
+}
+
+if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
+	echo
+	'<p class="static-msg">'.
+	sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL').
+	' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.').
+	'</p>';
+}
+
+if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) {
+	echo
+	'<p class="static-msg">'.
+	sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM').
+	' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.').
+	'</p>';
+}
+
+# Plugins install messages
+if (!empty($plugins_install['success']))
+{
+	echo '<div class="static-msg">'.__('Following plugins have been installed:').'<ul>';
+	foreach ($plugins_install['success'] as $k => $v) {
+		echo '<li>'.$k.'</li>';
+	}
+	echo '</ul></div>';
+}
+if (!empty($plugins_install['failure']))
+{
+	echo '<div class="error">'.__('Following plugins have not been installed:').'<ul>';
+	foreach ($plugins_install['failure'] as $k => $v) {
+		echo '<li>'.$k.' ('.$v.')</li>';
+	}
+	echo '</ul></div>';
+}
+
+# Dashboard columns (processed first, as we need to know the result before displaying the icons.)
+$dashboardItems = '';
+
+# Dotclear updates notifications
+if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS))
+{
+	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
+	$new_v = $updater->check(DC_VERSION);
+	$version_info = $new_v ? $updater->getInfoURL() : '';
+	
+	if ($updater->getNotify() && $new_v) {
+		$dashboardItems .=
+		'<div id="upg-notify" class="static-msg"><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '.
+		'<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'.
+		'</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'.
+		($version_info ? ' </li><li><a href="'.$version_info.'">'.__('information about this version').'</a>' : '').
+		'</li></ul></div>';
+	}
+}
+
+# Errors modules notifications
+if ($core->auth->isSuperAdmin())
+{
+	$list = array();
+	foreach ($core->plugins->getErrors() as $k => $error) {
+		$list[] = '<li>'.$error.'</li>';
+	}
+	
+	if (count($list) > 0) {
+		$dashboardItems .=
+		'<div id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '.
+		'<ul>'.implode("\n",$list).'</ul></div>';
+	}
+	
+}
+
+foreach ($__dashboard_items as $i)
+{	
+	if ($i->count() > 0)
+	{
+		$dashboardItems .= '<div class="db-item">';
 		foreach ($i as $v) {
-			$contents[] = $v;
-		}
-	}
-}
-$_ctx->dashboard_contents = $contents;
-
-# Blog status message
-if ($core->blog->status == 0) {
-	$_ctx->addMessageStatic(__('This blog is offline'));
-} elseif ($core->blog->status == -1) {
-	$_ctx->addMessageStatic(__('This blog is removed'));
-}
-
-# Config errors messages
-if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
-	$_ctx->addMessageStatic(
-		sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL').' '.
-		__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.')
-	);
-}
-if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) {
-	$_ctx->addMessageStatic(
-		sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM').' '.
-		__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.')
-	);
-}
-
-$_ctx->setBreadCrumb(__('Dashboard').' : '.html::escapeHTML($core->blog->name), false);
-$core->tpl->display('index.html.twig');
+			$dashboardItems .= $v;
+		}
+		$dashboardItems .= '</div>';
+	}
+}
+
+# Dashboard icons
+echo '<div id="dashboard-main"'.($dashboardItems ? '' : ' class="fullwidth"').'><div id="icons">';
+foreach ($__dashboard_icons as $i)
+{
+	echo
+	'<p><a href="'.$i[1].'"><img src="'.dc_admin_icon_url($i[2]).'" alt="" />'.
+	'<br /><span>'.$i[0].'</span></a></p>';
+}
+echo '</div>';
+
+if ($core->auth->user_prefs->dashboard->quickentry) {
+	if ($core->auth->check('usage,contentadmin',$core->blog->id))
+	{
+		$categories_combo = array('&nbsp;' => '');
+		try {
+			$categories = $core->blog->getCategories(array('post_type'=>'post'));
+			while ($categories->fetch()) {
+				$categories_combo[] = new formSelectOption(
+					str_repeat('&nbsp;&nbsp;',$categories->level-1).
+					($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+					$categories->cat_id
+				);
+			}
+		} catch (Exception $e) { }
+	
+		echo
+		'<div id="quick">'.
+		'<h3>'.__('Quick entry').'</h3>'.
+		'<form id="quick-entry" action="post.php" method="post">'.
+		'<fieldset><legend>'.__('New entry').'</legend>'.
+		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
+		form::field('post_title',20,255,'','maximal').
+		'</p>'.
+		'<p class="area"><label class="required" '.
+		'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
+		form::textarea('post_content',50,7).
+		'</p>'.
+		'<p><label for="cat_id" class="classic">'.__('Category:').'</label> '.
+		form::combo('cat_id',$categories_combo).'</p>'.
+		'<p><input type="submit" value="'.__('Save').'" name="save" /> '.
+		($core->auth->check('publish',$core->blog->id)
+			? '<input type="hidden" value="'.__('Save and publish').'" name="save-publish" />'
+			: '').
+		$core->formNonce().
+		form::hidden('post_status',-2).
+		form::hidden('post_format',$core->auth->getOption('post_format')).
+		form::hidden('post_excerpt','').
+		form::hidden('post_lang',$core->auth->getInfo('user_lang')).
+		form::hidden('post_notes','').
+		'</p>'.
+		'</fieldset>'.
+		'</form>'.
+		'</div>';
+	}
+}
+
+foreach ($__dashboard_contents as $i)
+{	
+	if ($i->count() > 0)
+	{
+		$dashboardContents .= '<div>';
+		foreach ($i as $v) {
+			$dashboardContents .= $v;
+		}
+		$dashboardContents .= '</div>';
+	}
+}
+echo ($dashboardContents ? '<div id="dashboard-contents">'.$dashboardContents.'</div>' : '');
+
+echo '</div>';
+
+echo ($dashboardItems ? '<div id="dashboard-items">'.$dashboardItems.'</div>' : '');
+
+dcPage::close();
 ?>
Index: admin/install/index.php
===================================================================
--- admin/install/index.php	(revision 1280)
+++ admin/install/index.php	(revision 1399)
@@ -320,19 +320,19 @@
 	'<form action="index.php" method="post">'.
 	'<fieldset><legend>'.__('User information').'</legend>'.
-	'<p><label for="u_firstname">'.__('First Name:').' '.
-	form::field('u_firstname',30,255,html::escapeHTML($u_firstname)).'</label></p>'.
-	'<p><label for="u_name">'.__('Last Name:').' '.
-	form::field('u_name',30,255,html::escapeHTML($u_name)).'</label></p>'.
-	'<p><label for="u_email">'.__('Email:').' '.
-	form::field('u_email',30,255,html::escapeHTML($u_email)).'</label></p>'.
+	'<p><label for="u_firstname">'.__('First Name:').'</label> '.
+	form::field('u_firstname',30,255,html::escapeHTML($u_firstname)).'</p>'.
+	'<p><label for="u_name">'.__('Last Name:').'</label> '.
+	form::field('u_name',30,255,html::escapeHTML($u_name)).'</p>'.
+	'<p><label for="u_email">'.__('Email:').'</label> '.
+	form::field('u_email',30,255,html::escapeHTML($u_email)).'</p>'.
 	'</fieldset>'.
 	
 	'<fieldset><legend>'.__('Username and password').'</legend>'.
-	'<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '.
-	form::field('u_login',30,32,html::escapeHTML($u_login)).'</label></p>'.
-	'<p><label for="u_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Password:').' '.
-	form::password('u_pwd',30,255).'</label></p>'.
-	'<p><label for="u_pwd2" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Confirm password:').' '.
-	form::password('u_pwd2',30,255).'</label></p>'.
+	'<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').'</label> '.
+	form::field('u_login',30,32,html::escapeHTML($u_login)).'</p>'.
+	'<p><label for="u_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Password:').'</label> '.
+	form::password('u_pwd',30,255).'</p>'.
+	'<p><label for="u_pwd2" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Confirm password:').'</label> '.
+	form::password('u_pwd2',30,255).'</p>'.
 	'</fieldset>'.
 	
Index: admin/install/wizard.php
===================================================================
--- admin/install/wizard.php	(revision 1179)
+++ admin/install/wizard.php	(revision 1399)
@@ -178,16 +178,16 @@
 
 '<form action="wizard.php" method="post">'.
-'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').' '.
-form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</label></p>'.
-'<p><label for="DBHOST">'.__('Database Host Name:').' '.
-form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</label></p>'.
-'<p><label for="DBNAME">'.__('Database Name:').' '.
-form::field('DBNAME',30,255,html::escapeHTML($DBNAME)).'</label></p>'.
-'<p><label for="DBUSER">'.__('Database User Name:').' '.
-form::field('DBUSER',30,255,html::escapeHTML($DBUSER)).'</label></p>'.
-'<p><label for="DBPASSWORD">'.__('Database Password:').' '.
-form::password('DBPASSWORD',30,255).'</label></p>'.
-'<p><label for="DBPREFIX" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Database Tables Prefix:').' '.
-form::field('DBPREFIX',30,255,html::escapeHTML($DBPREFIX)).'</label></p>'.
+'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').'</label> '.
+form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</p>'.
+'<p><label for="DBHOST">'.__('Database Host Name:').'</label> '.
+form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</p>'.
+'<p><label for="DBNAME">'.__('Database Name:').'</label> '.
+form::field('DBNAME',30,255,html::escapeHTML($DBNAME)).'</p>'.
+'<p><label for="DBUSER">'.__('Database User Name:').'</label> '.
+form::field('DBUSER',30,255,html::escapeHTML($DBUSER)).'</p>'.
+'<p><label for="DBPASSWORD">'.__('Database Password:').'</label> '.
+form::password('DBPASSWORD',30,255).'</p>'.
+'<p><label for="DBPREFIX" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Database Tables Prefix:').'</label> '.
+form::field('DBPREFIX',30,255,html::escapeHTML($DBPREFIX)).'</p>'.
 
 '<p><input type="submit" value="'.__('Continue').'" /></p>'.
Index: admin/js/_post.js
===================================================================
--- admin/js/_post.js	(revision 1414)
+++ admin/js/_post.js	(revision 1392)
@@ -122,11 +122,24 @@
 			hide: $('#post_password').val() == ''
 		});
-		
+		$('#post_status').parent().toggleWithLegend($('#post_status'),{
+			cookie: 'dcx_post_status'
+		});
+		$('#post_dt').parent().toggleWithLegend($('#post_dt').parent().children().not('label'),{
+			cookie: 'dcx_post_dt'
+		});
+		$('#post_format').parent().toggleWithLegend($('#post_format').parent().children().not('label').add($('#post_format').parents('p').next()),{
+			cookie: 'dcx_post_format'
+		});
+		$('#cat_id').parent().toggleWithLegend($('#cat_id'),{
+			cookie: 'cat_id'
+		});
+		$('#post_url').parent().toggleWithLegend($('#post_url').parent().children().not('label'),{
+			cookie: 'post_url'
+		});
 		// We load toolbar on excerpt only when it's ready
 		$('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{
 			fn: function() { excerptTb.switchMode(formatField.value); },
 			cookie: 'dcx_post_excerpt',
-			hide: $('#post_excerpt').val() == '',
-			legend_click: true
+			hide: $('#post_excerpt').val() == ''
 		});
 		
@@ -150,4 +163,5 @@
 		var a = document.createElement('a');
 		a.href = '#';
+		a.className = 'button';
 		$(a).click(function() {
 			var params = {
Index: admin/js/common.js
===================================================================
--- admin/js/common.js	(revision 1303)
+++ admin/js/common.js	(revision 1395)
@@ -224,4 +224,5 @@
 				imgE.style.top = '1.7em';
 				imgE.style.left = ($(this).width()+4)+'px';
+				imgE.alt=dotclear.msg.click_to_unlock;
 				$(imgE).css('cursor','pointer');
 
Index: admin/js/filters.js
===================================================================
--- admin/js/filters.js	(revision 1152)
+++ 	(revision )
@@ -1,6 +1,0 @@
-$(function() {
-	$('#toggle-filters').click(function(e) {
-		$('#filters').toggleClass('hidden');
-		$('#toggle-filters').toggleClass('opened');
-	});
-});
Index: admin/langs.php
===================================================================
--- admin/langs.php	(revision 1332)
+++ admin/langs.php	(revision 1399)
@@ -129,12 +129,11 @@
 -------------------------------------------------------- */
 dcPage::open(__('Languages management'),
-	dcPage::jsLoad('js/_langs.js')
-);
-
-echo dcPage::breadcrumb(
+	dcPage::jsLoad('js/_langs.js'),
+	dcPage::breadcrumb(
 	array(
 		__('System') => '',
 		'<span class="page-title">'.__('Languages management').'</span>' => ''
-	));
+	))
+);
 
 if (!empty($_GET['removed'])) {
@@ -228,11 +227,11 @@
 	'<p>'.sprintf(__('You can download and install a additional language directly from Dotclear.net. '.
 	'Proposed languages are based on your version: %s.'),'<strong>'.DC_VERSION.'</strong>').'</p>'.
-	'<p class="field"><label for="pkg_url" class="classic">'.__('Language:').' '.
-	form::combo(array('pkg_url'),$dc_langs_combo).'</label></p>'.
-	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
-	'<input type="submit" value="'.__('Install language').'" />'.
+	'<p class="field"><label for="pkg_url" class="classic">'.__('Language:').'</label> '.
+	form::combo(array('pkg_url'),$dc_langs_combo).'</p>'.
+	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
+	'<p><input type="submit" value="'.__('Install language').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p></fieldset>'.
 	'</form>';
 }
@@ -246,11 +245,11 @@
 	'<legend>'.__('Upload a zip file').'</legend>'.
 	'<p>'.__('You can install languages by uploading zip files.').'</p>'.
-	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Language zip file:').' '.
-	'<input type="file" id="pkg_file" name="pkg_file" /></label></p>'.
-	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
-	'<input type="submit" name="upload_pkg" value="'.__('Upload language').'" />'.
+	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Language zip file:').'</label> '.
+	'<input type="file" id="pkg_file" name="pkg_file" /></p>'.
+	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
+	'<p><input type="submit" name="upload_pkg" value="'.__('Upload language').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p></fieldset>'.
 	'</form>';
 }
Index: admin/media.php
===================================================================
--- admin/media.php	(revision 1332)
+++ admin/media.php	(revision 1399)
@@ -203,12 +203,12 @@
 if ($dir && !empty($_GET['remove']) && empty($_GET['noconfirm']))
 {
-	call_user_func($open_f,__('Media manager'));
-	
-	echo dcPage::breadcrumb(
-		array(
-			html::escapeHTML($core->blog->name) => '',
-			__('Media manager') => '',
-			'<span class="page-title">'.__('confirm removal').'</span>' => ''
-		));
+	call_user_func($open_f,__('Media manager'),'',
+		dcPage::breadcrumb(
+			array(
+				html::escapeHTML($core->blog->name) => '',
+				__('Media manager') => '',
+				'<span class="page-title">'.__('confirm removal').'</span>' => ''
+			),!$popup)
+	);
 	
 	echo
@@ -232,55 +232,57 @@
 $user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader;
 
-call_user_func($open_f,__('Media manager'),
-	dcPage::jsLoad('js/_media.js').
-	($core_media_writable ? dcPage::jsUpload(array('d='.$d)) : '')
-	);
-
-if (!empty($_GET['mkdok'])) {
-	dcPage::message(__('Directory has been successfully created.'));
-}
-
-if (!empty($_GET['upok'])) {
-	dcPage::message(__('Files have been successfully uploaded.'));
-}
-
-if (!empty($_GET['rmfok'])) {
-	dcPage::message(__('File has been successfully removed.'));
-}
-
-if (!empty($_GET['rmdok'])) {
-	dcPage::message(__('Directory has been successfully removed.'));
-}
-
-if (!empty($_GET['rebuildok'])) {
-	dcPage::message(__('Directory has been successfully rebuilt.'));
-}
-
-if (!empty($_GET['unzipok'])) {
-	dcPage::message(__('Zip file has been successfully extracted.'));
-}
 
 if (!isset($core->media)) {
-	echo dcPage::breadcrumb(
+	$breadcrumb = dcPage::breadcrumb(
 		array(
 			html::escapeHTML($core->blog->name) => '',
 			'<span class="page-title">'.__('Media manager').'</span>' => ''
-		));
+		),!$popup);
 } else {
-	$breadcrumb = $core->media->breadCrumb(html::escapeURL($page_url).'&amp;d=%s','<span class="page-title">%s</span>');
-	if ($breadcrumb == '') {
-		echo dcPage::breadcrumb(
+	$breadcrumb_media = $core->media->breadCrumb(html::escapeURL($page_url).'&amp;d=%s','<span class="page-title">%s</span>');
+	if ($breadcrumb_media == '') {
+		$breadcrumb = dcPage::breadcrumb(
 			array(
 				html::escapeHTML($core->blog->name) => '',
 				'<span class="page-title">'.__('Media manager').'</span>' => ''
-			));
+			),!$popup);
 	} else {
-		echo dcPage::breadcrumb(
+		$breadcrumb = dcPage::breadcrumb(
 			array(
 				html::escapeHTML($core->blog->name) => '',
 				__('Media manager') => html::escapeURL($page_url.'&d='),
-				$breadcrumb => ''
-			));
-	}
+				$breadcrumb_media => ''
+			),!$popup);
+	}
+}
+
+call_user_func($open_f,__('Media manager'),
+	dcPage::jsLoad('js/_media.js').
+	($core_media_writable ? dcPage::jsUpload(array('d='.$d)) : ''),
+	$breadcrumb
+	);
+
+if (!empty($_GET['mkdok'])) {
+	dcPage::message(__('Directory has been successfully created.'));
+}
+
+if (!empty($_GET['upok'])) {
+	dcPage::message(__('Files have been successfully uploaded.'));
+}
+
+if (!empty($_GET['rmfok'])) {
+	dcPage::message(__('File has been successfully removed.'));
+}
+
+if (!empty($_GET['rmdok'])) {
+	dcPage::message(__('Directory has been successfully removed.'));
+}
+
+if (!empty($_GET['rebuildok'])) {
+	dcPage::message(__('Directory has been successfully rebuilt.'));
+}
+
+if (!empty($_GET['unzipok'])) {
+	dcPage::message(__('Zip file has been successfully extracted.'));
 }
 
@@ -315,6 +317,6 @@
 	echo
 	'<form action="media.php" method="get">'.
-	'<p><label for="file_sort" class="classic">'.__('Sort files:').' '.
-	form::combo('file_sort',$sort_combo,$file_sort).'</label>'.
+	'<p><label for="file_sort" class="classic">'.__('Sort files:').'</label> '.
+	form::combo('file_sort',$sort_combo,$file_sort).
 	form::hidden(array('popup'),$popup).
 	form::hidden(array('post_id'),$post_id).
@@ -397,6 +399,6 @@
 	'<legend>'.__('New directory').'</legend>'.
 	$core->formNonce().
-	'<p><label for="newdir">'.__('Directory Name:').
-	form::field(array('newdir','newdir'),35,255).'</label></p>'.
+	'<p><label for="newdir">'.__('Directory Name:').'</label>'.
+	form::field(array('newdir','newdir'),35,255).'</p>'.
 	'<p><input type="submit" value="'.__('Create').'" />'.
 	form::hidden(array('d'),html::escapeHTML($d)).'</p>'.
Index: admin/media_item.php
===================================================================
--- admin/media_item.php	(revision 1332)
+++ admin/media_item.php	(revision 1399)
@@ -175,5 +175,11 @@
 	$starting_scripts.
 	dcPage::jsDatePicker().
-	dcPage::jsPageTabs($tab)
+	dcPage::jsPageTabs($tab),
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Media manager') => html::escapeURL($media_page_url),
+			$core->media->breadCrumb(html::escapeURL($media_page_url).'&amp;d=%s').'<span class="page-title">'.$file->basename.'</span>' => ''
+		),!$popup)
 );
 
@@ -189,11 +195,4 @@
 	dcPage::message(__('Thumbnails have been successfully updated.'));
 }
-
-echo dcPage::breadcrumb(
-	array(
-		html::escapeHTML($core->blog->name) => '',
-		__('Media manager') => html::escapeURL($media_page_url),
-		$core->media->breadCrumb(html::escapeURL($media_page_url).'&amp;d=%s').'<span class="page-title">'.$file->basename.'</span>' => ''
-	));
 
 # Insertion popup
@@ -517,6 +516,6 @@
 		__('This will extract archive in current directory and will overwrite existing files or directory.').'</li>'.
 		'</ul>'.
-		'<p><label for="inflate_mode" class="classic">'.__('Extract mode:').' '.
-		form::combo('inflate_mode',$inflate_combo,'new').'</label> '.
+		'<p><label for="inflate_mode" class="classic">'.__('Extract mode:').'</label> '.
+		form::combo('inflate_mode',$inflate_combo,'new').
 		'<input type="submit" name="unzip" value="'.__('Extract').'" />'.
 		form::hidden(array('id'),$id).
@@ -528,14 +527,14 @@
 	'<form class="clear" action="'.html::escapeURL($page_url).'" method="post">'.
 	'<fieldset><legend>'.__('Change media properties').'</legend>'.
-	'<p><label for="media_file">'.__('File name:').
-	form::field('media_file',30,255,html::escapeHTML($file->basename)).'</label></p>'.
-	'<p><label for="media_title">'.__('File title:').
-	form::field('media_title',30,255,html::escapeHTML($file->media_title)).'</label></p>'.
-	'<p><label for="media_dt">'.__('File date:').
-	form::field('media_dt',16,16,html::escapeHTML($file->media_dtstr)).'</label></p>'.
+	'<p><label for="media_file">'.__('File name:').'</label>'.
+	form::field('media_file',30,255,html::escapeHTML($file->basename)).'</p>'.
+	'<p><label for="media_title">'.__('File title:').'</label>'.
+	form::field('media_title',30,255,html::escapeHTML($file->media_title)).'</p>'.
+	'<p><label for="media_dt">'.__('File date:').'</label>'.
+	form::field('media_dt',16,16,html::escapeHTML($file->media_dtstr)).'</p>'.
 	'<p><label for="media_private" class="classic">'.form::checkbox('media_private',1,$file->media_priv).' '.
 	__('Private').'</label></p>'.
-	'<p><label for="media_path">'.__('New directory:').
-	form::combo('media_path',$dirs_combo,dirname($file->relname)).'</label></p>'.
+	'<p><label for="media_path">'.__('New directory:').'</label>'.
+	form::combo('media_path',$dirs_combo,dirname($file->relname)).'</p>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 	form::hidden(array('id'),$id).
Index: admin/plugin.php
===================================================================
--- admin/plugin.php	(revision 1414)
+++ admin/plugin.php	(revision 1358)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -15,82 +15,81 @@
 dcPage::check('usage,contentadmin');
 
-$has_content = false;
 $p_file = '';
 $p = !empty($_REQUEST['p']) ? $_REQUEST['p'] : null;
-$popup = $_ctx->popup = (integer) !empty($_REQUEST['popup']);
+$popup = (integer) !empty($_REQUEST['popup']);
+
+if ($popup) {
+	$open_f = array('dcPage','openPopup');
+	$close_f = array('dcPage','closePopup');
+} else {
+	$open_f = array('dcPage','open');
+	$close_f = array('dcPage','close');
+}
 
 if ($core->plugins->moduleExists($p)) {
 	$p_file = $core->plugins->moduleRoot($p).'/index.php';
 }
-if (file_exists($p_file)) {
 
-//* Keep this for old style plugins using dcPage
-	if ($popup) {
-		$open_f = array('dcPage','openPopup');
-		$close_f = array('dcPage','closePopup');
-	} else {
-		$open_f = array('dcPage','open');
-		$close_f = array('dcPage','close');
-	}
+if (file_exists($p_file))
+{
+	# Loading plugin
+	$p_info = $core->plugins->getModules($p);
 	
-	$p_info = $core->plugins->getModules($p);
 	$p_url = 'plugin.php?p='.$p;
-	$p_title = $p_head = $p_content = '';
-//*/	
-	# Get page content
+	
+	$p_title = 'no content - plugin';
+	$p_head = '';
+	$p_content = '<p>'.__('No content found on this plugin.').'</p>';
+	
 	ob_start();
 	include $p_file;
 	$res = ob_get_contents();
 	ob_end_clean();
-
-	# Check context and display
-	if ($_ctx->hasPageTitle() && !empty($res)) {
-		$has_content = true;
-		echo $res;
-	}
-//* Keep this for old style plugins using dcPage
-	elseif (!$_ctx->hasPageTitle()) {
+	
+	if (preg_match('|<head>(.*?)</head|ms',$res,$m)) {
+		if (preg_match('|<title>(.*?)</title>|ms',$m[1],$mt)) {
+			$p_title = $mt[1];
+		}
 		
-		if (preg_match('|<head>(.*?)</head|ms',$res,$m)) {
-			if (preg_match('|<title>(.*?)</title>|ms',$m[1],$mt)) {
-				$p_title = $mt[1];
-			}
-			
-			if (preg_match_all('|(<script.*?>.*?</script>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
-			}
-			
-			if (preg_match_all('|(<style.*?>.*?</style>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
-			}
-			
-			if (preg_match_all('|(<link.*?/>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
+		if (preg_match_all('|(<script.*?>.*?</script>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
 			}
 		}
 		
-		if (preg_match('|<body.*?>(.+)</body>|ms',$res,$m)) {
-			$p_content = $m[1];
-			
-			call_user_func($open_f,$p_title,$p_head);
-			echo $p_content;
-			call_user_func($close_f);
-			
-			$has_content = true;
+		if (preg_match_all('|(<style.*?>.*?</style>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
+			}
+		}
+		
+		if (preg_match_all('|(<link.*?/>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
+			}
 		}
 	}
-//*/
+	
+	if (preg_match('|<body.*?>(.+)</body>|ms',$res,$m)) {
+		$p_content = $m[1];
+	}
+	
+	call_user_func($open_f,$p_title,$p_head);
+	echo $p_content;
+	call_user_func($close_f);
 }
-# No plugin or content found
-if (!$has_content) {
-	$_ctx->setBreadcrumb(__('Plugin not found'));
-	$_ctx->addError(__('The plugin you reached does not exist or does not have an admin page.'));
-	$core->tpl->display('plugin.html.twig');
+else
+{
+	call_user_func($open_f,__('Plugin not found'),'',
+		dcPage::breadcrumb(
+			array(
+				__('System') => '',
+				'<span class="page-title">'.__('Plugin not found').'</span>' => ''
+			))
+	);
+	
+	echo '<p>'.__('The plugin you reached does not exist or does not have an admin page.').'</p>';
+	
+	call_user_func($close_f);
 }
 ?>
Index: admin/plugins.php
===================================================================
--- admin/plugins.php	(revision 1332)
+++ admin/plugins.php	(revision 1399)
@@ -191,12 +191,11 @@
 dcPage::open(__('Plugins management'),
 	dcPage::jsLoad('js/_plugins.js').
-	dcPage::jsPageTabs($default_tab)
+	dcPage::jsPageTabs($default_tab),
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('Plugins management').'</span>' => ''
+		))
 );
-
-echo dcPage::breadcrumb(
-	array(
-		__('System') => '',
-		'<span class="page-title">'.__('Plugins management').'</span>' => ''
-	));
 
 if (!empty($_GET['removed'])) {
@@ -358,11 +357,11 @@
 	'<fieldset>'.
 	'<legend>'.__('Upload a zip file').'</legend>'.
-	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file:').' '.
-	'<input type="file" id="pkg_file" name="pkg_file" /></label></p>'.
-	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
-	'<input type="submit" name="upload_pkg" value="'.__('Upload plugin').'" />'.
+	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file:').'</label> '.
+	'<input type="file" id="pkg_file" name="pkg_file" /></p>'.
+	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
+	'<p><input type="submit" name="upload_pkg" value="'.__('Upload plugin').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p></fieldset>'.
 	'</form>';
 	
@@ -372,8 +371,8 @@
 	'<fieldset>'.
 	'<legend>'.__('Download a zip file').'</legend>'.
-	'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file URL:').' '.
-	form::field(array('pkg_url','pkg_url'),40,255).'</label></p>'.
-	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
+	'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file URL:').'</label> '.
+	form::field(array('pkg_url','pkg_url'),40,255).'</p>'.
+	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
 	'<input type="submit" name="fetch_pkg" value="'.__('Download plugin').'" />'.
 	$core->formNonce().
Index: admin/popup_link.php
===================================================================
--- admin/popup_link.php	(revision 1179)
+++ admin/popup_link.php	(revision 1399)
@@ -40,11 +40,11 @@
 echo
 '<form id="link-insert-form" action="#" method="get">'.
-'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Link URL:').' '.
-form::field('href',35,512,html::escapeHTML($href)).'</label></p>'.
-'<p><label>'.__('Link title:').' '. 
-form::field('title',35,512,html::escapeHTML($title)).'</label></p>'. 
-'<p><label>'.__('Link language:').' '.
+'<p><label class="required" for="href"><abbr title="'.__('Required field').'">*</abbr> '.__('Link URL:').'</label> '.
+form::field('href',35,512,html::escapeHTML($href)).'</p>'.
+'<p><label for="title">'.__('Link title:').'</label> '. 
+form::field('title',35,512,html::escapeHTML($title)).'</p>'. 
+'<p><label for="hreflang">'.__('Link language:').'</label> '.
 form::combo('hreflang',$lang_combo,$hreflang).
-'</label></p>'.
+'</p>'.
 
 '</form>'.
Index: admin/popup_posts.php
===================================================================
--- admin/popup_posts.php	(revision 1179)
+++ admin/popup_posts.php	(revision 1399)
@@ -53,14 +53,14 @@
 
 echo '<form action="popup_posts.php" method="post">'.
-	'<p><label for"type" class="classic">'.__('Entry type:').' '.form::combo('type',$type_combo,$type).'</label></p>'.
-	$core->formNonce().
+	'<p><label for"type" class="classic">'.__('Entry type:').'</label> '.form::combo('type',$type_combo,$type).''.
+	$core->formNonce().'</p>'.
 	'<noscript><div><input type="submit" value="'.__('Ok').'" /></div></noscript>'.
 	'</form>';
 
 echo '<form action="popup_posts.php" method="get">'.
-	'<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '.
-	' <input type="submit" value="'.__('Search').'" /></p>'.
+	'<p><label for="q" class="classic">'.__('Search entry:').'</label> '.form::field('q',30,255,html::escapeHTML($q)).
+	' <input type="submit" value="'.__('Search').'" />'.
 	form::hidden('type',html::escapeHTML($type)).
-	'</form>';
+	'</p></form>';
 
 try {
Index: admin/post.php
===================================================================
--- admin/post.php	(revision 1414)
+++ admin/post.php	(revision 1398)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -15,102 +15,24 @@
 dcPage::check('usage,contentadmin');
 
-class PostActions 
-{
-	public static function savePost($form) {
-		global $_ctx, $core;
-		try {
-			$form->check($_ctx);
-			$_ctx->setAlert('save');
-			$form->cat_id = (integer) $form->cat_id;
-	
-			if (!empty($form->post_dt)) {
-				try
-				{
-					$post_dt = strtotime($form->post_dt);
-					if ($post_dt == false || $post_dt == -1) {
-						$bad_dt = true;
-						throw new Exception(__('Invalid publication date'));
-					}
-					$form->post_dt = date('Y-m-d H:i',$post_dt);
-				}
-				catch (Exception $e)
-				{
-					$core->error->add($e->getMessage());
-				}
-			}
-			$post_excerpt = $form->post_excerpt;
-			$post_content = $form->post_content;
-			$post_excerpt_xhtml = '';
-			$post_content_xhtml = '';
-			$core->blog->setPostContent(
-				$form->id,$form->post_format,$form->post_lang,
-				$post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml
-			);
-			$form->post_excerpt = $post_excerpt;
-			$form->post_content = $post_content;
-			$form->post_excerpt_xhtml = $post_excerpt_xhtml;
-			$form->post_content_xhtml = $post_content_xhtml;
-			
-			$cur = $core->con->openCursor($core->prefix.'post');
-	
-			$cur->post_title = $form->post_title;
-			$cur->cat_id = $form->cat_id ? $form->cat_id : null;
-			$cur->post_dt = $form->post_dt ? date('Y-m-d H:i:00',strtotime($form->post_dt)) : '';
-			$cur->post_format = $form->post_format;
-			$cur->post_password = $form->post_password;
-			$cur->post_lang = $form->post_lang;
-			$cur->post_title = $form->post_title;
-			$cur->post_excerpt = $form->post_excerpt;
-			$cur->post_excerpt_xhtml = $form->post_excerpt_xhtml;
-			$cur->post_content = $form->post_content;
-			$cur->post_content_xhtml = $form->post_content_xhtml;
-			$cur->post_notes = $form->post_notes;
-			$cur->post_status = $form->post_status;
-			$cur->post_selected = (integer) $form->post_selected;
-			$cur->post_open_comment = (integer) $form->post_open_comment;
-			$cur->post_open_tb = (integer) $form->post_open_tb;
-	
-			if (!empty($form->post_url)) {
-				$cur->post_url = $form->post_url;
-			}
-	
-			# Update post
-			if ($form->id)
-			{
-				# --BEHAVIOR-- adminBeforePostUpdate
-				$core->callBehavior('adminBeforePostUpdate',$cur,$form->id);
-				
-				$core->blog->updPost($form->id,$cur);
-				
-				# --BEHAVIOR-- adminAfterPostUpdate
-				$core->callBehavior('adminAfterPostUpdate',$cur,$form->id);
-				
-				http::redirect('post.php?id='.$form->id.'&upd=1');
-			}
-			else
-			{
-				$cur->user_id = $core->auth->userID();
-								# --BEHAVIOR-- adminBeforePostCreate
-				$core->callBehavior('adminBeforePostCreate',$cur);
-				
-				$return_id = $core->blog->addPost($cur);
-				
-				# --BEHAVIOR-- adminAfterPostCreate
-				$core->callBehavior('adminAfterPostCreate',$cur,$return_id);
-				
-				http::redirect('post.php?id='.$return_id.'&crea=1');
-			}
-
-	} catch (Exception $e) {
-		$ctx->setError($e->getMessage());
-	}
-}
-	function deletePost($form) {
-		echo $form->id->getValue(); exit;
-	}
-}
+$post_id = '';
+$cat_id = '';
+$post_dt = '';
+$post_format = $core->auth->getOption('post_format');
+$post_password = '';
+$post_url = '';
+$post_lang = $core->auth->getInfo('user_lang');
+$post_title = '';
+$post_excerpt = '';
+$post_excerpt_xhtml = '';
+$post_content = '';
+$post_content_xhtml = '';
+$post_notes = '';
+$post_status = $core->auth->getInfo('user_post_status');
+$post_selected = false;
+$post_open_comment = $core->blog->settings->system->allow_comments;
+$post_open_tb = $core->blog->settings->system->allow_trackbacks;
 
 $page_title = __('New entry');
-$post_id='';
+
 $can_view_page = true;
 $can_edit_post = $core->auth->check('usage,contentadmin',$core->blog->id);
@@ -125,5 +47,5 @@
 # If user can't publish
 if (!$can_publish) {
-	$form->post_status = -2;
+	$post_status = -2;
 }
 
@@ -133,8 +55,8 @@
 	$categories = $core->blog->getCategories(array('post_type'=>'post'));
 	while ($categories->fetch()) {
-		$categories_combo[$categories->cat_id] = 
-			str_repeat('&nbsp;&nbsp;',$categories->level-1).
-			($categories->level-1 == 0 ? '' : '&bull; ').
-			html::escapeHTML($categories->cat_title);
+		$categories_combo[] = new formSelectOption(
+			str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+			$categories->cat_id
+		);
 	}
 } catch (Exception $e) { }
@@ -142,6 +64,7 @@
 # Status combo
 foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$k] = $v;
-}
+	$status_combo[$v] = (string) $k;
+}
+$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
 
 # Formaters combo
@@ -153,11 +76,11 @@
 $rs = $core->blog->getLangs(array('order'=>'asc'));
 $all_langs = l10n::getISOcodes(0,1);
-$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(0,1));
+$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
 while ($rs->fetch()) {
 	if (isset($all_langs[$rs->post_lang])) {
-		$lang_combo[__('Most used')][$rs->post_lang] = $all_langs[$rs->post_lang];
-		unset($lang_combo[__('Available')][$rs->post_lang]);
+		$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
+		unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
 	} else {
-		$lang_combo[__('Most used')][$rs->post_lang] = $all_langs[$rs->post_lang];
+		$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
 	}
 }
@@ -165,65 +88,7 @@
 unset($rs);
 
-$form = new dcForm($core,'post','post.php');
-$form
-	->addField(
-		new dcFieldText('post_title','', array(
-			'maxlength'		=> 255,
-			'required'	=> true,
-			'label'		=> __('Title'))))
-	->addField(
-		new dcFieldTextArea('post_excerpt','', array(
-			'cols'		=> 50,
-			'rows'		=> 5,
-			'label'		=> __("Excerpt:"))))
-	->addField(
-		new dcFieldTextArea('post_content','', array(
-			'required'	=> true,
-			'label'		=> __("Content:"))))
-	->addField(
-		new dcFieldTextArea('post_notes','', array(
-			'label'		=> __("Notes"))))
-	->addField(
-		new dcFieldSubmit('save',__('Save'),array(
-			'action' => array('PostActions','savePost'))))
-	->addField(
-		new dcFieldSubmit('delete',__('Delete'),array(
-			'action' => 'deletePost')))
-	->addField(
-		new dcFieldCombo('post_status',$core->auth->getInfo('user_post_status'),$status_combo,array(
-			'disabled' => !$can_publish,
-			'label' => __('Entry status:'))))
-	->addField(
-		new dcFieldCombo('cat_id','',$categories_combo,array(
-			"label" => __('Category:'))))
-	->addField(
-		new dcFieldText('post_dt','',array(
-			"label" => __('Published on:'))))
-	->addField(
-		new dcFieldCombo('post_format',$core->auth->getOption('post_format'),$formaters_combo,array(
-			"label" => __('Text formating:'))))
-	->addField(
-		new dcFieldCheckbox ('post_open_comment',$core->blog->settings->system->allow_comments,array(
-			"label" => __('Accept comments'))))
-	->addField(
-		new dcFieldCheckbox ('post_open_tb',$core->blog->settings->system->allow_trackbacks,array(
-			"label" => __('Accept trackbacks'))))
-	->addField(
-		new dcFieldCheckbox ('post_selected',array(1=>false),array(
-			"label" => __('Selected entry'))))
-	->addField(
-		new dcFieldCombo ('post_lang',$core->auth->getInfo('user_lang'),$lang_combo, array(
-			"label" => __('Entry lang:'))))
-	->addField(
-		new dcFieldText('post_password','',array(
-			"maxlength" => 32,
-			"label" => __('Entry password:'))))
-	->addField(
-		new dcFieldText('post_url','',array(
-			"maxlength" => 255,
-			"label" => __('Basename:'))))
-	->addField(
-		new dcFieldHidden ('id',''))
-;
+# Validation flag
+$bad_dt = false;
+
 # Get entry informations
 if (!empty($_REQUEST['id']))
@@ -240,65 +105,182 @@
 	else
 	{
-		$form->id = $post_id = $post->post_id;
-		$form->cat_id = $post->cat_id;
-		$form->post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
-		$form->post_format = $post->post_format;
-		$form->post_password = $post->post_password;
-		$form->post_url = $post->post_url;
-		$form->post_lang = $post->post_lang;
-		$form->post_title = $post->post_title;
-		$form->post_excerpt = $post->post_excerpt;
-		$form->post_excerpt_xhtml = $post->post_excerpt_xhtml;
-		$form->post_content = $post->post_content;
-		$form->post_content_xhtml = $post->post_content_xhtml;
-		$form->post_notes = $post->post_notes;
-		$form->post_status = $post->post_status;
-		$form->post_selected = (boolean) $post->post_selected;
-		$form->post_open_comment = (boolean) $post->post_open_comment;
-		$form->post_open_tb = (boolean) $post->post_open_tb;
-		$form->can_edit_post = $post->isEditable();
-		$form->can_delete= $post->isDeletable();
+		$post_id = $post->post_id;
+		$cat_id = $post->cat_id;
+		$post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
+		$post_format = $post->post_format;
+		$post_password = $post->post_password;
+		$post_url = $post->post_url;
+		$post_lang = $post->post_lang;
+		$post_title = $post->post_title;
+		$post_excerpt = $post->post_excerpt;
+		$post_excerpt_xhtml = $post->post_excerpt_xhtml;
+		$post_content = $post->post_content;
+		$post_content_xhtml = $post->post_content_xhtml;
+		$post_notes = $post->post_notes;
+		$post_status = $post->post_status;
+		$post_selected = (boolean) $post->post_selected;
+		$post_open_comment = (boolean) $post->post_open_comment;
+		$post_open_tb = (boolean) $post->post_open_tb;
+		
 		$page_title = __('Edit entry');
-
-	}
-}
-if ($post_id) {
-	$_ctx->post_id = $post->post_id;
-
-	$_ctx->preview_url =
-		$core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'.
-		http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')).
-		'/'.$post->post_url);
-		
-	
-	$form_comment = new dcForm($core,'add-comment','post.php');
-	$form_comment
-		->addField(
-			new dcFieldText('comment_author','', array(
-				'maxlength'		=> 255,
-				'required'	=> true,
-				'label'		=> __('Name:'))))
-		->addField(
-			new dcFieldText('comment_email','', array(
-				'maxlength'		=> 255,
-				'required'	=> true,
-				'label'		=> __('Email:'))))
-		->addField(
-			new dcFieldText('comment_site','', array(
-				'maxlength'		=> 255,
-				'label'		=> __('Web site:'))))
-		->addField(
-			new dcFieldTextArea('comment_content','', array(
-				'required'	=> true,
-				'label'		=> __('Comment:'))))
-		->addField(
-			new dcFieldSubmit('add',__('Save'),array(
-				'action' => 'addComment')))
-		;
-
-	
-}
-
-$form->setup();
+		
+		$can_edit_post = $post->isEditable();
+		$can_delete= $post->isDeletable();
+		
+		$next_rs = $core->blog->getNextPost($post,1);
+		$prev_rs = $core->blog->getNextPost($post,-1);
+		
+		if ($next_rs !== null) {
+			$next_link = sprintf($post_link,$next_rs->post_id,
+				html::escapeHTML($next_rs->post_title),__('Next entry').'&nbsp;&#187;');
+			$next_headlink = sprintf($post_headlink,'next',
+				html::escapeHTML($next_rs->post_title),$next_rs->post_id);
+		}
+		
+		if ($prev_rs !== null) {
+			$prev_link = sprintf($post_link,$prev_rs->post_id,
+				html::escapeHTML($prev_rs->post_title),'&#171;&nbsp;'.__('Previous entry'));
+			$prev_headlink = sprintf($post_headlink,'previous',
+				html::escapeHTML($prev_rs->post_title),$prev_rs->post_id);
+		}
+		
+		try {
+			$core->media = new dcMedia($core);
+		} catch (Exception $e) {}
+	}
+}
+
+# Format excerpt and content
+if (!empty($_POST) && $can_edit_post)
+{
+	$post_format = $_POST['post_format'];
+	$post_excerpt = $_POST['post_excerpt'];
+	$post_content = $_POST['post_content'];
+	
+	$post_title = $_POST['post_title'];
+	
+	$cat_id = (integer) $_POST['cat_id'];
+	
+	if (isset($_POST['post_status'])) {
+		$post_status = (integer) $_POST['post_status'];
+	}
+	
+	if (empty($_POST['post_dt'])) {
+		$post_dt = '';
+	} else {
+		try
+		{
+			$post_dt = strtotime($_POST['post_dt']);
+			if ($post_dt == false || $post_dt == -1) {
+				$bad_dt = true;
+				throw new Exception(__('Invalid publication date'));
+			}
+			$post_dt = date('Y-m-d H:i',$post_dt);
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+	
+	$post_open_comment = !empty($_POST['post_open_comment']);
+	$post_open_tb = !empty($_POST['post_open_tb']);
+	$post_selected = !empty($_POST['post_selected']);
+	$post_lang = $_POST['post_lang'];
+	$post_password = !empty($_POST['post_password']) ? $_POST['post_password'] : null;
+	
+	$post_notes = $_POST['post_notes'];
+	
+	if (isset($_POST['post_url'])) {
+		$post_url = $_POST['post_url'];
+	}
+	
+	$core->blog->setPostContent(
+		$post_id,$post_format,$post_lang,
+		$post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml
+	);
+}
+
+# Delete post
+if (!empty($_POST['delete']) && $can_delete)
+{
+	try {
+		# --BEHAVIOR-- adminBeforePostDelete
+		$core->callBehavior('adminBeforePostDelete',$post_id);
+		$core->blog->delPost($post_id);
+		http::redirect('posts.php');
+	} catch (Exception $e) {
+		$core->error->add($e->getMessage());
+	}
+}
+
+# Create or update post
+if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt)
+{
+	$cur = $core->con->openCursor($core->prefix.'post');
+	
+	$cur->post_title = $post_title;
+	$cur->cat_id = ($cat_id ? $cat_id : null);
+	$cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : '';
+	$cur->post_format = $post_format;
+	$cur->post_password = $post_password;
+	$cur->post_lang = $post_lang;
+	$cur->post_title = $post_title;
+	$cur->post_excerpt = $post_excerpt;
+	$cur->post_excerpt_xhtml = $post_excerpt_xhtml;
+	$cur->post_content = $post_content;
+	$cur->post_content_xhtml = $post_content_xhtml;
+	$cur->post_notes = $post_notes;
+	$cur->post_status = $post_status;
+	$cur->post_selected = (integer) $post_selected;
+	$cur->post_open_comment = (integer) $post_open_comment;
+	$cur->post_open_tb = (integer) $post_open_tb;
+	
+	if (isset($_POST['post_url'])) {
+		$cur->post_url = $post_url;
+	}
+	
+	# Update post
+	if ($post_id)
+	{
+		try
+		{
+			# --BEHAVIOR-- adminBeforePostUpdate
+			$core->callBehavior('adminBeforePostUpdate',$cur,$post_id);
+			
+			$core->blog->updPost($post_id,$cur);
+			
+			# --BEHAVIOR-- adminAfterPostUpdate
+			$core->callBehavior('adminAfterPostUpdate',$cur,$post_id);
+			
+			http::redirect('post.php?id='.$post_id.'&upd=1');
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+	else
+	{
+		$cur->user_id = $core->auth->userID();
+		
+		try
+		{
+			# --BEHAVIOR-- adminBeforePostCreate
+			$core->callBehavior('adminBeforePostCreate',$cur);
+			
+			$return_id = $core->blog->addPost($cur);
+			
+			# --BEHAVIOR-- adminAfterPostCreate
+			$core->callBehavior('adminAfterPostCreate',$cur,$return_id);
+			
+			http::redirect('post.php?id='.$return_id.'&crea=1');
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+}
 
 /* DISPLAY
@@ -311,14 +293,447 @@
 	$default_tab = 'comments';
 }
-$page_title_edit = __('Edit entry');
-$_ctx
-	->setBreadCrumb(
+
+if ($post_id) {
+	switch ($post_status) {
+		case 1:
+			$img_status = sprintf($img_status_pattern,__('Published'),'check-on.png');
+			break;
+		case 0:
+			$img_status = sprintf($img_status_pattern,__('Unpublished'),'check-off.png');
+			break;
+		case -1:
+			$img_status = sprintf($img_status_pattern,__('Scheduled'),'scheduled.png');
+			break;
+		case -2:
+			$img_status = sprintf($img_status_pattern,__('Pending'),'check-wrn.png');
+			break;
+		default:
+			$img_status = '';
+	}
+	$edit_entry_str = __('&ldquo;%s&rdquo;');
+	$page_title_edit = sprintf($edit_entry_str, html::escapeHTML($post_title)).' '.$img_status;
+}
+
+
+dcPage::open($page_title.' - '.__('Entries'),
+	dcPage::jsDatePicker().
+	dcPage::jsToolBar().
+	dcPage::jsModal().
+	dcPage::jsMetaEditor().
+	dcPage::jsLoad('js/_post.js').
+	dcPage::jsConfirmClose('entry-form','comment-form').
+	# --BEHAVIOR-- adminPostHeaders
+	$core->callBehavior('adminPostHeaders').
+	dcPage::jsPageTabs($default_tab).
+	$next_headlink."\n".$prev_headlink,
+	dcPage::breadcrumb(
 		array(
 			html::escapeHTML($core->blog->name) => '',
 			__('Entries') => 'posts.php',
-			($post_id ? $page_title_edit : $page_title) => ''
-	))
-	->default_tab = $default_tab;
-
-$core->tpl->display('post.html.twig');
+			'<span class="page-title">'.($post_id ? $page_title_edit : $page_title).'</span>' => ''
+		))
+);
+
+if (!empty($_GET['upd'])) {
+	dcPage::message(__('Entry has been successfully updated.'));
+}
+elseif (!empty($_GET['crea'])) {
+	dcPage::message(__('Entry has been successfully created.'));
+}
+elseif (!empty($_GET['attached'])) {
+	dcPage::message(__('File has been successfully attached.'));
+}
+elseif (!empty($_GET['rmattach'])) {
+	dcPage::message(__('Attachment has been successfully removed.'));
+}
+
+if (!empty($_GET['creaco'])) {
+	dcPage::message(__('Comment has been successfully created.'));
+}
+
+# XHTML conversion
+if (!empty($_GET['xconv']))
+{
+	$post_excerpt = $post_excerpt_xhtml;
+	$post_content = $post_content_xhtml;
+	$post_format = 'xhtml';
+	
+	dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.'));
+}
+
+if ($post_id && $post->post_status == 1) {
+	echo '<p><a class="onblog_link" href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>';
+}
+if ($post_id)
+{
+	echo '<p class="nav_prevnext">';
+	if ($prev_link) { echo $prev_link; }
+	if ($next_link && $prev_link) { echo ' | '; }
+	if ($next_link) { echo $next_link; }
+	
+	# --BEHAVIOR-- adminPostNavLinks
+	$core->callBehavior('adminPostNavLinks',isset($post) ? $post : null);
+	
+	echo '</p>';
+}
+
+# Exit if we cannot view page
+if (!$can_view_page) {
+	dcPage::helpBlock('core_post');
+	dcPage::close();
+	exit;
+}
+/* Post form if we can edit post
+-------------------------------------------------------- */
+if ($can_edit_post)
+{
+	$sidebar_items = new ArrayObject(array(
+		'status-box' => array(
+			'title' => __('Status'),
+			'items' => array(
+				'post_status' => 
+					'<p><label for="post_status" class="ib">'.__('Entry status').'</label>'.
+					form::combo('post_status',$status_combo,$post_status,'maximal','',!$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">'.__('Entry lang').'</label>'.
+					form::combo('post_lang',$lang_combo,$post_lang).
+					'</p>',
+				'post_format' =>
+					'<p><label for="post_format" class="ib">'.__('Text formating').'</label>'.
+					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>')),
+		'metas-box' => array(
+			'title' => __('Ordering'),
+			'items' => array(
+				'post_selected' => 
+					'<p><label for="post_selected" class="classic">'.
+					form::checkbox('post_selected',1,$post_selected).' '.
+					__('Selected entry').'</label></p>',
+				'cat_id' =>
+					'<p><label for="cat_id" class="ib">'.__('Category').'</label>'.
+					form::combo('cat_id',$categories_combo,$cat_id,'maximal').
+					'</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">'.
+						__('Warning: Comments are not accepted on this blog.').'</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">'.__('Warning: Trackbacks are not accepted on this blog.').'</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:').'</label><span class="form-note">'.
+			__('Add unpublished notes.').'</span>'.
+			form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
+			'</p>'
+		)
+	);
+	
+	# --BEHAVIOR-- adminPostFormItems
+	$core->callBehavior('adminPostFormItems',$main_items,$sidebar_items, isset($post) ? $post : null);
+
+	echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New entry')).'" id="edit-entry">';
+	echo '<form action="post.php" method="post" id="entry-form">';
+	echo '<div id="entry-wrapper">';
+	echo '<div id="entry-content"><div class="constrained">';
+
+	echo '<h3 class="hidden">'.__('Edit post').'</h3>';
+	
+	foreach ($main_items as $id => $item) {
+		echo $item;
+	}
+
+	# --BEHAVIOR-- adminPostForm (may be deprecated)
+	$core->callBehavior('adminPostForm',isset($post) ? $post : null);
+	
+	echo
+	'<p class="border-top">'.
+	($post_id ? form::hidden('id',$post_id) : '').
+	'<input type="submit" value="'.__('Save').' (s)" '.
+	'accesskey="s" name="save" /> ';
+	if ($post_id) {
+		$preview_url =
+		$core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'.
+		http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')).
+		'/'.$post->post_url);
+		echo '<a id="post-preview" href="'.$preview_url.'" class="button" accesskey="p">'.__('Preview').' (p)'.'</a> ';
+	} else {
+		echo
+		'<a id="post-cancel" href="index.php" class="button" accesskey="c">'.__('Cancel').' (c)</a>';
+	}
+
+	echo
+	($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : '').
+	$core->formNonce().
+	'</p>';
+	
+	echo '</div></div>';		// End #entry-content
+	echo '</div>';		// End #entry-wrapper
+
+	echo '<div id="entry-sidebar">';
+	
+	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>';
+	}
+	
+	
+	# --BEHAVIOR-- adminPostFormSidebar (may be deprecated)
+	$core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null);
+	echo '</div>';		// End #entry-sidebar
+
+	echo '</form>';
+	
+	# --BEHAVIOR-- adminPostForm
+	$core->callBehavior('adminPostAfterForm',isset($post) ? $post : null);
+	
+	echo '</div>';
+	
+	if ($post_id && $post->post_status == 1) {
+		echo '<p><a href="trackbacks.php?id='.$post_id.'" class="multi-part">'.
+		__('Ping blogs').'</a></p>';
+	}
+	
+}
+
+
+/* Comments and trackbacks
+-------------------------------------------------------- */
+if ($post_id)
+{
+	$params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');
+	
+	$comments = $core->blog->getComments(array_merge($params,array('comment_trackback'=>0)));
+	$trackbacks = $core->blog->getComments(array_merge($params,array('comment_trackback'=>1)));
+	
+	# Actions combo box
+	$combo_action = array();
+	if ($can_edit_post && $core->auth->check('publish,contentadmin',$core->blog->id))
+	{
+		$combo_action[__('Publish')] = 'publish';
+		$combo_action[__('Unpublish')] = 'unpublish';
+		$combo_action[__('Mark as pending')] = 'pending';
+		$combo_action[__('Mark as junk')] = 'junk';
+	}
+	
+	if ($can_edit_post && $core->auth->check('delete,contentadmin',$core->blog->id))
+	{
+		$combo_action[__('Delete')] = 'delete';
+	}
+	
+	# --BEHAVIOR-- adminCommentsActionsCombo
+	$core->callBehavior('adminCommentsActionsCombo',array(&$combo_action));
+	
+	$has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
+	
+	echo
+	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
+	
+	if ($has_action) {
+		echo '<form action="comments_actions.php" id="form-comments" method="post">';
+	}
+	
+	echo '<h3>'.__('Trackbacks').'</h3>';
+	
+	if (!$trackbacks->isEmpty()) {
+		showComments($trackbacks,$has_action,true);
+	} else {
+		echo '<p>'.__('No trackback').'</p>';
+	}
+	
+	echo '<h3>'.__('Comments').'</h3>';
+	if (!$comments->isEmpty()) {
+		showComments($comments,$has_action);
+	} else {
+		echo '<p>'.__('No comment').'</p>';
+	}
+	
+	if ($has_action) {
+		echo
+		'<div class="two-cols">'.
+		'<p class="col checkboxes-helpers"></p>'.
+		
+		'<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '.
+		form::combo('action',$combo_action).
+		form::hidden('redir','post.php?id='.$post_id.'&amp;co=1').
+		$core->formNonce().
+		'<input type="submit" value="'.__('ok').'" /></p>'.
+		'</div>'.
+		'</form>';
+	}
+	
+	echo '</div>';
+}
+
+/* Add a comment
+-------------------------------------------------------- */
+if ($post_id)
+{
+	echo
+	'<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'.
+	'<h3>'.__('Add a comment').'</h3>'.
+	
+	'<form action="comment.php" method="post" id="comment-form">'.
+	'<div class="constrained">'.
+	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').'</label>'.
+	form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))).
+	'</p>'.
+	
+	'<p><label for="comment_email">'.__('Email:').'</label>'.
+	form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))).
+	'</p>'.
+	
+	'<p><label for="comment_site">'.__('Web site:').'</label>'.
+	form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))).
+	'</p>'.
+	
+	'<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>'.
+	
+	'<p>'.form::hidden('post_id',$post_id).
+	$core->formNonce().
+	'<input type="submit" name="add" value="'.__('Save').'" /></p>'.
+	'</div>'.
+	'</form>'.
+	'</div>';
+}
+
+# Controls comments or trakbacks capabilities
+function isContributionAllowed($id,$dt,$com=true)
+{
+	global $core;
+
+	if (!$id) {
+		return true;
+	}
+	if ($com) {
+		if (($core->blog->settings->system->comments_ttl == 0) || 
+			(time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) {
+			return true;
+		}
+	} else {
+		if (($core->blog->settings->system->trackbacks_ttl == 0) || 
+			(time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) {
+			return true;
+		}
+	}
+	return false;
+}
+
+# Show comments or trackbacks
+function showComments($rs,$has_action,$tb=false)
+{
+	echo
+	'<table class="comments-list"><tr>'.
+	'<th colspan="2">'.__('Author').'</th>'.
+	'<th>'.__('Date').'</th>'.
+	'<th class="nowrap">'.__('IP address').'</th>'.
+	'<th>'.__('Status').'</th>'.
+	'<th>&nbsp;</th>'.
+	'</tr>';
+	
+	while($rs->fetch())
+	{
+		$comment_url = 'comment.php?id='.$rs->comment_id;
+		
+		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
+		switch ($rs->comment_status) {
+			case 1:
+				$img_status = sprintf($img,__('published'),'check-on.png');
+				break;
+			case 0:
+				$img_status = sprintf($img,__('unpublished'),'check-off.png');
+				break;
+			case -1:
+				$img_status = sprintf($img,__('pending'),'check-wrn.png');
+				break;
+			case -2:
+				$img_status = sprintf($img,__('junk'),'junk.png');
+				break;
+		}
+		
+		echo
+		'<tr class="line'.($rs->comment_status != 1 ? ' offline' : '').'"'.
+		' id="c'.$rs->comment_id.'">'.
+		
+		'<td class="nowrap">'.
+		($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,'','','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'.
+		'<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'.
+		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'.
+		'<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'.
+		'<td class="nowrap status">'.$img_status.'</td>'.
+		'<td class="nowrap status"><a href="'.$comment_url.'">'.
+		'<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'.
+		
+		'</tr>';
+	}
+	
+	echo '</table>';
+}
+
+dcPage::helpBlock('core_post','core_wiki');
+dcPage::close();
 ?>
Index: admin/posts.php
===================================================================
--- admin/posts.php	(revision 1414)
+++ admin/posts.php	(revision 1415)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -12,5 +12,5 @@
 
 require dirname(__FILE__).'/../inc/admin/prepend.php';
-global $_ctx;
+
 dcPage::check('usage,contentadmin');
 
@@ -48,4 +48,5 @@
 	# Filter form we'll put in html_block
 	$users_combo = $categories_combo = array();
+	$users_combo['-'] = $categories_combo['-'] = '';
 	while ($users->fetch())
 	{
@@ -60,38 +61,49 @@
 	}
 	
-
-# Getting categories
-$categories_combo = array();
-try {
-	$categories = $core->blog->getCategories(array('post_type'=>'post'));
+	$categories_combo[__('None')] = 'NULL';
 	while ($categories->fetch()) {
-		$categories_combo[$categories->cat_id] = 
-			str_repeat('&nbsp;&nbsp;',$categories->level-1).
-			($categories->level-1 == 0 ? '' : '&bull; ').
-			html::escapeHTML($categories->cat_title);
-	}
-} catch (Exception $e) { }
+		$categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').
+			html::escapeHTML($categories->cat_title).
+			' ('.$categories->nb_post.')'] = $categories->cat_id;
+	}
+	
 	$status_combo = array(
+	'-' => ''
 	);
 	foreach ($core->blog->getAllPostStatus() as $k => $v) {
-		$status_combo[(string) $k] = (string)$v;
+		$status_combo[$v] = (string) $k;
 	}
 	
 	$selected_combo = array(
-	'1' => __('is selected'),
-	'0' => __('is not selected')
+	'-' => '',
+	__('Selected') => '1',
+	__('Not selected') => '0'
 	);
 	
 	# Months array
+	$dt_m_combo['-'] = '';
 	while ($dates->fetch()) {
-		$dt_m_combo[$dates->year().$dates->month()] = dt::str('%B %Y',$dates->ts());
-	}
-	
+		$dt_m_combo[dt::str('%B %Y',$dates->ts())] = $dates->year().$dates->month();
+	}
+	
+	$lang_combo['-'] = '';
 	while ($langs->fetch()) {
 		$lang_combo[$langs->post_lang] = $langs->post_lang;
 	}
-}
-$form = new dcForm($core,'post','post.php');
-
+	
+	$sortby_combo = array(
+	__('Date') => 'post_dt',
+	__('Title') => 'post_title',
+	__('Category') => 'cat_title',
+	__('Author') => 'user_id',
+	__('Status') => 'post_status',
+	__('Selected') => 'post_selected'
+	);
+	
+	$order_combo = array(
+	__('Descending') => 'desc',
+	__('Ascending') => 'asc'
+	);
+}
 
 # Actions combo box
@@ -126,70 +138,196 @@
 $core->callBehavior('adminPostsActionsCombo',array(&$combo_action));
 
-
-
-class monthdcFilterCombo extends dcFilterCombo {
-	public function applyFilter($params) {
-		$month=$this->avalues['values'][0];
-		$params['post_month'] = substr($month,4,2);
-		$params['post_year'] = substr($month,0,4);
-	}
-}
-
-class PostsFetcher extends dcListFetcher {
-
-	public function getEntries($params,$offset,$limit) {
-		$params['limit'] = array($offset,$limit);
-		return $this->core->blog->getPosts($params);
-	}
-
-	public function getEntriesCount($params) {
-		$count = $this->core->blog->getPosts($params,true);
-		return $count->f(0);
-	}
+/* Get posts
+-------------------------------------------------------- */
+$user_id = !empty($_GET['user_id']) ?	$_GET['user_id'] : '';
+$cat_id = !empty($_GET['cat_id']) ?	$_GET['cat_id'] : '';
+$status = isset($_GET['status']) ?	$_GET['status'] : '';
+$selected = isset($_GET['selected']) ?	$_GET['selected'] : '';
+$month = !empty($_GET['month']) ?		$_GET['month'] : '';
+$lang = !empty($_GET['lang']) ?		$_GET['lang'] : '';
+$sortby = !empty($_GET['sortby']) ?	$_GET['sortby'] : 'post_dt';
+$order = !empty($_GET['order']) ?		$_GET['order'] : 'desc';
+
+$show_filters = false;
+
+$page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1;
+$nb_per_page =  30;
+
+if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) {
+	if ($nb_per_page != $_GET['nb']) {
+		$show_filters = true;
+	}
+	$nb_per_page = (integer) $_GET['nb'];
+}
+
+$params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);
+$params['no_content'] = true;
+
+# - User filter
+if ($user_id !== '' && in_array($user_id,$users_combo)) {
+	$params['user_id'] = $user_id;
+	$show_filters = true;
+} else {
+	$user_id='';
+}
+
+# - Categories filter
+if ($cat_id !== '' && in_array($cat_id,$categories_combo)) {
+	$params['cat_id'] = $cat_id;
+	$show_filters = true;
+} else {
+	$cat_id='';
+}
+
+# - Status filter
+if ($status !== '' && in_array($status,$status_combo)) {
+	$params['post_status'] = $status;
+	$show_filters = true;
+} else {
+	$status='';
+}
+
+# - Selected filter
+if ($selected !== '' && in_array($selected,$selected_combo)) {
+	$params['post_selected'] = $selected;
+	$show_filters = true;
+} else {
+	$selected='';
+}
+
+# - Month filter
+if ($month !== '' && in_array($month,$dt_m_combo)) {
+	$params['post_month'] = substr($month,4,2);
+	$params['post_year'] = substr($month,0,4);
+	$show_filters = true;
+} else {
+	$month='';
+}
+
+# - Lang filter
+if ($lang !== '' && in_array($lang,$lang_combo)) {
+	$params['post_lang'] = $lang;
+	$show_filters = true;
+} else {
+	$lang='';
+}
+
+# - Sortby and order filter
+if ($sortby !== '' && in_array($sortby,$sortby_combo)) {
+	if ($order !== '' && in_array($order,$order_combo)) {
+		$params['order'] = $sortby.' '.$order;
+	} else {
+		$order='desc';
+	}
+	
+	if ($sortby != 'post_dt' || $order != 'desc') {
+		$show_filters = true;
+	}
+} else {
+	$sortby='post_dt';
+	$order='desc';
+}
+
+# Get posts
+try {
+	$posts = $core->blog->getPosts($params);
+	$counter = $core->blog->getPosts($params,true);
+	$post_list = new adminPostList($core,$posts,$counter->f(0));
+} catch (Exception $e) {
+	$core->error->add($e->getMessage());
 }
 
 /* DISPLAY
 -------------------------------------------------------- */
-$filterSet = new dcFilterSet($core,'fposts','posts.php');
-
-$filterSet
-	->addFilter(new dcFilterRichCombo(
-		'users',__('Author'), __('Author'), 'user_id', $users_combo,array(
-			'multiple' => true)))
-	->addFilter(new dcFilterRichCombo(
-		'category',__('Category'), __('Category'), 'cat_id', $categories_combo))
-	->addFilter(new dcFilterRichCombo(
-		'post_status',__('Status'), __('Status'), 'post_status', $status_combo))
-	->addFilter(new dcFilterRichCombo(
-		'lang',__('Lang'), __('Lang'), 'post_lang', $lang_combo))
-	->addFilter(new dcFilterCombo(
-		'selected',__('Selected'), __('The post : '),'post_selected', $selected_combo))
-	->addFilter(new monthdcFilterCombo(
-		'month',__('Month'),__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1)))
-	->addFilter(new dcFilterText(
-		'search',__('Contains'),__('The entry contains'), 'search',20,255));
-
-
-$lfetcher = new PostsFetcher($core);
-$lposts = new dcItemList ($core,array('lposts','form-entries'),$filterSet,$lfetcher,'posts_actions.php');
-$lposts->addTemplate('posts_cols.html.twig');
-
-$lposts
-	->addColumn(new dcColumn('title',__('Title'),'post_title'))
-	->addColumn(new dcColumn('cat',__('Category'),'cat_title'))
-	->addColumn(new dcColumn('date',__('Date'),'post_date'))
-	->addColumn(new dcColumn('datetime',__('Date and Time'),'post_dt'))
-	->addColumn(new dcColumn('author',__('Author'),'user_id'))
-	->addColumn(new dcColumn('status',__('Status'),'post_status'));
-
-
-$lposts->setup();
-
-$_ctx
-	->setBreadCrumb(array(__('Entries') => 'posts.php'));
-
-
-$core->tpl->display('posts.html.twig');
-
-
+$starting_script = dcPage::jsLoad('js/_posts_list.js');
+if (!$show_filters) {
+	$starting_script .= dcPage::jsLoad('js/filter-controls.js');
+}
+
+dcPage::open(__('Entries'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Entries').'</span>' => ''
+		))
+);
+
+if (!$core->error->flag())
+{
+	echo
+	'<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>';
+	
+	if (!$show_filters) {
+		echo '<p><a id="filter-control" class="form-control" href="#">'.
+		__('Filter posts list').'</a></p>';
+	}
+	
+	echo
+	'<form action="posts.php" method="get" id="filters-form">'.
+	'<h3>'.__('Filter posts list').'</h3>'.
+
+	'<div class="table">'.
+	'<div class="cell">'.
+	'<p><label for="user_id" class="ib">'.__('Author:').'</label> '.
+	form::combo('user_id',$users_combo,$user_id).'</p>'.
+	'<p><label for="cat_id" class="ib">'.__('Category:').'</label> '.
+	form::combo('cat_id',$categories_combo,$cat_id).'</p>'.
+	'<p><label for="status" class="ib">'.__('Status:').'</label>' .
+	form::combo('status',$status_combo,$status).'</p> '.
+	'</div>'.
+	
+	'<div class="cell">'.
+	'<p><label for="selected" class="ib">'.__('Selected:').'</label> '.
+	form::combo('selected',$selected_combo,$selected).'</p>'.
+	'<p><label for="month" class="ib">'.__('Month:').'</label> '.
+	form::combo('month',$dt_m_combo,$month).'</p>'.
+	'<label for="lang" class="ib">'.__('Lang:').'</label> '.
+	form::combo('lang',$lang_combo,$lang).'</p> '.
+	'</div>'.
+	
+	'<div class="cell filters-options">'.
+	'<p><label for="sortby" class="ib">'.__('Order by:').'</label> '.
+	form::combo('sortby',$sortby_combo,$sortby).'</p>'.
+	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
+	form::combo('order',$order_combo,$order).'</p>'.
+	'<p><span class="label ib">Afficher</span> <label for="nb" class="classic">'.	form::field('nb',3,3,$nb_per_page).' '.
+	__('entries per page').'</label></p>'.
+	'</div>'.
+	'</div>'.
+
+	'<p class="no-margin"><input type="submit" value="'.__('Apply filters').'" /></p>'.
+
+	'<br class="clear" />'. //Opera sucks
+	'</form>';
+	
+	# Show posts
+	$post_list->display($page,$nb_per_page,
+	'<form action="posts_actions.php" method="post" id="form-entries">'.
+	
+	'%s'.
+	
+	'<div class="two-cols">'.
+	'<p class="col checkboxes-helpers"></p>'.
+	
+	'<p class="col right"><label for="action" class="classic">'.__('Selected entries action:').'</label> '.
+	form::combo('action',$combo_action).
+	'<input type="submit" value="'.__('ok').'" /></p>'.
+	form::hidden(array('user_id'),$user_id).
+	form::hidden(array('cat_id'),$cat_id).
+	form::hidden(array('status'),$status).
+	form::hidden(array('selected'),$selected).
+	form::hidden(array('month'),$month).
+	form::hidden(array('lang'),$lang).
+	form::hidden(array('sortby'),$sortby).
+	form::hidden(array('order'),$order).
+	form::hidden(array('page'),$page).
+	form::hidden(array('nb'),$nb_per_page).
+	$core->formNonce().
+	'</div>'.
+	'</form>'
+	);
+}
+
+dcPage::helpBlock('core_posts');
+dcPage::close();
 ?>
Index: admin/posts_actions.php
===================================================================
--- admin/posts_actions.php	(revision 1179)
+++ admin/posts_actions.php	(revision 1399)
@@ -262,7 +262,6 @@
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_cat_id" class="classic">'.__('Category:').' '.
-	form::combo('new_cat_id',$categories_combo,'').
-	'</label> ';
+	'<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '.
+	form::combo('new_cat_id',$categories_combo,'');
 	
 	echo
@@ -295,7 +294,6 @@
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_lang" class="classic">'.__('Entry lang:').' '.
-	form::combo('new_lang',$lang_combo,'').
-	'</label> ';
+	'<p><label for="new_lang" class="classic">'.__('Entry lang:').'</label> '.
+	form::combo('new_lang',$lang_combo,'');
 	
 	echo
@@ -313,7 +311,6 @@
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_auth_id" class="classic">'.__('Author ID:').' '.
-	form::field('new_auth_id',20,255).
-	'</label> ';
+	'<p><label for="new_auth_id" class="classic">'.__('Author ID:').'</label> '.
+	form::field('new_auth_id',20,255);
 	
 	echo
Index: admin/preferences.php
===================================================================
--- admin/preferences.php	(revision 1332)
+++ admin/preferences.php	(revision 1399)
@@ -348,31 +348,31 @@
 	
 	# --BEHAVIOR-- adminPreferencesHeaders
-	$core->callBehavior('adminPreferencesHeaders')
-);
-
-if (!empty($_GET['upd'])) {
-	dcPage::message(__('Personal information has been successfully updated.'));
-}
-if (!empty($_GET['updated'])) {
-	dcPage::message(__('Personal options has been successfully updated.'));
-}
-if (!empty($_GET['append'])) {
-	dcPage::message(__('Favorites have been successfully added.'));
-}
-if (!empty($_GET['neworder'])) {
-	dcPage::message(__('Favorites have been successfully updated.'));
-}
-if (!empty($_GET['removed'])) {
-	dcPage::message(__('Favorites have been successfully removed.'));
-}
-if (!empty($_GET['replaced'])) {
-	dcPage::message(__('Default favorites have been successfully updated.'));
-}
-
-echo dcPage::breadcrumb(
+	$core->callBehavior('adminPreferencesHeaders'),
+
+	dcPage::breadcrumb(
 	array(
 		html::escapeHTML($core->auth->userID()) => '',
 		'<span class="page-title">'.$page_title.'</span>' => ''
-	));
+	))
+);
+
+if (!empty($_GET['upd'])) {
+	dcPage::message(__('Personal information has been successfully updated.'));
+}
+if (!empty($_GET['updated'])) {
+	dcPage::message(__('Personal options has been successfully updated.'));
+}
+if (!empty($_GET['append'])) {
+	dcPage::message(__('Favorites have been successfully added.'));
+}
+if (!empty($_GET['neworder'])) {
+	dcPage::message(__('Favorites have been successfully updated.'));
+}
+if (!empty($_GET['removed'])) {
+	dcPage::message(__('Favorites have been successfully removed.'));
+}
+if (!empty($_GET['replaced'])) {
+	dcPage::message(__('Default favorites have been successfully updated.'));
+}
 
 # User profile
@@ -384,18 +384,18 @@
 '<div class="two-cols">'.
 '<div class="col">'.
-'<p><label for="user_name">'.__('Last Name:').
-form::field('user_name',20,255,html::escapeHTML($user_name)).'</label></p>'.
-
-'<p><label for="user_firstname">'.__('First Name:').
-form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).'</label></p>'.
-
-'<p><label for="user_displayname">'.__('Display name:').
-form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).'</label></p>'.
-
-'<p><label for="user_email">'.__('Email:').
-form::field('user_email',20,255,html::escapeHTML($user_email)).'</label></p>'.
-
-'<p><label for="user_url">'.__('URL:').
-form::field('user_url',30,255,html::escapeHTML($user_url)).'</label></p>'.
+'<p><label for="user_name">'.__('Last Name:').'</label>'.
+form::field('user_name',20,255,html::escapeHTML($user_name)).'</p>'.
+
+'<p><label for="user_firstname">'.__('First Name:').'</label>'.
+form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).'</p>'.
+
+'<p><label for="user_displayname">'.__('Display name:').'</label>'.
+form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).'</p>'.
+
+'<p><label for="user_email">'.__('Email:').'</label>'.
+form::field('user_email',20,255,html::escapeHTML($user_email)).'</p>'.
+
+'<p><label for="user_url">'.__('URL:').'</label>'.
+form::field('user_url',30,255,html::escapeHTML($user_url)).'</p>'.
 
 '</div>'.
@@ -403,9 +403,9 @@
 '<div class="col">'.
 
-'<p><label for="user_lang">'.__('User language:').
-form::combo('user_lang',$lang_combo,$user_lang,'l10n').'</label></p>'.
-
-'<p><label for="user_tz">'.__('User timezone:').
-form::combo('user_tz',dt::getZones(true,true),$user_tz).'</label></p>'.
+'<p><label for="user_lang">'.__('User language:').'</label>'.
+form::combo('user_lang',$lang_combo,$user_lang,'l10n').'</p>'.
+
+'<p><label for="user_tz">'.__('User timezone:').'</label>'.
+form::combo('user_tz',dt::getZones(true,true),$user_tz).'</p>'.
 
 '</div>'.
@@ -420,14 +420,14 @@
 	'<legend>'.__('Change your password').'</legend>'.
 	
-	'<p><label for="new_pwd">'.__('New password:').
-	form::password('new_pwd',20,255).'</label></p>'.
+	'<p><label for="new_pwd">'.__('New password:').'</label>'.
+	form::password('new_pwd',20,255).'</p>'.
 	
-	'<p><label for="new_pwd_c">'.__('Confirm password:').
-	form::password('new_pwd_c',20,255).'</label></p>'.
+	'<p><label for="new_pwd_c">'.__('Confirm password:').'</label>'.
+	form::password('new_pwd_c',20,255).'</p>'.
 	'</fieldset>'.
 	
 	'<p>'.__('If you have changed this user email or password you must provide your current password to save these modifications.').'</p>'.
-	'<p><label for="cur_pwd">'.__('Your password:').
-	form::password('cur_pwd',20,255).'</label></p>';
+	'<p><label for="cur_pwd">'.__('Your password:').'</label>'.
+	form::password('cur_pwd',20,255).'</p>';
 }
 
@@ -447,12 +447,12 @@
 '<fieldset><legend>'.__('My options').'</legend>'.
 
-'<p><label for="user_post_format">'.__('Preferred format:').
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</label></p>'.
-
-'<p><label for="user_post_status">'.__('Default entry status:').
-form::combo('user_post_status',$status_combo,$user_post_status).'</label></p>'.
-
-'<p><label for="user_edit_size">'.__('Entry edit field height:').
-form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).'</label></p>'.
+'<p><label for="user_post_format">'.__('Preferred format:').'</label>'.
+form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</p>'.
+
+'<p><label for="user_post_status">'.__('Default entry status:').'</label>'.
+form::combo('user_post_status',$status_combo,$user_post_status).'</p>'.
+
+'<p><label for="user_edit_size">'.__('Entry edit field height:').'</label>'.
+form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).'</p>'.
 
 '<p><label for="user_wysiwyg" class="classic">'.
@@ -470,6 +470,6 @@
 if (count($iconsets_combo) > 1) {
 	echo 
-		'<p><label for="user_ui_iconset">'.__('Iconset:').
-		form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</label></p>';
+		'<p><label for="user_ui_iconset">'.__('Iconset:').'</label>'.
+		form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</p>';
 } else {
 	form::hidden('user_ui_iconset','');
Index: admin/search.php
===================================================================
--- admin/search.php	(revision 1333)
+++ admin/search.php	(revision 1358)
@@ -70,11 +70,11 @@
 
 
-dcPage::open(__('Search'),$starting_scripts);
-
-echo dcPage::breadcrumb(
-	array(
-		html::escapeHTML($core->blog->name) => '',
-		'<span class="page-title">'.__('Search').'</span>' => ''
-	));
+dcPage::open(__('Search'),$starting_scripts,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Search').'</span>' => ''
+		))
+);
 
 echo
@@ -84,5 +84,5 @@
 '<p><label for="qtype1" class="classic">'.form::radio(array('qtype','qtype1'),'p',$qtype == 'p').' '.__('Search in entries').'</label> '.
 '<label for="qtype2" class="classic">'.form::radio(array('qtype','qtype2'),'c',$qtype == 'c').' '.__('Search in comments').'</label></p>'.
-'</p><input type="submit" value="'.__('Search').'" /></p>'.
+'<p><input type="submit" value="'.__('Search').'" /></p>'.
 '</div>'.
 '</form>';
Index: admin/style/default.css
===================================================================
--- admin/style/default.css	(revision 1413)
+++ admin/style/default.css	(revision 1415)
@@ -36,5 +36,5 @@
 }
 
-h1, h2, h3, h4, h5, h6, p {
+h1, h2, h3, .as_h3, h4, h5, h6, p {
 	margin-top: 0;
 	margin-bottom: 1rem;
@@ -58,7 +58,19 @@
 	background: #fff url(bg_h2.png) repeat-x center bottom;
 }
-h3 {
+h3, .as_h3 {
 	color: #575859;
 	font-size: 1.4rem;
+}
+h4 {
+	font-size: 1.1em;
+	color: #575859;
+}
+h5 {
+	font-size: 1em;
+	color: #575859;
+}
+#entry-sidebar h5 {
+	font-weight: normal;
+	color: #333;
 }
 p, div.p {
@@ -252,6 +264,6 @@
 /* -------------------------------------------------------------- layout - onglets */
 .part-tabs ul {
-	padding: .5em 0 .3em 1em;
-	border-bottom: 1px solid #ccc;
+	padding: .5em 0 .3em 1.2rem;
+	border-bottom: 1px solid #ddd;
 }
 .part-tabs li {
@@ -261,18 +273,11 @@
 }
 .part-tabs li a {
-	padding: .5em 0.5em;
-	margin-right: .5em;
+	padding: .5em 2em;
+	margin-right: -1px;
 	border: 1px solid #ccc;
 	border-bottom: none;
-	background: #dfdfdf;
 	text-decoration: none;
-	color: #000;
-	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #fafafa) );
-	background:-moz-linear-gradient( center top, #dfdfdf 5%, #fafafa 100% );
-	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#fafafa');
-	background-color:#ededed;
-}
-.part-tabs li.part-tabs-link a {
-	background: #ffe;
+	color: #333;
+	background-color:#eef;
 }
 .part-tabs li a:hover, .part-tabs li a:focus {
@@ -283,6 +288,4 @@
 .part-tabs li.part-tabs-active a {
 	background: #fff;
-	border: 1px solid #d30e60;
-	color: #d30e60;
 	font-weight: bold;
 	border-bottom-color: #fff;
@@ -318,4 +321,7 @@
 	background-repeat: no-repeat;
 	background-position: 8px .3em;
+}
+#main-menu li.active {
+	background-color: #fff;
 }
 #main-menu a {
@@ -356,5 +362,5 @@
 	background: #dfdfdf;
 	border-color: #999;
-	color: #666;
+	color: #444;
 	border-bottom-right-radius: .6em;
 	border-top-right-radius: .6em;
@@ -378,7 +384,5 @@
 	color: #000;
 	font-variant: small-caps;
-}
-#favorites-menu a {
-	color: #333;
+	padding-top: .6rem;
 }
 /* ------------------------------------------------------------------ footer */
@@ -416,4 +420,5 @@
 	padding: 1em 1em 0 1em;
 	border-radius: 4px;
+	background: #fff;
 }
 #login-screen legend {
@@ -432,13 +437,5 @@
 /* ------------------------------------------------------------------ dashboard */
 #dashboard-main {
-	float: left;
-	overflow: hidden;
-	padding: 1em 2% 1em 0;
-	width: 70%;
-}
-#dashboard-main.fullwidth {
-	width: 100%;
 	padding: 1em 0;
-	float: none;
 }
 #icons {
@@ -450,6 +447,8 @@
 	width: 210px;
 	text-align: center;
-	margin: 2em 0;
+	margin: 1em 0 2em;
+	padding: 1em 0;
 	display:inline-block;
+	vertical-align: top;
 }
 #icons a,
@@ -463,4 +462,15 @@
 #icons a span {
 	border-bottom: 1px dotted #f90;
+	color: #333;
+}
+#icons a img {
+	padding: 2em;
+	background: #eee;
+	border-radius: 1.6rem;
+	box-shadow: 0 3px 3px 0 #ccc;
+	margin-bottom: .6rem;
+}
+#icons a img:hover, #icons a:focus img {
+	background-color: #BBDB58;
 }
 #icons a:focus span, #icons a:hover span {
@@ -468,5 +478,4 @@
 }
 #quick {
-	clear: left;
 	margin-top: 2em;
 }
@@ -483,9 +492,14 @@
 }
 #dashboard-items {
-	float: left;
-	width: 27%;
-	overflow: hidden;
-	padding-bottom: 1em;
-	padding-top: 3em;
+	margin: 3em auto;
+	display: table;
+	width: 100%;
+	border-collapse: collapse;
+}
+.db-item {
+	display: table-cell;
+	padding: 1em 3em;
+	vertical-align: top;
+	border: 1px solid #ccc;
 }
 #dashboard-items img {
@@ -528,5 +542,13 @@
 #entry-content {
 	margin-right: 19em;
-	margin-left: 1.2rem;
+	margin-left: 0;
+}
+.multi-part {
+	padding-left: 1.2rem;
+}
+#entry-content label {
+	text-transform: uppercase;
+	font-weight: bold;
+	margin-top: 2em;
 }
 #entry-sidebar {
@@ -534,11 +556,14 @@
 	float: right;
 }
+#entry-sidebar input[type="text"],
+#entry-sidebar select {
+	width: 14em; /* to prevent inline with label */
+}
+.box {
+	border-bottom: 1px solid #ddd;
+	margin-bottom: 1em;
+}
 #comments {
 	clear: both;
-}
-.preview_entry a {
-	border: 1px solid #ccc;
-	padding: .2rem .5rem;
-	background: #eef;
 }
 /* ------------------------------------------------------------------ categories */
@@ -949,7 +974,4 @@
 	color: #fff;
 }
-#content > .message, #content > .error {
-	margin-right: 14em
-}
 /* ------------------------------------------------------------------ navigation */
 .anchor-nav {
@@ -958,4 +980,25 @@
 	padding: .4rem 1.2rem;
 	float: right;
+}
+.nav_prevnext {
+	margin-bottom: 2em;
+	color: #fff;
+}
+.nav_prevnext a, a.back {
+	border: 1px solid #ddd;
+	padding: .2rem 2rem;
+	border-radius: 1rem;
+	background-color: #eee;
+}
+a.back:before {
+	content: "\ab\a0";
+}
+a.onblog_link {
+	color: #333;
+	float: right;
+	border: 1px solid #eee;
+	padding: .2rem 2rem;
+	border-radius: 1rem;
+	background-color: #ffe;
 }
 /* ------------------------------------------------------------------ debug */
@@ -982,8 +1025,12 @@
 /* -------------------------------------------------------------------- CLASSES COMMUNES */
 
-.no-margin {
-	margin: 0;
-}
-
+.no-margin, #entry-content label.no-margin {
+	margin: 0;
+}
+.border-top {
+	border-top: 1px solid #999;
+	padding-top: 1em;
+	margin-top:	1em;
+}
 /* paragraphe pour bouton Nouveau bidule */
 p.top-add {
@@ -1116,4 +1163,9 @@
 table.settings, table.prefs {
 	width: 80%;
+	border: 1px solid #999;
+	margin-bottom: 3em; 
+}
+table.settings th, table.prefs th {
+	background: #eef;
 }
 table.settings th:first-child, table.prefs th:first-child {
@@ -1129,5 +1181,4 @@
 	width: 40%;
 }
-
 td.status {
 	vertical-align: middle;
@@ -1168,5 +1219,4 @@
 	padding-left: 15px;
 }
-
 /* ----------------------------------------------------------------- FORMS */
 form {
@@ -1184,4 +1234,7 @@
 	background: #f5f5f5;
 }
+.fieldset {
+	background: #eef;
+}
 legend {
 	font-weight: bold;
@@ -1190,5 +1243,5 @@
 	border-style: solid;
 	border-color: #ccc;
-	background: #f5f5f5;
+	background: #eef;
 	margin-bottom: 0.5em;
 }
@@ -1243,4 +1296,5 @@
 	font-style:italic;
 	font-weight: normal;
+	text-transform: none;
 	color: #666;
 }
@@ -1259,4 +1313,7 @@
 .form-note a {border-bottom: 1px solid #99f;}
 
+label.ib {
+	display: inline-block;
+}
 label.classic {
 	display: inline;
@@ -1308,7 +1365,7 @@
 	display: none;
 	font-weight: bold;
-	background: url(magnifier.png) no-repeat 0 0;
-	color: green;
+	background: url(../images/expand.png) no-repeat .6rem center;
 	padding-left: 20px;
+	color: #000;
 }
 .constrained {
@@ -1325,5 +1382,4 @@
 input[type=button],
 a.button,
-a.back,
 a.submit {
 	display: inline-block;
@@ -1337,4 +1393,6 @@
 	margin-bottom: .1em;
 }
+h4 a.button {font-weight: normal;}
+
 /* validation */
 input[type=submit],
@@ -1361,5 +1419,4 @@
 /* suppression et reset */
 a.button,
-a.back,
 input[type=submit].reset,
 input[type=submit].delete {
@@ -1372,10 +1429,8 @@
 	}
 a.button:hover,
-a.back:hover,
 input[type=reset]:hover,
 input[type=submit].reset:hover,
 input[type=submit].delete:hover,
 a.button:focus,
-a.back:focus,
 input[type=reset]:focus,
 input[type=submit].reset:focus,
@@ -1390,5 +1445,5 @@
 input[type=submit].delete {
 	color: #c00;
-	padding-bottom: .1em;
+	padding-bottom: .2rem;
 }
 #entry-content .delete {
@@ -1411,7 +1466,4 @@
 	margin-left: 2em;
 }
-a.back:before {
-	content: "\ab\a0";
-}
 .button.add {
 	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #9dce2c), color-stop(1, #8cb82b) );
@@ -1421,5 +1473,4 @@
 	border:1px solid #83c41a;
 	padding:.6rem 1.8rem;
-	text-shadow:1px 1px 0 #689324;
 	color: #000;
 	text-shadow: 1px 1px 0 #BBDB58;
@@ -1436,8 +1487,4 @@
 .button-add:focus {
 	outline: dotted 1px;
-}
-.button.add:active {
-	position:relative;
-	top:1px;
 }
 
@@ -1475,9 +1522,68 @@
 }
 
+/* ------------------------------------------------------- Filters */
+#filters-form {
+	border: 1px dashed #999;
+	border-radius: .6rem;
+	margin-bottom: 2em;
+	padding: .5em 1em 0;
+}
+#filters-form .table {
+	display: table;
+	width: 100%;
+	padding: 0;
+	margin-bottom: 1em;
+	margin-top: 1.5em;
+}
+#filters-form .cell {
+	padding: 0 2em 0 0;
+	display: table-cell;
+	vertical-align: top;
+}
+#filters-form .filters-options {
+	padding-left: 2em;
+	border-left: 1px solid #ccc;
+}
+#filters-form label.ib, span.ib {
+	width:7em;
+	display: inline-block;
+}
+#filters-form select {
+	width: 14em;
+}
+
+/* ---------------------------------------------------- Pagination */
+.pagination {
+	height: 20px;
+	line-height: 20px;
+	padding: 0 1rem; 
+	border: 1px solid #ccc;
+	overflow: hidden; 
+	background: #e1e1e1; 
+	background: -moz-linear-gradient(center top , #f2f2f2, #e1e1e1); 
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e1e1e1)); 
+	-moz-border-radius: 4px; 
+	-webkit-border-radius: 4px; 
+	border-radius: 4px; 
+}
+.pagination a, .pagination strong {
+	height: 20px;
+	border: none;
+	padding: 2px 6px; 
+	background-color : transparent;
+	background-position : 50% 50%;
+	background-repeat: no-repeat;
+}
+.pagination a:hover, .pagination strong {
+	border-color : #ccc;
+	background-color: #fff;
+}
+
 /* ---------------------------------------------------------------------------
 	Media queries vite fait en attendant la reprise complète du layout
 ---------------------------------------------------------------------------- */
 @media screen and (max-width: 920px) {
-	#top, #top h1 a {width: 42px !important; height:100%; overflow: hidden;}
+	#top, #top h1 a {width: 42px !important; height:100%; overflow: hidden;
+}
 	#top h1 a:link {
 		background: transparent url(dc_logos/b-dotclear120.png) no-repeat -180px 6px; 
@@ -1497,4 +1603,5 @@
 		line-height: 3.2rem;
 	}
+	#info-box1 {margin-left: 1rem;}
 	#info-box1 select {width: 14rem;}
 	#main-menu, #main, #content, #content h2, #entry-wrapper, #entry-sidebar, #entry-content, .two-cols .col, .two-cols .col:first-child {
@@ -1515,5 +1622,6 @@
 	.smallscreen {display: none;}
 	#help-button {width:20px; overflow: hidden;}
-	#info-box1 {margin-left: 1rem;}
+	#info-box2 {float:none;}
+	#dashboard-items div {display: block;margin-bottom: 1em; padding: 0 1em;}
 }
 @media screen and (max-width: 492px) {
@@ -1522,4 +1630,5 @@
 	.page-title, #info-boxes, .media-item {display: inline-block;}
 	div.media-list .media-item {width: 90%; float: none}
+	#info-box1 select {width: 12rem; margin-right: .6rem;}
 	#info-box1 p.nomobile, label.nomobile {display: none;}
 	#help-button {height:26px; width:26px; background-color: #A2CBE9; padding: 0; margin:0;font-size: 1rem;line-height: 68px}
Index: admin/style/jsToolBar/jsToolBar.css
===================================================================
--- admin/style/jsToolBar/jsToolBar.css	(revision 1065)
+++ admin/style/jsToolBar/jsToolBar.css	(revision 1399)
@@ -2,6 +2,5 @@
 	border-width : 0 1px 1px 1px;
 	border-style : solid;
-	border-color : #000 #ccc #ccc #000;
-	padding-left: 5px;
+	border-color : #ccc;
 	background : #f9f9f9;
 }
@@ -9,6 +8,10 @@
   margin: 0;
   border: 0;
+  padding: 0;
 }
-
+.jstEditor textarea {
+  width: 99%;
+  padding: 1rem 0 0 1%;
+}
 .jstHandle {
 	height: 8px;
@@ -22,9 +25,17 @@
 
 .jstElements {
-	padding: 3px 3px;
-	border-width: 1px 1px 0 1px;
-	border-style: solid;
-	border-color: #000 #ccc #ccc #000;
-	background: #dfdfdf;
+	height: 28px;
+	padding: 0 1rem; 
+	border: 1px solid #ccc;
+	overflow: hidden; 
+	background: #e1e1e1; 
+	background: -moz-linear-gradient(center top , #f2f2f2, #e1e1e1); 
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e1e1e1)); 
+	-moz-border-radius: 4px 4px 0 0; 
+	-webkit-border-radius: 4px 4px 0 0; 
+	border-radius: 4px 4px 0 0; 
+	-webkit-box-shadow: 0 1px 0 #FFF inset; 
+	-moz-box-shadow: 0 1px 0 #FFF inset; 
+	box-shadow: 0 1px 0 #FFF inset;
 }
 
@@ -34,13 +45,12 @@
 .jstElements select {
 	width: 12em;
+	margin-right: .6rem;
 }
 .jstElements button {
-	margin-right : 2px;
-	width : 20px;
-	height: 20px;
-	padding: 0;
-	border-style: solid;
-	border-width: 1px;
-	border-color: #dfdfdf;
+	width : 30px;
+	height: 28px;
+	border-style: groove;
+	border-width:  0 1px 0 0;
+	border-color: #666;
 	background-color : transparent;
 	background-position : 50% 50%;
@@ -55,11 +65,16 @@
 }
 .jstElements span {
-	display : inline;
+	display : inline-block;
+	vertical-align: top;
+	background: #dfdfdf;
 }
 
 .jstSpacer {
-	width : 0px;
-	font-size: 1px;
-	margin-right: 4px;
+	width : 2px;
+	height: 28px;
+	margin-right: 0;
+	border-style: groove;
+	border-width:  0 1px 0 0;
+	border-color: #666;
 }
 
Index: admin/trackbacks.php
===================================================================
--- admin/trackbacks.php	(revision 1332)
+++ admin/trackbacks.php	(revision 1399)
@@ -83,5 +83,15 @@
 /* DISPLAY
 -------------------------------------------------------- */
-dcPage::open($page_title,dcPage::jsLoad('js/_trackbacks.js'));
+if ($can_view_page) {
+	$breadcrumb = dcPage::breadcrumb(
+	array(
+		html::escapeHTML($core->blog->name) => '',
+		html::escapeHTML($post->post_title) => $core->getPostAdminURL($post->post_type,$id),
+		'<span class="page-title">'.$page_title.'</span>' => ''
+	));
+} else {
+	$breadcrumb = '';
+}
+dcPage::open($page_title,dcPage::jsLoad('js/_trackbacks.js'),$breadcrumb);
 
 # Exit if we cannot view page
@@ -94,10 +104,4 @@
 	dcPage::message(__('All pings sent.'));
 }
-
-echo dcPage::breadcrumb(
-	array(
-		html::escapeHTML($core->blog->name) => '',
-		'<span class="page-title">'.$page_title.'</span>' => ''
-	));
 
 echo '<p><a class="back" href="'.$core->getPostAdminURL($post->post_type,$id).'">'.
@@ -123,10 +127,10 @@
 '<h3>'.__('Ping blogs').'</h3>'.
 '<form action="trackbacks.php" id="trackback-form" method="post">'.
-'<p><label for="tb_urls" class="area">'.__('URLs to ping:').
+'<p><label for="tb_urls" class="area">'.__('URLs to ping:').'</label>'.
 form::textarea('tb_urls',60,5,$tb_urls).
-'</label></p>'.
+'</p>'.
 
-'<p><label for="tb_excerpt" class="area">'.__('Send excerpt:').
-form::textarea('tb_excerpt',60,3,$tb_excerpt).'</label></p>'.
+'<p><label for="tb_excerpt" class="area">'.__('Send excerpt:').'</label>'.
+form::textarea('tb_excerpt',60,3,$tb_excerpt).'</p>'.
 
 '<p>'.form::hidden('id',$id).
Index: admin/update.php
===================================================================
--- admin/update.php	(revision 1332)
+++ admin/update.php	(revision 1358)
@@ -168,14 +168,11 @@
 -------------------------------------------------------- */
 dcPage::open(__('Dotclear update'),
-	(!$step ? dcPage::jsPageTabs($default_tab) : '')
-);
-
-if (!$core->error->flag()) {
-	echo dcPage::breadcrumb(
+	(!$step ? dcPage::jsPageTabs($default_tab) : ''),
+	dcPage::breadcrumb(
 		array(
 			__('System') => '',
 			'<span class="page-title">'.__('Dotclear update').'</span>' => ''
-		));
-}
+		))
+);
 
 if (!$step)
Index: admin/user.php
===================================================================
--- admin/user.php	(revision 1332)
+++ admin/user.php	(revision 1399)
@@ -174,5 +174,12 @@
 	
 	# --BEHAVIOR-- adminUserHeaders
-	$core->callBehavior('adminUserHeaders')
+	$core->callBehavior('adminUserHeaders'),
+
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.$page_title.'</span>' => ''
+		))
 );
 
@@ -184,11 +191,4 @@
 	dcPage::message(__('User has been successfully created.'));
 }
-
-echo dcPage::breadcrumb(
-	array(
-		__('System') => '',
-		__('Users') => 'users.php',
-		'<span class="page-title">'.$page_title.'</span>' => ''
-	));
 
 if ($user_id == $core->auth->userID()) {
@@ -203,26 +203,26 @@
 '<div class="two-cols">'.
 '<div class="col">'.
-'<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '.
+'<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').'</label> '.
 form::field('user_id',20,255,html::escapeHTML($user_id)).
-'</label></p>'.
+'</p>'.
 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'.
 
 '<p><label for="new_pwd" '.($user_id != '' ? '' : 'class="required"').'>'.
 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').
-($user_id != '' ? __('New password:') : __('Password:')).' '.
+($user_id != '' ? __('New password:') : __('Password:')).'</label> '.
 form::password('new_pwd',20,255).
-'</label></p>'.
+'</p>'.
 '<p class="form-note">'.__('Password must contain at least 6 characters.').'</p>'.
 
 '<p><label for="new_pwd_c" '.($user_id != '' ? '' : 'class="required"').'>'.
-($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').' '.
+($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').'</label> '.
 form::password('new_pwd_c',20,255).
-'</label></p>'.
-
-'<p><label for="user_name">'.__('Last Name:').' '.
+'</p>'.
+
+'<p><label for="user_name">'.__('Last Name:').'</label> '.
 form::field('user_name',20,255,html::escapeHTML($user_name)).
-'</label></p>'.
-
-'<p><label for="user_firstname">'.__('First Name:').' '.
+'</p>'.
+
+'<p><label for="user_firstname">'.__('First Name:').'</label> '.
 form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).
 '</label></p>'.
@@ -230,35 +230,35 @@
 '<p><label for="user_displayname">'.__('Display name:').' '.
 form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).
-'</label></p>'.
-
-'<p><label for="user_email">'.__('Email:').' '.
+'</p>'.
+
+'<p><label for="user_email">'.__('Email:').'</label> '.
 form::field('user_email',20,255,html::escapeHTML($user_email)).
-'</label></p>'.
+'</p>'.
 '<p class="form-note">'.__('Mandatory for password recovering procedure.').'</p>'.
 '</div>'.
 
 '<div class="col">'.
-'<p><label for="user_url">'.__('URL:').' '.
+'<p><label for="user_url">'.__('URL:').'</label> '.
 form::field('user_url',30,255,html::escapeHTML($user_url)).
-'</label></p>'.
-'<p><label for="user_post_format">'.__('Preferred format:').' '.
+'</p>'.
+'<p><label for="user_post_format">'.__('Preferred format:').'</label> '.
 form::combo('user_post_format',$formaters_combo,$user_options['post_format']).
-'</label></p>'.
-
-'<p><label for="user_post_status">'.__('Default entry status:').' '.
+'</p>'.
+
+'<p><label for="user_post_status">'.__('Default entry status:').'</label> '.
 form::combo('user_post_status',$status_combo,$user_post_status).
-'</label></p>'.
-
-'<p><label for="user_edit_size">'.__('Entry edit field height:').' '.
+'</p>'.
+
+'<p><label for="user_edit_size">'.__('Entry edit field height:').'</label> '.
 form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).
-'</label></p>'.
-
-'<p><label for="user_lang">'.__('User language:').' '.
+'</p>'.
+
+'<p><label for="user_lang">'.__('User language:').'</label> '.
 form::combo('user_lang',$lang_combo,$user_lang,'l10n').
-'</label></p>'.
-
-'<p><label for="user_tz">'.__('User timezone:').' '.
+'</p>'.
+
+'<p><label for="user_tz">'.__('User timezone:').'</label> '.
 form::combo('user_tz',dt::getZones(true,true),$user_tz).
-'</label></p>';
+'</p>';
 
 if ($core->auth->allowPassChange()) {
@@ -283,6 +283,6 @@
 echo
 '<p><label for="your_pwd" '.($user_id != '' ? '' : 'class="required"').'>'.
-($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Your password:').
-form::password('your_pwd',20,255).'</label></p>'.
+($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Your password:').'</label>'.
+form::password('your_pwd',20,255).'</p>'.
 '<p class="clear"><input type="submit" name="save" accesskey="s" value="'.__('Save').'" />'.
 ($user_id != '' ? '' : ' <input type="submit" name="saveplus" value="'.__('Save and create another').'" />').
Index: admin/users.php
===================================================================
--- admin/users.php	(revision 1332)
+++ admin/users.php	(revision 1358)
@@ -94,5 +94,11 @@
 }
 
-dcPage::open(__('Users'),$starting_script);
+dcPage::open(__('Users'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('Users').'</span>' => ''
+		))
+);
 
 if (!$core->error->flag())
@@ -105,10 +111,4 @@
 	}
 	
-	echo dcPage::breadcrumb(
-		array(
-			__('System') => '',
-			'<span class="page-title">'.__('Users').'</span>' => ''
-		));
-
 	echo
 	'<p class="top-add"><strong><a class="button add" href="user.php">'.__('Create a new user').'</a></strong></p>';
Index: admin/users_actions.php
===================================================================
--- admin/users_actions.php	(revision 1332)
+++ admin/users_actions.php	(revision 1399)
@@ -131,9 +131,26 @@
 /* DISPLAY
 -------------------------------------------------------- */
+if (!empty($users) && empty($blogs) && $action == 'blogs') {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.__('Permissions').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.__('Actions').'</span>' => ''
+		));
+}
+
 dcPage::open(
 	__('Users'),
 	dcPage::jsLoad('js/_users_actions.js').
 	# --BEHAVIOR-- adminUsersActionsHeaders
-	$core->callBehavior('adminUsersActionsHeaders')
+	$core->callBehavior('adminUsersActionsHeaders'),
+	$breadcrumb
 );
 
@@ -177,11 +194,4 @@
 	}
 	
-	echo dcPage::breadcrumb(
-		array(
-			__('System') => '',
-			__('Users') => 'users.php',
-			'<span class="page-title">'.__('Permissions').'</span>' => ''
-		));
-
 	echo
 	'<p>'.sprintf(
@@ -275,6 +285,6 @@
 	echo
 	'<fieldset><legend>'.__('Validate permissions').'</legend>'.
-	'<p><label for="your_pwd">'.__('Your password:').
-	form::password('your_pwd',20,255).'</label></p>'.
+	'<p><label for="your_pwd">'.__('Your password:').'</label>'.
+	form::password('your_pwd',20,255).'</p>'.
 	'</fieldset>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
