Index: extensions/Admin_Messages/admin/admin.php
===================================================================
--- extensions/Admin_Messages/admin/admin.php	(revision 9421)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<?php
-if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-// Langue et configuration
-global $conf;
-load_language('plugin.lang', AM_PATH);
-$conf['admin_messages'] = unserialize($conf['admin_messages']);
-
-
-// +-----------------------------------------------------------------------+
-//				Tabsheet
-// +-----------------------------------------------------------------------+
-include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
-$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'list';
-	
-$tabsheet = new tabsheet();
-$tabsheet->add('list', l10n('AM_list_tab'), AM_ADMIN .'&amp;tab=list'); 		// Liste de smessages
-$tabsheet->add('new', l10n('AM_new_tab'), AM_ADMIN .'&amp;tab=new'); 			// Ajouter un nouveau message
-$tabsheet->add('config', l10n('Configuration'), AM_ADMIN .'&amp;tab=config'); 	// Configuration
-$tabsheet->select($page['tab']);
-$tabsheet->assign();
-
-
-// +-----------------------------------------------------------------------+
-//				Template
-// +-----------------------------------------------------------------------+
-$template->assign('AM_VERSION', AM_NAME .' '. AM_VERSION);
-$template->assign('AM_PATH', AM_PATH);
-$template->assign('AM_ADMIN', AM_ADMIN);
-
-include(AM_PATH .'admin/'.$page['tab'].'.php');
-?>
Index: extensions/Admin_Messages/admin/config.php
===================================================================
--- extensions/Admin_Messages/admin/config.php	(revision 9421)
+++ extensions/Admin_Messages/admin/config.php	(revision 9786)
@@ -12,5 +12,5 @@
 	
 	pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'admin_messages';");
-	redirect(AM_ADMIN .'&amp;tab=config&amp;msg=saved');
+	$page['infos'][] = l10n('Information data registered in database');
 }
 
@@ -19,7 +19,4 @@
 //				Définition des variables template
 // +-----------------------------------------------------------------------+
-if (isset($_GET['msg']) AND $_GET['msg'] == 'saved')
-	array_push($page['infos'], l10n('Information data registered in database'));
-	
 $template->assign(array(
 	'NB_MESSAGES' => $conf['admin_messages']['nb_messages'],
Index: extensions/Admin_Messages/admin/list.php
===================================================================
--- extensions/Admin_Messages/admin/list.php	(revision 9421)
+++ extensions/Admin_Messages/admin/list.php	(revision 9786)
@@ -7,9 +7,13 @@
 if (isset($_GET['delete_message'])) {
 	pwg_query("DELETE FROM ". AM_TABLE ." WHERE id = ". $_GET['delete_message'] .";");
-	redirect(AM_ADMIN);
+	if (isset($_GET['redirect']) AND $_GET['redirect'] = 'home')
+		redirect(get_root_url() . 'admin.php#messages');
+	else
+		$page['infos'][] = l10n('AM_message_deleted');
+		
 }
 
-if (isset($_GET['msg']) AND $_GET['msg'] == 'added')
-	array_push($page['infos'], l10n('AM_message_added'));
+if (isset($_GET['msg']))
+	array_push($page['infos'], l10n('AM_message_'. $_GET['msg']));
 
 
@@ -26,6 +30,9 @@
 			'AUTHOR' => $message['author'],
 			'CONTENT' => $message['content'],
-			'U_DELETE' => AM_ADMIN . '&amp;delete_message=' . $message['id'],
 		);
+		if (is_admin() OR $message['author'] = $user['username']) {
+			$item['U_DELETE'] = AM_ADMIN . '&amp;delete_message=' . $message['id'];
+			$item['U_EDIT'] = AM_ADMIN . '&amp;tab=edit&amp;message_id=' . $message['id'];
+		}	
 		
 		$template->append('messages', $item);
Index: extensions/Admin_Messages/admin/new.php
===================================================================
--- extensions/Admin_Messages/admin/new.php	(revision 9421)
+++ extensions/Admin_Messages/admin/new.php	(revision 9786)
@@ -12,19 +12,26 @@
 		
 	} else {
-		pwg_query("INSERT INTO `". AM_TABLE ."`(
-				add_date,
-				author,
-				content
-			)
-			VALUES(
-				'". date('Y-m-d H:i:s') ."',
-				'". $_POST['username'] ."',
-				'". $_POST['content'] ."'
-			);");
+		if (isset($_GET['message_id'])) {
+			pwg_query("UPDATE `". AM_TABLE ."` SET
+					`author` = '". $_POST['username'] ."',
+					`content` = '". $_POST['content'] ."'
+				WHERE `id` = ". $_GET['message_id'] .";");
+		} else {
+			pwg_query("INSERT INTO `". AM_TABLE ."`(
+					add_date,
+					author,
+					content
+				)
+				VALUES(
+					'". date('Y-m-d H:i:s') ."',
+					'". $_POST['username'] ."',
+					'". $_POST['content'] ."'
+				);");
+		}
 		
 		if (isset($_GET['redirect']) AND $_GET['redirect'] = 'home')
-			redirect(PHPWG_ROOT_PATH .'admin.php#messages');
+			redirect(get_root_url() . 'admin.php#messages');
 		else
-			redirect(AM_ADMIN .'&amp;tab=list&amp;msg=added');
+			redirect(AM_ADMIN .'-list&amp;msg=added');
 	}
 }
@@ -34,9 +41,21 @@
 //				Formulaire vierge
 // +-----------------------------------------------------------------------+
-$template->assign(array(
-	'USERNAME' => $user['username'],
-	'FREE_NAME' => (!$conf['admin_messages']['free_name']) ? 'disabled="disabled"' : '',
-));
+if (isset($_GET['message_id'])) {
+	$query = "SELECT * FROM " . AM_TABLE . " WHERE id = " . $_GET['message_id'] . ";";
+	$message = pwg_db_fetch_assoc(pwg_query($query));
 
+	$template->assign(array(
+		'USERNAME' => $message['author'],
+		'CONTENT' => $message['content'],
+		'FREE_NAME' => (!$conf['admin_messages']['free_name']) ? 'disabled="disabled"' : '',
+	));
+
+} else {
+	$template->assign(array(
+		'USERNAME' => $user['username'],
+		'CONTENT' => null,
+		'FREE_NAME' => (!$conf['admin_messages']['free_name']) ? 'disabled="disabled"' : '',
+	));
+}
 
 // +-----------------------------------------------------------------------+
Index: extensions/Admin_Messages/admin/template/config.tpl
===================================================================
--- extensions/Admin_Messages/admin/template/config.tpl	(revision 9421)
+++ extensions/Admin_Messages/admin/template/config.tpl	(revision 9786)
@@ -1,7 +1,5 @@
-{html_head}
-	<link rel="stylesheet" type="text/css" href="{$AM_PATH}admin/template/style.css">
-{/html_head}
+{combine_css path=$AM_PATH|@cat:'admin/template/style.css'}
 
-<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$AM_VERSION}</h2>
+<h2 class="version_title">{$AM_VERSION}</h2>
 
 <div class="titrePage">
Index: extensions/Admin_Messages/admin/template/list.tpl
===================================================================
--- extensions/Admin_Messages/admin/template/list.tpl	(revision 9421)
+++ extensions/Admin_Messages/admin/template/list.tpl	(revision 9786)
@@ -1,7 +1,5 @@
-{html_head}
-	<link rel="stylesheet" type="text/css" href="{$AM_PATH}admin/template/style.css">
-{/html_head}
+{combine_css path=$AM_PATH|@cat:'admin/template/style.css'}
 
-<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$AM_VERSION}</h2>
+<h2 class="version_title">{$AM_VERSION}</h2>
 
 <div class="titrePage">
@@ -19,11 +17,21 @@
 			<li class="categoryLi {if $smarty.foreach.pending_loop.index is odd}virtual_cat{/if}">
 				<ul class="categoryActions">
+					{if isset($message.U_EDIT)}
 					<li>
-						<a href="{$message.U_DELETE}" title="{'AM_delete'|@translate}">
-							<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'AM_delete'|@translate}" />
+						<a href="{$message.U_EDIT}" title="{'edit'|@translate}">
+							<img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}" />
 						</a>
 					</li>
+					{/if}
+					{if isset($message.U_DELETE)}
+					<li>
+						<a href="{$message.U_DELETE}" title="{'delete'|@translate}">
+							<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete'|@translate}" />
+						</a>
+					</li>
+					{/if}
 				</ul>
-				<b>{$message.AUTHOR}</b> - <i>{$message.DATE}</i>
+				
+				<div class="head"><b>{$message.AUTHOR}</b> - <i>{$message.DATE}</i></div>
 				<p>{$message.CONTENT}</p>
 			</li>
Index: extensions/Admin_Messages/admin/template/new.tpl
===================================================================
--- extensions/Admin_Messages/admin/template/new.tpl	(revision 9421)
+++ extensions/Admin_Messages/admin/template/new.tpl	(revision 9786)
@@ -1,13 +1,16 @@
-{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+{combine_script id='jquery'}
+{combine_css path=$AM_PATH|@cat:'admin/template/style.css'}
 {include file='include/autosize.inc.tpl'}
 
-{html_head}
-	<link rel="stylesheet" type="text/css" href="{$AM_PATH}admin/template/style.css">
-{/html_head}
-
-<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$AM_VERSION}</h2>
+<h2 class="version_title">{$AM_VERSION}</h2>
 
 <div class="titrePage">
-	<h2>{'AM_new_tab'|@translate}</h2>
+	<h2>
+	{if isset($CONTENT)}
+		{'AM_edit_tab'|@translate}
+	{else}
+		{'AM_new_tab'|@translate}
+	{/if}
+	</h2>
 </div>
 
@@ -24,5 +27,5 @@
 			<tr>
 				<td><span class="title">{'AM_msg_content'|@translate}</span></td>
-				<td><textarea name="content" rows="4" style="width:100%;"></textarea></td>
+				<td><textarea name="content" rows="4" style="width:100%;">{$CONTENT}</textarea></td>
 			</tr>
 		</table>
Index: extensions/Admin_Messages/admin/template/style.css
===================================================================
--- extensions/Admin_Messages/admin/template/style.css	(revision 9421)
+++ extensions/Admin_Messages/admin/template/style.css	(revision 9786)
@@ -14,2 +14,20 @@
 	font-style:italic;
 }
+.categoryLi div.head {
+	font-size:0.9em;
+	border-bottom:1px dotted #666;
+	width:300px;
+	margin-top:5px;
+}
+.categoryLi p {
+	margin-left:10px;
+}
+.version_title {
+	float:right;
+	position:relative;
+	top:-24px;
+	margin-bottom:-20px !important;
+	font-size:12px !important;
+	font-style:italic;
+	font-weight:normal;
+}
