Index: extensions/meta/main.inc.php
===================================================================
--- extensions/meta/main.inc.php	(revision 7651)
+++ extensions/meta/main.inc.php	(revision 9406)
@@ -19,12 +19,10 @@
 define('meta_cat_TABLE' , $prefixeTable . 'meta_cat');
 
-add_event_handler('get_admin_plugin_menu_links', 'meta_admin_menu');
-function meta_admin_menu($menu)
+  // Plugin for admin
+if (script_basename() == 'admin')   
 {
-  array_push($menu, array(
-		'NAME' => 'Meta',
-    'URL' => get_admin_plugin_menu_link(meta_PATH . 'admin/admin.php')));
-  return $menu;
+  include_once(dirname(__FILE__).'/initadmin.php');
 }
+
 
 //Gestion des meta dans le header
@@ -39,4 +37,7 @@
 	global $template;
 	$template->set_prefilter('header', 'upmata');
+	
+	$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+	if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
  }
 
@@ -71,34 +72,35 @@
 			{
 			$meta[$row['metaname']] = $row['metaval'];
+			$metaED[$row['metaname']]=trigger_event('AP_render_content', $meta[$row['metaname']]);
 			}
 
 	// Authors
-	if (!empty($meta_infos['author']) and !empty($meta['author']))
+	if (!empty($meta_infos['author']) and !empty($metaED['author']))
 	{
-		$template->assign('INFO_AUTHOR', $meta_infos['author'] . ' - ' . $meta['author']);
+		$template->assign('INFO_AUTHOR', $meta_infos['author'] . ' - ' . $metaED['author']);
 	}
-	elseif (!empty($meta['author']))
+	elseif (!empty($metaED['author']))
 	{
-    $template->assign('INFO_AUTHOR', $meta['author']);
+    $template->assign('INFO_AUTHOR', $metaED['author']);
 	}
   
 	// Keywords
-	if (!empty($meta['keywords']))
+	if (!empty($metaED['keywords']))
 	{
-    $template->append('related_tags', array('name' => $meta['keywords']));
+    $template->append('related_tags', array('name' => $metaED['keywords']));
 	}
 
 	// Description
-	if (!empty($meta_infos['title']) and !empty($meta_infos['info']) and !empty($meta['Description']))
+	if (!empty($meta_infos['title']) and !empty($meta_infos['info']) and !empty($metaED['Description']))
 	{
-    $template->assign('PLUG_META', $meta_infos['title']. ' - ' .$meta_infos['info'] . ', ' . $meta['Description']);
+    $template->assign('PLUG_META', $meta_infos['title']. ' - ' .$meta_infos['info'] . ', ' . $metaED['Description']);
 	}
-	elseif (!empty($meta_infos['title']) and !empty($meta['Description']))
+	elseif (!empty($meta_infos['title']) and !empty($metaED['Description']))
 	{
-    $template->assign('PLUG_META', $meta_infos['title']. ' - ' .$meta['Description']);
+    $template->assign('PLUG_META', $meta_infos['title']. ' - ' .$metaED['Description']);
 	}
-	elseif (!empty($meta['Description']))
+	elseif (!empty($metaED['Description']))
 	{
-    $template->assign('PLUG_META', $meta['Description']);
+    $template->assign('PLUG_META', $metaED['Description']);
 	}
 	
@@ -124,7 +126,8 @@
     $result = pwg_query($query);
     $row = mysql_fetch_array($result);
+	$albumKeyED=trigger_event('AP_render_content', $row['metaKeycat']);
     if (!empty($row['metaKeycat']))
     {
-      $template->append('related_tags', array('name' => $row['metaKeycat']));
+      $template->append('related_tags', array('name' => $albumKeyED));
     }
 	
@@ -136,7 +139,8 @@
     $result = pwg_query($query);
     $row = mysql_fetch_array($result);
+	$albumDesED=trigger_event('AP_render_content', $row['metadescat']);
     if (!empty($row['metadescat']))
     {
-      $template->assign('PLUG_META', $row['metadescat']);
+      $template->assign('PLUG_META', $albumDesED);
     }
   }
@@ -157,7 +161,8 @@
     $result = pwg_query($query);
     $row = mysql_fetch_array($result);
+	$photoKeyED=trigger_event('AP_render_content', $row['metaKeyimg']);
     if (!empty($row['metaKeyimg']))
     {
-      $template->append('related_tags', array('name' => $row['metaKeyimg']));
+      $template->append('related_tags', array('name' => $photoKeyED));
     }
 
@@ -169,7 +174,8 @@
     $result = pwg_query($query);
     $row = mysql_fetch_array($result);
+	$photoDesED=trigger_event('AP_render_content', $row['metadesimg']);
     if (!empty($row['metadesimg']))
     {
-      $template->assign('PLUG_META', $row['metadesimg']);
+      $template->assign('PLUG_META', $photoDesED);
     }
 	
