Index: /extensions/adult_content/class.inc.php
===================================================================
--- /extensions/adult_content/class.inc.php	(revision 3493)
+++ /extensions/adult_content/class.inc.php	(revision 3494)
@@ -24,38 +24,6 @@
   {
     global $lang;
-    //include(get_language_filepath('plugin.lang.php', $this->plugin_path));
 	load_language('plugin.lang', $this->plugin_path);
   }  
-  /*
-  function remove_code($tlp_handle, $str_begin, $str_end)
-  {
-      global $template;
- 
-      $template->loadfile($tlp_handle);
- 
-      $p_beg = strpos($template->uncompiled_code[$tlp_handle], $str_begin);
-      $p_end = strpos($template->uncompiled_code[$tlp_handle], $str_end) + strlen($str_end);
-      $s = substr($template->uncompiled_code[$tlp_handle], $p_beg, $p_end - $p_beg);
- 
-      $template->uncompiled_code[$tlp_handle] = 
-      substr_replace($template->uncompiled_code[$tlp_handle], '', $p_beg, $p_end - $p_beg);
- 
-      return $s;
-  }
-  
-  function add_before_code($tlp_handle, $insert_before, $code)
-  {
-      global $template;
- 
-      $template->loadfile($tlp_handle);
-      $template->uncompiled_code[$tlp_handle] = str_replace($insert_before, $code.$insert_before, $template->uncompiled_code[$tlp_handle]);
-  } 
-  function add_after_code($tlp_handle, $insert_after, $code)
-  {
-    global $template;
- 
-    $template->loadfile($tlp_handle);
-    $template->uncompiled_code[$tlp_handle] = str_replace($insert_after, $insert_after.$code, $template->uncompiled_code[$tlp_handle]);
-  }*/
   function var_template()
   {
@@ -70,46 +38,4 @@
     }
    return $r;
-  }
-  function link_charte_user($etat)
-  {
-  global $user, $lang;
-  include($this->var_template());
-  if ($etat == 'not_defined')
-  {
-      /*$s = $this->remove_code('menubar',$begin_ident ,$end_ident);
-      $this->add_before_code('menubar','<!-- BEGIN links -->',$s); 	  
-      $this->add_after_code('menubar','<!-- END hello -->
-    <ul>','<a href="'.get_root_url().'plugins/'.$this->plugin_name.'/charte_user.php?etat='.$etat.'">{lang:ac_charte_user_not}</a>');*/
-  }
-  elseif ($etat == 'defined')
-  {
-      $query = '
-SELECT group_id FROM '.USER_GROUP_TABLE.'
-  WHERE user_id IN (\''.$user['id'].'\')
-;';
-     $data_group = mysql_fetch_array(pwg_query($query));
-   	 $query = '
-SELECT name FROM '.GROUPS_TABLE.'
-  WHERE id IN (\''.$data_group['group_id'].'\')
-;';
-     $data_group_n = mysql_fetch_array(pwg_query($query));
-	 if ($data_group_n['name'] == '+18')
-	 {
-	 $statut = $lang['ac_user_text_18'];
-	 }
-	 if ($data_group_n['name'] == '16-17')
-	 {
-	 $statut = $lang['ac_user_text_16'];
-	 }
-	 if ($data_group_n['name'] == 'nothing')
-	 {
-	 $statut = $lang['ac_user_no_s'];
-	 }
-
-	  /*$this->add_after_code('menubar','<!-- END hello -->
-    <ul>',''.$statut.' <a href="'.get_root_url().'plugins/'.$this->plugin_name.'/charte_user.php?etat='.$etat.'">{lang:ac_logout}</a>');*/
-  }
-      
-
   }
 
@@ -145,5 +71,4 @@
 	      if ( !isset( $_COOKIE['pwg_adult_content'] ) or $_COOKIE['pwg_adult_content'] == 'open' )
 	      {	
-	        //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_opened);
 			$template->assign(array(  'LINK' => $this->get_link_icon(duplicate_index_url(), 'closed')    ));
             if (($block = $menu->get_block( 'mbAdultContent' )) != null) {
@@ -154,5 +79,4 @@
           elseif ( $_COOKIE['pwg_adult_content'] == 'closed' )
 	      {
-	        //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_closed);
             $template->assign(array(  'LINK' => $this->get_link_icon(duplicate_index_url(), 'open')    ));
 			if (($block = $menu->get_block( 'mbAdultContent' )) != null) {
@@ -165,5 +89,4 @@
 	  elseif (  $_GET['ad'] == 'closed' )
 	  {
-	    //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_closed);
         $template->assign(array(  'LINK' => $this->get_link_icon(duplicate_index_url(), 'open')    ));
 		setcookie( 'pwg_adult_content', 'closed', time()+60*60*24*30, cookie_path() );	  
@@ -175,5 +98,4 @@
 	  elseif (  $_GET['ad'] == 'open' )
 	  {
-	    //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_opened);
             $template->assign(array(  'LINK' => $this->get_link_icon(duplicate_index_url(), 'closed')    ));
 			if (($block = $menu->get_block( 'mbAdultContent' )) != null) {
@@ -188,10 +110,13 @@
     elseif ($user['username'] == '18')
     {  
-      $this->remove_code('menubar', '<dl id="mbIdentification">', '<!-- END quickconnect -->
-
-  </dd>
-</dl>');
-  
-      $this->add_before_code('menubar','<!-- BEGIN tags -->',$msg_18);
+		$menu->hide_block('mbIdentification');
+		$template->assign(
+		  array(
+			'AC_MSG' => l10n('ac_user_text_18')
+			));
+		if (($block = $menu->get_block( 'mbAdultContent' )) != null) {
+               $block->set_title(l10n('ac_title_menu'));
+               $block->template = $this->plugin_path.'template/'.$user['template'].'/msg.tpl';
+        }
 	  
 	  $_SESSION['age']="18"; 
@@ -201,10 +126,13 @@
     elseif ($user['username'] == '16')
     {
-      $this->remove_code('menubar', '<dl id="mbIdentification">', '<!-- END quickconnect -->
-
-  </dd>
-</dl>');
-  
-      $this->add_before_code('menubar','<!-- BEGIN tags -->',$msg_16);
+		$menu->hide_block('mbIdentification');
+		$template->assign(
+		  array(
+			'AC_MSG' => l10n('ac_user_text_16')
+			));
+		if (($block = $menu->get_block( 'mbAdultContent' )) != null) {
+               $block->set_title(l10n('ac_title_menu'));
+               $block->template = $this->plugin_path.'template/'.$user['template'].'/msg.tpl';
+        }
 
     }//fin if 16-17 ans
@@ -237,9 +165,49 @@
 	  if ( $is_grouped == 0 )
 	  {
-	  $this->link_charte_user('not_defined');
+		$template->assign(
+		  array(
+			'AC_ETAT' => 'not_defined',
+			'AC_MSG' => l10n('ac_charte_user_not')
+			));
+		$menu = & $menu_ref_arr[0];
+		$block = $menu->get_block( 'mbAdultContent' );
+		$block->set_title(l10n('ac_title_choose'));
+		$block->template = $this->plugin_path.'template/'.$user['template'].'/choose.tpl';
+
 	  }
 	  else
 	  {	   
-	  $this->link_charte_user('defined');
+			$query = '
+	  SELECT group_id FROM '.USER_GROUP_TABLE.'
+		WHERE user_id IN (\''.$user['id'].'\')
+	  ;';
+		   $data_group = mysql_fetch_array(pwg_query($query));
+		   $query = '
+	  SELECT name FROM '.GROUPS_TABLE.'
+		WHERE id IN (\''.$data_group['group_id'].'\')
+	  ;';
+		   $data_group_n = mysql_fetch_array(pwg_query($query));
+		   if ($data_group_n['name'] == '+18')
+		   {
+		   $statut = l10n('ac_user_text_18');
+		   }
+		   if ($data_group_n['name'] == '16-17')
+		   {
+		   $statut = l10n('ac_user_text_16');
+		   }
+		   if ($data_group_n['name'] == 'nothing')
+		   {
+		   $statut = l10n('ac_user_no_s');
+		   }
+		$template->assign(
+		  array(
+			'AC_ETAT' => 'defined',
+			'AC_MSG' => $statut.". ".l10n('ac_charte_user_def')
+			));
+		$menu = & $menu_ref_arr[0];
+		$block = $menu->get_block( 'mbAdultContent' );
+		$block->set_title(l10n('ac_title_menu_statut'));
+		$block->template = $this->plugin_path.'template/'.$user['template'].'/choose.tpl';
+
 	  }
 	}
Index: /extensions/adult_content/include/charte.css
===================================================================
--- /extensions/adult_content/include/charte.css	(revision 3493)
+++ /extensions/adult_content/include/charte.css	(revision 3494)
@@ -6,3 +6,7 @@
 {
   padding:1em;
+  text-align:center;
   }
+#content form {
+	text-align:left;
+  }
Index: /extensions/adult_content/include/charte.tpl
===================================================================
--- /extensions/adult_content/include/charte.tpl	(revision 3493)
+++ /extensions/adult_content/include/charte.tpl	(revision 3494)
@@ -1,3 +1,3 @@
-{html_head}<link rel="stylesheet" type="text/css" href="{$pwg_root}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head}
+{html_head}<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head}
 <div id="content">
 <div class="titrePage">
@@ -9,5 +9,5 @@
 
 <fieldset>
-<form method="post" action="{$pwg_root}identification.php" >
+<form method="post" action="{$ROOT_URL}identification.php" >
     <input type="hidden" name="username" size="15" value="18"/>
     <input type="hidden" name="password" size="15" value="adult_content"/>
@@ -18,5 +18,5 @@
 </fieldset>
 <fieldset>
-<form method="post" action="{$pwg_root}identification.php" id="quickconnect">
+<form method="post" action="{$ROOT_URL}identification.php" id="quickconnect">
     <input type="hidden" name="username" size="15" value="16"/>
     <input type="hidden" name="password" size="15" value="adult_content"/>
Index: /extensions/adult_content/include/charte_user.tpl
===================================================================
--- /extensions/adult_content/include/charte_user.tpl	(revision 3493)
+++ /extensions/adult_content/include/charte_user.tpl	(revision 3494)
@@ -1,8 +1,8 @@
-<link rel="stylesheet" type="text/css" href="{$pwg_root}plugins/{$PLUGIN_NAME}/include/charte.css">
+{html_head}<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head}
 
 <div id="content">
 <div class="titrePage">
       <ul class="categoryActions">
-      <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li>
+      <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li>
     </ul>
   <h2>Adult content config</h2>
Index: /extensions/adult_content/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/adult_content/language/fr_FR/plugin.lang.php	(revision 3493)
+++ /extensions/adult_content/language/fr_FR/plugin.lang.php	(revision 3494)
@@ -1,4 +1,5 @@
 <?php
 $lang['ac_title_menu'] = 'Attention';
+$lang['ac_title_menu_statut'] ='Information';
 $lang['ac_text'] = 'Cette galerie contient des images s\'addressant à des personnes matures et/ou majeurs';
 $lang['ac_lien'] = 'enlever la protection';
Index: /extensions/adult_content/main.inc.php
===================================================================
--- /extensions/adult_content/main.inc.php	(revision 3493)
+++ /extensions/adult_content/main.inc.php	(revision 3494)
@@ -24,6 +24,6 @@
           
 		  // Ajout une entrée dans le menubar
+          add_event_handler('blockmanager_register_blocks', array(&$adult_content, 'register_ac_menubar_blocks'));
           add_event_handler('blockmanager_apply', array(&$adult_content, 'placer_identification'));
-          add_event_handler('blockmanager_register_blocks', array(&$adult_content, 'register_ac_menubar_blocks'));
 
 
Index: /extensions/adult_content/template/floPure/choose.tpl
===================================================================
--- /extensions/adult_content/template/floPure/choose.tpl	(revision 3494)
+++ /extensions/adult_content/template/floPure/choose.tpl	(revision 3494)
@@ -0,0 +1,8 @@
+<dt><img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}</dt>
+<dd>
+  <ul>
+	<li>
+	  <a href="{$pwg_root}plugins/{$AC_NAME}/charte_user.php?etat={$AC_ETAT}">{$AC_MSG}</a>
+	</li>
+  </ul>
+</dd>
Index: /extensions/adult_content/template/floPure/closed.tpl
===================================================================
--- /extensions/adult_content/template/floPure/closed.tpl	(revision 3494)
+++ /extensions/adult_content/template/floPure/closed.tpl	(revision 3494)
@@ -0,0 +1,2 @@
+
+ <dt><a href="{$LINK}"> {'ac_title_fermer'|@translate}</a></dt>
Index: /extensions/adult_content/template/floPure/msg.tpl
===================================================================
--- /extensions/adult_content/template/floPure/msg.tpl	(revision 3494)
+++ /extensions/adult_content/template/floPure/msg.tpl	(revision 3494)
@@ -0,0 +1,10 @@
+<dt>
+	<img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}
+</dt>
+<dd>
+  <ul>
+	{if isset($U_LOGOUT)}
+		{$AC_MSG} <li><a href="{$U_LOGOUT}">{'logout'|@translate}</a></li>
+	{/if}
+  </ul>
+</dd>
Index: tensions/adult_content/template/floPure/open.tpl
===================================================================
--- /extensions/adult_content/template/floPure/open.tpl	(revision 3493)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>Document sans nom</title>
-</head>
-
-<body>
-</body>
-</html>
Index: /extensions/adult_content/template/floPure/opened.tpl
===================================================================
--- /extensions/adult_content/template/floPure/opened.tpl	(revision 3494)
+++ /extensions/adult_content/template/floPure/opened.tpl	(revision 3494)
@@ -0,0 +1,17 @@
+<dt>{'ac_title_menu'|@translate}</dt>
+<dd>
+  <ul>
+	<li>
+	  {'ac_text'|@translate}
+	</li>
+	<li>
+	  <a href="{$pwg_root}plugins/{$AC_NAME}/charte.php">{'ac_lien'|@translate}</a>
+	</li>
+	<li>
+	  <a href="{$U_LOGIN}">{'ac_identif'|@translate}</a>
+	</li> 
+	<li>
+	  <a href="{$LINK}">{'ac_fermer'|@translate}</a>
+	</li> 
+  </ul>
+</dd>
Index: /extensions/adult_content/template/gally/choose.tpl
===================================================================
--- /extensions/adult_content/template/gally/choose.tpl	(revision 3494)
+++ /extensions/adult_content/template/gally/choose.tpl	(revision 3494)
@@ -0,0 +1,8 @@
+<dt><img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}</dt>
+<dd>
+  <ul>
+	<li>
+	  <a href="{$pwg_root}plugins/{$AC_NAME}/charte_user.php?etat={$AC_ETAT}">{$AC_MSG}</a>
+	</li>
+  </ul>
+</dd>
Index: /extensions/adult_content/template/gally/msg.tpl
===================================================================
--- /extensions/adult_content/template/gally/msg.tpl	(revision 3494)
+++ /extensions/adult_content/template/gally/msg.tpl	(revision 3494)
@@ -0,0 +1,10 @@
+<dt>
+	<img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}
+</dt>
+<dd>
+  <ul>
+	{if isset($U_LOGOUT)}
+		{$AC_MSG} <li><a href="{$U_LOGOUT}">{'logout'|@translate}</a></li>
+	{/if}
+  </ul>
+</dd>
Index: /extensions/adult_content/template/yoga/choose.tpl
===================================================================
--- /extensions/adult_content/template/yoga/choose.tpl	(revision 3494)
+++ /extensions/adult_content/template/yoga/choose.tpl	(revision 3494)
@@ -0,0 +1,8 @@
+<dt><img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}</dt>
+<dd>
+  <ul>
+	<li>
+	  <a href="{$pwg_root}plugins/{$AC_NAME}/charte_user.php?etat={$AC_ETAT}">{$AC_MSG}</a>
+	</li>
+  </ul>
+</dd>
Index: /extensions/adult_content/template/yoga/msg.tpl
===================================================================
--- /extensions/adult_content/template/yoga/msg.tpl	(revision 3494)
+++ /extensions/adult_content/template/yoga/msg.tpl	(revision 3494)
@@ -0,0 +1,10 @@
+<dt>
+	<img class="button" alt="{$AC_MSG}" src="{$pwg_root}template/yoga/icon/lost_password.png" />{'ac_title_menu_statut'|@translate}
+</dt>
+<dd>
+  <ul>
+	{if isset($U_LOGOUT)}
+		{$AC_MSG} <li><a href="{$U_LOGOUT}">{'logout'|@translate}</a></li>
+	{/if}
+  </ul>
+</dd>
