Index: /extensions/add_head_element/admin.php
===================================================================
--- /extensions/add_head_element/admin.php	(revision 12496)
+++ /extensions/add_head_element/admin.php	(revision 12496)
@@ -0,0 +1,86 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
+load_language('plugin.lang', PFT_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+
+// Gestion des onglets
+if (!isset($_GET['tab']))
+    $page['tab'] = 'gest';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('gest',
+               l10n('pft_tab_gest'),
+               $my_base_url.'&amp;tab=gest');
+$tabsheet->add('help',
+               l10n('pft_tab_help'),
+               $my_base_url.'&amp;tab=help');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Onglet gest
+switch ($page['tab'])
+{
+  case 'gest':
+
+//charge Perso About
+$query = '
+select param,value
+	FROM ' . CONFIG_TABLE . '
+  WHERE param = "persoFooter"
+	;';
+$result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+    
+  $template->assign(
+    'gestA',
+    array(
+      'PFTBASE' => $row['value'],
+      ));
+
+
+//insértion de meta dans la table
+if (isset($_POST['submitpft']))
+	{
+	$query = '
+UPDATE ' . CONFIG_TABLE . '
+  SET value= \''.$_POST['perso_footer'].'\'
+  WHERE param = "persoFooter"
+    ;';
+$result = pwg_query($query);
+
+  $template->assign(
+    'gestA',
+    array(
+      'PFTBASE' => stripslashes($_POST['perso_footer']),
+      ));
+
+	}
+
+    break;
+
+// Tab help
+  case 'help':
+$template->assign(
+    'gestB',
+	array(
+	  'meta'=>l10n('meta_name'),
+	  ));
+	break;
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/add_head_element/admin.tpl
===================================================================
--- /extensions/add_head_element/admin.tpl	(revision 12496)
+++ /extensions/add_head_element/admin.tpl	(revision 12496)
@@ -0,0 +1,30 @@
+<div class="titrePage">
+  <h2>{'pft_h2'|@translate}</h2>
+</div>
+<div id="configContent">
+{if isset ($gestA)}
+	<form method="post" >
+	 <fieldset id="mainConf">
+			<span class="property">
+				<label for="pftperso">{'pft_perso'|@translate}</label>
+			</span>
+			<textarea rows="5" cols="50" class="description" name="perso_footer" id="perso_footer">{$gestA.PFTBASE}</textarea>
+  <p>
+    <input class="submit" type="submit" name="submitpft" value="{'Submit'|@translate}">
+    <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}">
+  </p>
+  	</form>
+{/if}
+
+{if isset ($gestB)}
+	<div class="comment">
+		<h3>{'pft_css'|@translate}</h3>
+			{'pft_css_help'|@translate}
+	</div>
+	<br>
+	<div class="comment">
+		<h3>{'pft_ED'|@translate}</h3>
+			{'pft_ED_help'|@translate}
+	</div>
+{/if}
+</div>
Index: /extensions/add_head_element/admin/admin.php
===================================================================
--- /extensions/add_head_element/admin/admin.php	(revision 12496)
+++ /extensions/add_head_element/admin/admin.php	(revision 12496)
@@ -0,0 +1,73 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
+load_language('plugin.lang', AHE_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+
+// Gestion des onglets
+if (!isset($_GET['tab']))
+    $page['tab'] = 'Management';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('Management',
+               l10n('Management'),
+               $my_base_url.'&amp;tab=Management');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Onglet Management
+switch ($page['tab'])
+{
+  case 'Management':
+
+//charge Perso About
+$query = '
+select param,value
+	FROM ' . CONFIG_TABLE . '
+  WHERE param = "add_head_element"
+	;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+    
+  $template->assign(
+    'gestA',
+    array(
+      'AHEBASE' => $row['value'],
+      ));
+
+
+if (isset($_POST['submitahe']))
+	{
+	$query = '
+UPDATE ' . CONFIG_TABLE . '
+  SET value= \''.$_POST['ahe'].'\'
+  WHERE param = "add_head_element"
+    ;';
+$result = pwg_query($query);
+
+  $template->assign(
+    'gestA',
+    array(
+      'AHEBASE' => stripslashes($_POST['ahe']),
+      ));
+
+	}
+
+    break;
+
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/add_head_element/admin/admin.tpl
===================================================================
--- /extensions/add_head_element/admin/admin.tpl	(revision 12496)
+++ /extensions/add_head_element/admin/admin.tpl	(revision 12496)
@@ -0,0 +1,18 @@
+<div class="titrePage">
+  <h2>{'ahe_h2'|@translate}</h2>
+</div>
+<div id="configContent">
+{if isset ($gestA)}
+	<form method="post" >
+	 <fieldset id="mainConf">
+			<span class="property">
+				<label for="aheperso">{'ahe_perso'|@translate}</label><br><br>
+			</span>
+			<textarea rows="5" cols="50" class="description" name="ahe" id="ahe">{$gestA.AHEBASE}</textarea>
+  <p>
+    <input class="submit" type="submit" name="submitahe" value="{'Submit'|@translate}">
+    <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}">
+  </p>
+  	</form>
+{/if}
+</div>
Index: /extensions/add_head_element/index.php
===================================================================
--- /extensions/add_head_element/index.php	(revision 12496)
+++ /extensions/add_head_element/index.php	(revision 12496)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/add_head_element/initadmin.php
===================================================================
--- /extensions/add_head_element/initadmin.php	(revision 12496)
+++ /extensions/add_head_element/initadmin.php	(revision 12496)
@@ -0,0 +1,179 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+//Add link menu
+add_event_handler('get_admin_plugin_menu_links', 'meta_admin_menu');
+function meta_admin_menu($menu)
+{
+  array_push($menu, array(
+		'NAME' => 'Meta',
+    'URL' => get_admin_plugin_menu_link(meta_PATH . 'admin/admin.php')));
+  return $menu;
+}
+
+
+//add prefiltre photo
+add_event_handler('loc_begin_admin', 'metaPadminf',55);
+add_event_handler('loc_begin_admin', 'metaPadminA',55);
+
+function metaPadminf()
+	{
+	global $template;
+	$template->set_prefilter('picture_modify', 'metaPadminfT');
+	}
+
+function metaPadminfT($content, &$smarty)
+	{
+  $search = '#<form id="associations"#';
+  
+  $replacement = '
+	<div>
+		<form method="post" >
+			<fieldset>
+			  <br>
+				<legend>{\'Metadata - Plugin meta\'|@translate}</legend>
+					{\'meta_compimg\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" value="{$metaCONTENT}" size="110" maxlenght="110">
+				<br>	
+				<br>
+					{\'meta_compimgdes\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser2" value="{$metaCONTENT2}" size="110" maxlenght="110">
+					({\'meta_compcatdeshelp\'|@translate})
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submetaphoto" type="submit" value="{\'meta_inscat\'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>  
+  <form id="associations"';
+
+  return preg_replace($search, $replacement, $content);
+	}
+ 
+function metaPadminA()
+	{ 
+		load_language('plugin.lang', meta_PATH);
+if (isset($_GET['image_id']))
+ {
+ 	global $template, $prefixeTable;
+$query = '
+select id,metaKeyimg,metadesimg
+  FROM ' . meta_img_TABLE . '
+  WHERE id = '.$_GET['image_id'].'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$chvalimg=$row['metaKeyimg'];
+$chvalimgdes=$row['metadesimg'];
+ 
+  $template->assign(
+    array(
+      'metaCONTENT' => $chvalimg,
+      'metaCONTENT2' => $chvalimgdes,
+      ));
+ }
+ 
+if (isset($_POST['submetaphoto']))
+ {
+ 	$query = '
+DELETE 
+  FROM ' . meta_img_TABLE . '
+  WHERE id = '.$_GET['image_id'].'
+  ;';
+$result = pwg_query($query);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'meta_img(id,metaKeyimg,metadesimg)VALUES ('.$_GET['image_id'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'");';
+    pwg_query($q);
+  
+  $template->assign(
+    array(
+      'metaCONTENT' => $_POST['inser'],
+      'metaCONTENT2' => $_POST['inser2'],
+      ));
+  }
+	}
+	
+//add prefiltre album
+add_event_handler('loc_end_cat_modify', 'metaAadminf');
+add_event_handler('loc_end_cat_modify', 'metaAadminA');
+
+function metaAadminf()
+ {
+	global $template;
+	$template->set_prefilter('categories', 'metaAadminfT');
+ }
+
+function metaAadminfT($content, &$smarty)
+ {
+  $search = '#name="reset">
+</p>#';
+  
+  $replacement = 'name="reset">
+</p>
+
+  	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{\'Metadata - Plugin meta\'|@translate}</legend>
+					{\'meta_compcat\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" value="{$metaCONTENT}" size="110" maxlenght="110">
+				<br>	
+				<br>	
+					{\'meta_compcatdes\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser2" value="{$metaCONTENT2}" size="110" maxlenght="110">&nbsp;:&nbsp;({\'meta_compcatdeshelp\'|@translate})
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submetaalbum" type="submit" value="{\'meta_inscat\'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+  ';
+
+  return preg_replace($search, $replacement, $content);
+ }
+
+ function metaAadminA()
+	{ 
+		load_language('plugin.lang', meta_PATH);
+if (isset($_GET['cat_id']))
+ {
+ 	global $template, $prefixeTable;
+$query = '
+select id,metaKeycat,metadescat
+  FROM ' . meta_cat_TABLE . '
+  WHERE id = '.$_GET['cat_id'].'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$chvalcat=$row['metaKeycat'];
+$chvalcatdes=$row['metadescat'];
+  
+  $template->assign(
+    array(
+      'metaCONTENT' => $chvalcat,
+	  'metaCONTENT2' => $chvalcatdes,
+      ));
+ }
+ 
+if (isset($_POST['submetaalbum']))
+ {
+	$query = '
+DELETE 
+  FROM ' . meta_cat_TABLE . '
+  WHERE id = '.$_GET['cat_id'].'
+  ;';
+$result = pwg_query($query);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'meta_cat(id,metaKeycat,metadescat)VALUES ('.$_GET['cat_id'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'");';
+    pwg_query($q);
+		
+  $template->assign(
+    array(
+      'metaCONTENT' => $_POST['inser'],
+	  'metaCONTENT2' => $_POST['inser2'],
+      ));
+  }
+	}
+
+?>
Index: /extensions/add_head_element/language/en_UK/description.txt
===================================================================
--- /extensions/add_head_element/language/en_UK/description.txt	(revision 12496)
+++ /extensions/add_head_element/language/en_UK/description.txt	(revision 12496)
@@ -0,0 +1,1 @@
+Add element to tag < head >
Index: /extensions/add_head_element/language/en_UK/index.php
===================================================================
--- /extensions/add_head_element/language/en_UK/index.php	(revision 12496)
+++ /extensions/add_head_element/language/en_UK/index.php	(revision 12496)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/add_head_element/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/add_head_element/language/en_UK/plugin.lang.php	(revision 12496)
+++ /extensions/add_head_element/language/en_UK/plugin.lang.php	(revision 12496)
@@ -0,0 +1,8 @@
+<?php
+$lang['ahe_h2'] = 'Plugin add < head > element';
+
+//Tab Management
+$lang['Management'] = 'Management';
+$lang['ahe_perso'] = 'add < head > element';
+
+?>
Index: /extensions/add_head_element/language/fr_FR/description.txt
===================================================================
--- /extensions/add_head_element/language/fr_FR/description.txt	(revision 12496)
+++ /extensions/add_head_element/language/fr_FR/description.txt	(revision 12496)
@@ -0,0 +1,1 @@
+Ajout un élément dans la balise < head >
Index: /extensions/add_head_element/language/fr_FR/index.php
===================================================================
--- /extensions/add_head_element/language/fr_FR/index.php	(revision 12496)
+++ /extensions/add_head_element/language/fr_FR/index.php	(revision 12496)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/add_head_element/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/add_head_element/language/fr_FR/plugin.lang.php	(revision 12496)
+++ /extensions/add_head_element/language/fr_FR/plugin.lang.php	(revision 12496)
@@ -0,0 +1,9 @@
+<?php
+$lang['ahe_h2'] = 'Plugin add < head > element';
+
+//Tab Management
+$lang['Management'] = 'Gestion';
+$lang['ahe_perso'] = 'Ajout d\'éléments dans les balise < head >';
+
+
+?>
Index: /extensions/add_head_element/language/index.php
===================================================================
--- /extensions/add_head_element/language/index.php	(revision 12496)
+++ /extensions/add_head_element/language/index.php	(revision 12496)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/add_head_element/main.inc.php
===================================================================
--- /extensions/add_head_element/main.inc.php	(revision 12496)
+++ /extensions/add_head_element/main.inc.php	(revision 12496)
@@ -0,0 +1,49 @@
+<?php
+/*
+Plugin Name: Plugin add < head > element
+Version: auto
+Description: Add element to tag < head >
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=582
+Author: ddtddt
+Author URI: http://piwigo.org/
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('AHE_DIR' , basename(dirname(__FILE__)));
+define('AHE_PATH' , PHPWG_PLUGINS_PATH . AHE_DIR . '/');
+
+add_event_handler('get_admin_plugin_menu_links', 'AHE_admin_menu');
+function AHE_admin_menu($menu)
+{
+  array_push($menu, array(
+	'NAME' => 'Add < head > element',
+    'URL' => get_admin_plugin_menu_link(AHE_PATH . 'admin/admin.php')));
+  return $menu;
+}
+
+
+//add in <head>
+add_event_handler('loc_begin_page_header', 'AHE1',20 );
+
+function AHE1()
+{
+
+global $template;
+
+$query = '
+select param,value
+	FROM ' . CONFIG_TABLE . '
+  WHERE param = "add_head_element"
+	;';
+$result = pwg_query($query);
+$row = mysql_fetch_assoc($result);
+
+	if (!empty($row['value']))
+	{
+    $template->append('head_elements', $row['value']);
+	}
+ }
+?>
Index: /extensions/add_head_element/maintain.inc.php
===================================================================
--- /extensions/add_head_element/maintain.inc.php	(revision 12496)
+++ /extensions/add_head_element/maintain.inc.php	(revision 12496)
@@ -0,0 +1,17 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+function plugin_install()
+{
+	$query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("add_head_element","","add element head");';
+    pwg_query($query);
+}
+
+function plugin_uninstall()
+{
+	$q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="add_head_element" LIMIT 1;';
+    pwg_query($q);
+}
+?>
