Index: extensions/Admin_Messages/admin.php
===================================================================
--- extensions/Admin_Messages/admin.php	(revision 9786)
+++ extensions/Admin_Messages/admin.php	(revision 9786)
@@ -0,0 +1,38 @@
+<?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 . '-list'); 		// Liste de smessages
+$tabsheet->add('new', l10n('AM_new_tab'), AM_ADMIN . '-new'); 			// Ajouter un nouveau message
+if ($page['tab'] == 'edit' AND isset($_GET['message_id'])) { 			// Editer le message
+	$tabsheet->add('edit', l10n('AM_edit_tab'), CR_ADMIN . '-edit&amp;message_id=' . $_GET['message_id']);
+}
+$tabsheet->add('config', l10n('Configuration'), AM_ADMIN . '-config'); 	// Configuration
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->assign(array(
+	'AM_VERSION' => AM_NAME . ' ' . AM_VERSION,
+	'AM_PATH' => AM_PATH,
+	'AM_ADMIN' => AM_ADMIN,
+));
+
+if ($page['tab'] == 'edit') { $page['tab'] = 'new'; } // L'édition se fait sur la page de création
+include(AM_PATH .'admin/' . $page['tab'] . '.php');
+?>
Index: extensions/Admin_Messages/admin/admin.php
===================================================================
--- extensions/Admin_Messages/admin/admin.php	(revision 9774)
+++ 	(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 9774)
+++ 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 9774)
+++ 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 9774)
+++ 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 9774)
+++ 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 9774)
+++ 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 9774)
+++ 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 9774)
+++ 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;
+}
Index: extensions/Admin_Messages/admin_messages.php
===================================================================
--- extensions/Admin_Messages/admin_messages.php	(revision 9774)
+++ extensions/Admin_Messages/admin_messages.php	(revision 9786)
@@ -21,4 +21,8 @@
 			'CONTENT' => $message['content'],
 		);
+		if (is_admin() OR $message['author'] = $user['username']) {
+			$item['U_DELETE'] = AM_ADMIN . '&amp;delete_message=' . $message['id'] . '&amp;redirect=home';
+			$item['U_EDIT'] = AM_ADMIN . '-edit&amp;message_id=' . $message['id'] . '&amp;redirect=home';
+		}	
 		
 		$template->append('messages', $item);
@@ -34,4 +38,5 @@
 	'AM_ADMIN' => AM_ADMIN,
 	'USERNAME' => $user['username'],
+	'AM_PATH' => AM_PATH
 ));
 
Index: extensions/Admin_Messages/index.php
===================================================================
--- extensions/Admin_Messages/index.php	(revision 9786)
+++ extensions/Admin_Messages/index.php	(revision 9786)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/Admin_Messages/language/de_DE/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/de_DE/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/de_DE/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Liste der Mitteilungen";
 $lang['AM_new_tab'] = "Mitteilung hinzufügen";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Inhalt der Mitteilung";
 $lang['AM_nb_messages'] = "Anzahl Mitteilungen welche auf der Administrationsseite angezeigt werden";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(fixiert)";
 $lang['AM_message_added'] = "Mitteilung hinzugefügt";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Inhalt leer";
-$lang['AM_delete'] = "Mitteilung löschen";
 
 ?>
Index: extensions/Admin_Messages/language/en_UK/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/en_UK/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/en_UK/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Messages list";
 $lang['AM_new_tab'] = "Add a message";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Message content";
 $lang['AM_nb_messages'] = "Number of messages to display on the admin main page";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(fixed)";
 $lang['AM_message_added'] = "Message added";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Content empty";
-$lang['AM_delete'] = "Delete the message";
 
 ?>
Index: extensions/Admin_Messages/language/es_ES/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/es_ES/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/es_ES/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Lista de mensajes";
 $lang['AM_new_tab'] = "Añadir un mensaje";
+$lang['AM_edit_tab'] = "Editar mensaje";
 $lang['AM_msg_content'] = "Contenido del mensaje";
 $lang['AM_nb_messages'] = "Número de mensajes a mostrar";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(bloqueado)";
 $lang['AM_message_added'] = "Se ha guardado el mensaje";
+$lang['AM_message_deleted'] = "Mensaje eliminado";
 $lang['AM_empty_content'] = "Mensaje vacío";
-$lang['AM_delete'] = "Eliminar el mensaje";
 
 ?>
Index: extensions/Admin_Messages/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/fr_FR/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/fr_FR/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Liste des messages";
 $lang['AM_new_tab'] = "Ajouter un message";
+$lang['AM_edit_tab'] = "Editer un message";
 $lang['AM_msg_content'] = "Contenu du message";
 $lang['AM_nb_messages'] = "Nombre de messages à afficher sur l'accueil";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(bloqué)";
 $lang['AM_message_added'] = "Message enregistré";
+$lang['AM_message_deleted'] = "Message supprimé";
 $lang['AM_empty_content'] = "Message vide";
-$lang['AM_delete'] = "Supprimer le message";
 
 ?>
Index: extensions/Admin_Messages/language/it_IT/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/it_IT/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/it_IT/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Lista dei messaggi";
 $lang['AM_new_tab'] = "Aggiungere un messaggio";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Contenuto del messaggio";
 $lang['AM_nb_messages'] = "Numero di messaggi da visualizzare sul pannello dell\'amministrazione";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(bloccato)";
 $lang['AM_message_added'] = "Aggiunto messaggio";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Senza contenuto";
-$lang['AM_delete'] = "Eliminare il messaggio";
 
 ?>
Index: extensions/Admin_Messages/language/lv_LV/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/lv_LV/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/lv_LV/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Ziņojumu saraksts";
 $lang['AM_new_tab'] = "Pievienot ziņojumu";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Ziņojuma saturs";
 $lang['AM_nb_messages'] = "Admina galvenajā lapā attēlojamo ziņojumu skaits";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(salabots)";
 $lang['AM_message_added'] = "Ziņojums pievienots";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Saturs tukšs";
-$lang['AM_delete'] = "Dzēst ziņojumu";
 
 ?>
Index: extensions/Admin_Messages/language/no_no/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/no_no/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/no_no/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Beskjed liste";
 $lang['AM_new_tab'] = "Legg til en beskjed";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Beskjed innhold";
 $lang['AM_nb_messages'] = "Antall beskjeder å vise på admin forsiden";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(fikset)";
 $lang['AM_message_added'] = "Beskjed lagt til";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Innhold tomt";
-$lang['AM_delete'] = "Slett beskjed";
 
 ?>
Index: extensions/Admin_Messages/language/sk_SK/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/sk_SK/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/sk_SK/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Zoznam správ";
 $lang['AM_new_tab'] = "Pridať správu";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Obsah správy";
 $lang['AM_nb_messages'] = "Počet správ zobrazených na admin stránke";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(nemenné)";
 $lang['AM_message_added'] = "Správa pridaná";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Prázdny obsah";
-$lang['AM_delete'] = "Vymazané správy";
 
 ?>
Index: extensions/Admin_Messages/language/sv_SE/plugin.lang.php
===================================================================
--- extensions/Admin_Messages/language/sv_SE/plugin.lang.php	(revision 9774)
+++ extensions/Admin_Messages/language/sv_SE/plugin.lang.php	(revision 9786)
@@ -5,4 +5,5 @@
 $lang['AM_list_tab'] = "Meddelanden lista";
 $lang['AM_new_tab'] = "Lägg till ett meddelande";
+$lang['AM_edit_tab'] = "Edit the message";
 $lang['AM_msg_content'] = "Meddelandets innehåll";
 $lang['AM_nb_messages'] = "Antal meddelanden som visas på admin huvudsidan";
@@ -10,6 +11,6 @@
 $lang['AM_name_fixed'] = "(FAST)";
 $lang['AM_message_added'] = "Meddelande lagts till";
+$lang['AM_message_deleted'] = "Message deleted";
 $lang['AM_empty_content'] = "Innehållet tomt";
-$lang['AM_delete'] = "Ta bort meddelandet";
 
 ?>
Index: extensions/Admin_Messages/main.inc.php
===================================================================
--- extensions/Admin_Messages/main.inc.php	(revision 9774)
+++ extensions/Admin_Messages/main.inc.php	(revision 9786)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Admin Messages
-Version: 1.0
+Version: 1.1
 Description: Allows administrators to leave messages on the main admin page.
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=505
@@ -17,9 +17,9 @@
 // +-----------------------------------------------------------------------+
 define('AM_DIR' , basename(dirname(__FILE__)));
-define('AM_PATH' , PHPWG_PLUGINS_PATH . AM_DIR .'/');
+define('AM_PATH' , PHPWG_PLUGINS_PATH . AM_DIR . '/');
 define('AM_TABLE', $prefixeTable .'admin_messages');
 define('AM_NAME' , 'Admin Messages');
-define('AM_VERSION', '1.0');
-define('AM_ADMIN', PHPWG_ROOT_PATH .'admin.php?page=plugin&amp;section='. AM_DIR .'/admin/admin.php');
+define('AM_VERSION', '1.1');
+define('AM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . AM_DIR);
 
 
@@ -27,5 +27,5 @@
 //					Triggers
 // +-----------------------------------------------------------------------+
-add_event_handler('get_admin_plugin_menu_links', 'AM_admin_menu'); // Lien d'administration
+add_event_handler('get_admin_plugin_menu_links', 'AM_admin_menu'); 	// Lien d'administration
 add_event_handler('loc_begin_page_tail', 'AM_load_admin_messages'); // affichage sur admin
 
@@ -48,5 +48,7 @@
 	
 	if (script_basename() == 'admin' AND defined('IN_ADMIN') AND IN_ADMIN 
-		AND isset($page['body_id']) AND $page['body_id']=='theAdminPage' AND $page['page'] == 'intro') {
+		AND isset($page['body_id']) AND $page['body_id']=='theAdminPage' 
+		AND $page['page'] == 'intro') 
+	{
 		include(AM_PATH . 'admin_messages.php');
 	}
Index: extensions/Admin_Messages/maintain.inc.php
===================================================================
--- extensions/Admin_Messages/maintain.inc.php	(revision 9774)
+++ extensions/Admin_Messages/maintain.inc.php	(revision 9786)
@@ -18,5 +18,5 @@
 		`content` TEXT NULL ,
 		PRIMARY KEY ( `id` )
-	);");
+	) DEFAULT CHARSET=utf8;");
 		
 	pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('admin_messages', '" . default_config . "', 'Parametres du plugin Admin Messages');");
Index: extensions/Admin_Messages/template/admin_messages.tpl
===================================================================
--- extensions/Admin_Messages/template/admin_messages.tpl	(revision 9774)
+++ extensions/Admin_Messages/template/admin_messages.tpl	(revision 9786)
@@ -1,12 +1,21 @@
-<style type="text/css">
-	.AM_table td {ldelim}
-		min-width:300px;
-	}
-	.AM_table td:first-child {ldelim}
-		font-size:0.8em;
-		min-width:150px;
-	}
-</style>
-	
+{literal}
+	<style type="text/css">
+		#AM_table {
+			width:100%;
+		}
+		#AM_table td {
+			padding:5px;
+		}
+		#AM_table td:first-child {
+			font-size:0.8em;
+			width:200px;
+		}
+		.categoryActions {
+			float:right;
+		}
+	</style>
+{/literal}
+
+
 <a name="messages"></a>
 
@@ -16,10 +25,10 @@
 		<dd>
 			<ul>
-			<form method="post" action="{$AM_ADMIN}&amp;tab=new&amp;redirect=home">
+			<form method="post" action="{$AM_ADMIN}-new&amp;redirect=home">
 			<fieldset>
 			
 				{if isset($messages)}
-				<table class="table2 AM_table">
-					<tbody>
+				<table class="table2" id="AM_table">
+					
 					{foreach from=$messages item=message name=loop}
 						<tr class="{if $smarty.foreach.loop.index is odd}row2{else}row1{/if}">
@@ -28,9 +37,26 @@
 							</td>
 							<td>
+								<ul class="categoryActions">
+									{if isset($message.U_DELETE)}
+									<li>
+										<a href="{$message.U_DELETE}" title="{'delete'|@translate}">
+											<img src="{$themeconf.admin_icon_dir}/plug_delete.png" class="button" alt="{'delete'|@translate}" />
+										</a>
+									</li>
+									{/if}
+									{if isset($message.U_EDIT)}
+									<li>
+										<a href="{$message.U_EDIT}" title="{'edit'|@translate}">
+											<img src="{$themeconf.icon_dir}/edit.png" width="16px" class="button" alt="{'edit'|@translate}" />
+										</a>
+									</li>
+									{/if}
+								</ul>
 								{$message.CONTENT}
+								
 							</td>
 						</tr>
 					{/foreach}
-					</tbody>
+					
 				</table>
 				{/if}
@@ -41,5 +67,5 @@
 					{/if}
 
-					<a href="{$AM_ADMIN}&amp;tab=new" onclick="jQuery('#AM_form').toggle();jQuery('#AM_link').toggle();return false;">{'AM_new_tab'|@translate}</a>
+					<a href="{$AM_ADMIN}-new" onclick="jQuery('#AM_form').toggle();jQuery('#AM_link').toggle();return false;">{'AM_new_tab'|@translate}</a>
 				</div>
 				
Index: extensions/Admin_Messages/template/index.php
===================================================================
--- extensions/Admin_Messages/template/index.php	(revision 9786)
+++ extensions/Admin_Messages/template/index.php	(revision 9786)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
