Index: /extensions/Admin_Messages/admin/admin.php
===================================================================
--- /extensions/Admin_Messages/admin/admin.php	(revision 9421)
+++ /extensions/Admin_Messages/admin/admin.php	(revision 9421)
@@ -0,0 +1,32 @@
+<?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 9421)
@@ -0,0 +1,35 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//				Modification de la configuration
+// +-----------------------------------------------------------------------+
+if (isset($_POST['config_submit'])) {
+	$user_config = array(
+		'nb_messages' => $_POST['nb_messages'],
+		'free_name' => (isset($_POST['free_name'])) ? 1 : 0,
+	);
+	
+	pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'admin_messages';");
+	redirect(AM_ADMIN .'&amp;tab=config&amp;msg=saved');
+}
+
+	
+// +-----------------------------------------------------------------------+
+//				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'],
+	'FREE_NAME' => ($conf['admin_messages']['free_name']) ? 'checked="checked"' : '',
+));
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/Admin_Messages/admin/index.php
===================================================================
--- /extensions/Admin_Messages/admin/index.php	(revision 9421)
+++ /extensions/Admin_Messages/admin/index.php	(revision 9421)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/admin/list.php
===================================================================
--- /extensions/Admin_Messages/admin/list.php	(revision 9421)
+++ /extensions/Admin_Messages/admin/list.php	(revision 9421)
@@ -0,0 +1,43 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//				Supression d'un message
+// +-----------------------------------------------------------------------+
+if (isset($_GET['delete_message'])) {
+	pwg_query("DELETE FROM ". AM_TABLE ." WHERE id = ". $_GET['delete_message'] .";");
+	redirect(AM_ADMIN);
+}
+
+if (isset($_GET['msg']) AND $_GET['msg'] == 'added')
+	array_push($page['infos'], l10n('AM_message_added'));
+
+
+// +-----------------------------------------------------------------------+
+//				Affichage des messages
+// +-----------------------------------------------------------------------+
+$messages = pwg_query("SELECT * FROM `". AM_TABLE ."` 
+	ORDER BY add_date DESC;");
+	
+if (pwg_db_num_rows($messages)) {
+	while ($message = pwg_db_fetch_assoc($messages)) {
+		$item = array(
+			'DATE' => format_date($message['add_date'], true),
+			'AUTHOR' => $message['author'],
+			'CONTENT' => $message['content'],
+			'U_DELETE' => AM_ADMIN . '&amp;delete_message=' . $message['id'],
+		);
+		
+		$template->append('messages', $item);
+	}
+	
+}
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/list.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+	
+?>
Index: /extensions/Admin_Messages/admin/new.php
===================================================================
--- /extensions/Admin_Messages/admin/new.php	(revision 9421)
+++ /extensions/Admin_Messages/admin/new.php	(revision 9421)
@@ -0,0 +1,47 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//				Ajout d'un message
+// +-----------------------------------------------------------------------+
+if (isset($_POST['new_submit'])) {
+	if ($_POST['username'] == null) $_POST['username'] = $user['username'];
+		
+	if ($_POST['content'] == null) {
+		array_push($page['errors'], l10n('AM_empty_content'));
+		
+	} 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');
+		else
+			redirect(AM_ADMIN .'&amp;tab=list&amp;msg=added');
+	}
+}
+
+
+// +-----------------------------------------------------------------------+
+//				Formulaire vierge
+// +-----------------------------------------------------------------------+
+$template->assign(array(
+	'USERNAME' => $user['username'],
+	'FREE_NAME' => (!$conf['admin_messages']['free_name']) ? 'disabled="disabled"' : '',
+));
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/new.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
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 9421)
@@ -0,0 +1,26 @@
+{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>
+
+<div class="titrePage">
+	<h2>{'Configuration'|@translate}</h2>
+</div>
+
+<form method="post" action="" class="properties">
+	<fieldset>
+		<table>
+			<tr>
+				<td><span class="title">{'AM_nb_messages'|@translate}</span></td>
+				<td><input type="text" size="2" name="nb_messages" value="{$NB_MESSAGES}"/></td>
+			</tr>
+			<tr>
+				<td><span class="title">{'AM_free_name'|@translate}</span></td>
+				<td><input type="checkbox" name="free_name" {$FREE_NAME}/></td>
+			</tr>
+		</table>
+	</fieldset>
+
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="config_submit"/></p>
+</form>
Index: /extensions/Admin_Messages/admin/template/index.php
===================================================================
--- /extensions/Admin_Messages/admin/template/index.php	(revision 9421)
+++ /extensions/Admin_Messages/admin/template/index.php	(revision 9421)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/admin/template/list.tpl
===================================================================
--- /extensions/Admin_Messages/admin/template/list.tpl	(revision 9421)
+++ /extensions/Admin_Messages/admin/template/list.tpl	(revision 9421)
@@ -0,0 +1,32 @@
+{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>
+
+<div class="titrePage">
+	<h2>{'AM_list_tab'|@translate}</h2>
+</div>
+
+{if !isset($messages)}
+	{'AM_no_messages'|@translate}<br>
+	<a href="{$AM_ADMIN}&tab=new">{'AM_new_tab'|@translate}</a>
+{/if}
+
+<form id="categoryOrdering">
+	<ul class="categoryUl">
+		{foreach from=$messages item=message}
+			<li class="categoryLi {if $smarty.foreach.pending_loop.index is odd}virtual_cat{/if}">
+				<ul class="categoryActions">
+					<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>
+					</li>
+				</ul>
+				<b>{$message.AUTHOR}</b> - <i>{$message.DATE}</i>
+				<p>{$message.CONTENT}</p>
+			</li>
+		{/foreach}
+	</ul>
+</form>
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 9421)
@@ -0,0 +1,32 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+{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>
+
+<div class="titrePage">
+	<h2>{'AM_new_tab'|@translate}</h2>
+</div>
+
+<form method="post" action="" class="properties">
+	<fieldset>
+		<table>
+			<tr>
+				<td><span class="title">{'Username'|@translate}</span></td>
+				<td>
+					<input type="text" size="15" name="username" value="{$USERNAME}" {$FREE_NAME}/>
+					{if $FREE_NAME != null}<span class="fixed">{'AM_name_fixed'|@translate}</span>{/if}
+				</td>
+			</tr>
+			<tr>
+				<td><span class="title">{'AM_msg_content'|@translate}</span></td>
+				<td><textarea name="content" rows="4" style="width:100%;"></textarea></td>
+			</tr>
+		</table>
+	</fieldset>
+
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/></p>
+</form>
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 9421)
@@ -0,0 +1,15 @@
+table{
+	width:80%;
+}
+td {
+	width:50%;
+}
+.title {
+	display:block;
+	text-align:right;
+	font-weight:bold;
+	margin-right:10px;
+}
+.fixed {
+	font-style:italic;
+}
Index: /extensions/Admin_Messages/admin_messages.php
===================================================================
--- /extensions/Admin_Messages/admin_messages.php	(revision 9421)
+++ /extensions/Admin_Messages/admin_messages.php	(revision 9421)
@@ -0,0 +1,41 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Langue et configuration
+load_language('plugin.lang', AM_PATH);
+$conf['admin_messages'] = unserialize($conf['admin_messages']);
+
+
+// +-----------------------------------------------------------------------+
+//				Affichage des messages
+// +-----------------------------------------------------------------------+
+$messages = pwg_query("SELECT * FROM `". AM_TABLE ."` 
+	ORDER BY add_date DESC
+	LIMIT 0, ". $conf['admin_messages']['nb_messages'] .";");
+	
+if (pwg_db_num_rows($messages)) {
+	while ($message = pwg_db_fetch_assoc($messages)) {
+		$item = array(
+			'DATE' => format_date($message['add_date'], true),
+			'AUTHOR' => $message['author'],
+			'CONTENT' => $message['content'],
+		);
+		
+		$template->append('messages', $item);
+	}
+	
+}
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->assign(array(
+	'AM_ADMIN' => AM_ADMIN,
+	'USERNAME' => $user['username'],
+));
+
+$template->set_filenames(array('admin_messages' => dirname(__FILE__) .'/template/admin_messages.tpl'));
+$template->pparse('admin_messages');
+	
+?>
Index: /extensions/Admin_Messages/language/en_UK/description.txt
===================================================================
--- /extensions/Admin_Messages/language/en_UK/description.txt	(revision 9421)
+++ /extensions/Admin_Messages/language/en_UK/description.txt	(revision 9421)
@@ -0,0 +1,1 @@
+Allows administrators to leave messages on the main admin page.
Index: /extensions/Admin_Messages/language/en_UK/index.php
===================================================================
--- /extensions/Admin_Messages/language/en_UK/index.php	(revision 9421)
+++ /extensions/Admin_Messages/language/en_UK/index.php	(revision 9421)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/en_UK/plugin.lang.php
===================================================================
--- /extensions/Admin_Messages/language/en_UK/plugin.lang.php	(revision 9421)
+++ /extensions/Admin_Messages/language/en_UK/plugin.lang.php	(revision 9421)
@@ -0,0 +1,15 @@
+<?php
+
+$lang['AM_messages'] = "Messages";
+$lang['AM_no_messages'] = "No message";
+$lang['AM_list_tab'] = "Messages list";
+$lang['AM_new_tab'] = "Add a message";
+$lang['AM_msg_content'] = "Message content";
+$lang['AM_nb_messages'] = "Number of messages to display on the admin main page";
+$lang['AM_free_name'] = "Allow users to modify their name when post a message";
+$lang['AM_name_fixed'] = "(fixed)";
+$lang['AM_message_added'] = "Message added";
+$lang['AM_empty_content'] = "Content empty";
+$lang['AM_delete'] = "Delete the message";
+
+?>
Index: /extensions/Admin_Messages/language/fr_FR/description.txt
===================================================================
--- /extensions/Admin_Messages/language/fr_FR/description.txt	(revision 9421)
+++ /extensions/Admin_Messages/language/fr_FR/description.txt	(revision 9421)
@@ -0,0 +1,1 @@
+Permet aux administrateur de laisser un message sur l'accueil de la page d'administration.
Index: /extensions/Admin_Messages/language/fr_FR/index.php
===================================================================
--- /extensions/Admin_Messages/language/fr_FR/index.php	(revision 9421)
+++ /extensions/Admin_Messages/language/fr_FR/index.php	(revision 9421)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Admin_Messages/language/fr_FR/plugin.lang.php	(revision 9421)
+++ /extensions/Admin_Messages/language/fr_FR/plugin.lang.php	(revision 9421)
@@ -0,0 +1,15 @@
+<?php
+
+$lang['AM_messages'] = "Messages";
+$lang['AM_no_messages'] = "Aucun message";
+$lang['AM_list_tab'] = "Liste des messages";
+$lang['AM_new_tab'] = "Ajouter un message";
+$lang['AM_msg_content'] = "Contenu du message";
+$lang['AM_nb_messages'] = "Nombre de messages à afficher sur l'accueil";
+$lang['AM_free_name'] = "Permettre la modification du nom d'utilisateur";
+$lang['AM_name_fixed'] = "(bloqué)";
+$lang['AM_message_added'] = "Message enregistré";
+$lang['AM_empty_content'] = "Message vide";
+$lang['AM_delete'] = "Supprimer le message";
+
+?>
Index: /extensions/Admin_Messages/language/index.php
===================================================================
--- /extensions/Admin_Messages/language/index.php	(revision 9421)
+++ /extensions/Admin_Messages/language/index.php	(revision 9421)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/main.inc.php
===================================================================
--- /extensions/Admin_Messages/main.inc.php	(revision 9421)
+++ /extensions/Admin_Messages/main.inc.php	(revision 9421)
@@ -0,0 +1,54 @@
+<?php
+/*
+Plugin Name: Admin Messages
+Version: 1.0
+Description: Allows administrators to leave messages on the main admin page.
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=505
+Author: Mistic
+Author URI: http://www.strangeplanet.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+// +-----------------------------------------------------------------------+
+//				Variables globales AM
+// +-----------------------------------------------------------------------+
+define('AM_DIR' , basename(dirname(__FILE__)));
+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');
+
+
+// +-----------------------------------------------------------------------+
+//					Triggers
+// +-----------------------------------------------------------------------+
+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
+
+
+// +-----------------------------------------------------------------------+
+//					Fonctions
+// +-----------------------------------------------------------------------+
+// Lien d'administration
+function AM_admin_menu($menu) {
+	array_push($menu, array(
+		'NAME' => AM_NAME,
+		'URL' => AM_ADMIN
+	));
+	return $menu;
+}
+
+// affichage sur admin
+function AM_load_admin_messages() {
+	global $template, $page, $conf, $user;
+	
+	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') {
+		include(AM_PATH . 'admin_messages.php');
+	}
+}
+?>
Index: /extensions/Admin_Messages/maintain.inc.php
===================================================================
--- /extensions/Admin_Messages/maintain.inc.php	(revision 9421)
+++ /extensions/Admin_Messages/maintain.inc.php	(revision 9421)
@@ -0,0 +1,32 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Configuration par défaut
+define('default_config' , serialize(array(
+	'nb_messages' => 5,
+	'free_name' => false,
+)));
+
+// Installation
+function plugin_install() {
+	global $prefixeTable;
+
+	pwg_query("CREATE TABLE `" . $prefixeTable . "admin_messages` (
+		`id` INT NOT NULL AUTO_INCREMENT ,
+		`add_date` DATETIME NOT NULL ,
+		`author` VARCHAR( 255 ) NOT NULL ,
+		`content` TEXT NULL ,
+		PRIMARY KEY ( `id` )
+	);");
+		
+	pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('admin_messages', '" . default_config . "', 'Parametres du plugin Admin Messages');");
+}
+
+// Désinstallation
+function plugin_uninstall() {
+	global $prefixeTable;
+
+	pwg_query("DROP TABLE `" . $prefixeTable . "admin_messages`;");
+	pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'admin_messages';");
+}
+?>
Index: /extensions/Admin_Messages/template/admin_messages.tpl
===================================================================
--- /extensions/Admin_Messages/template/admin_messages.tpl	(revision 9421)
+++ /extensions/Admin_Messages/template/admin_messages.tpl	(revision 9421)
@@ -0,0 +1,57 @@
+<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>
+	
+<a name="messages"></a>
+
+<div class="content">
+	<dl style="margin-top:0;">
+		<dt>{'AM_messages'|@translate}</dt>
+		<dd>
+			<ul>
+			<form method="post" action="{$AM_ADMIN}&amp;tab=new&amp;redirect=home">
+			<fieldset>
+			
+				{if isset($messages)}
+				<table class="table2 AM_table">
+					<tbody>
+					{foreach from=$messages item=message name=loop}
+						<tr class="{if $smarty.foreach.loop.index is odd}row2{else}row1{/if}">
+							<td>
+								<b>{$message.AUTHOR}</b> <br> <i>{$message.DATE}</i>
+							</td>
+							<td>
+								{$message.CONTENT}
+							</td>
+						</tr>
+					{/foreach}
+					</tbody>
+				</table>
+				{/if}
+
+				<div id="AM_link" align="center">
+					{if !isset($messages)}
+						{'AM_no_messages'|@translate}<br>
+					{/if}
+
+					<a href="{$AM_ADMIN}&amp;tab=new" onclick="jQuery('#AM_form').toggle();jQuery('#AM_link').toggle();return false;">{'AM_new_tab'|@translate}</a>
+				</div>
+				
+				<div style="display:none;width:50%;margin:10px 25%;text-align:center;" id="AM_form">
+					<textarea name="content" rows="4" style="width:100%;"></textarea>
+					<input type="hidden" name="username" value="{$USERNAME}"/>
+					<input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/>
+				</div>
+			
+			</fieldset>
+			</form>
+			</ul>
+		</dd>
+	</dl>
+</div>
