Index: /extensions/SmiliesSupport/admin.php
===================================================================
--- /extensions/SmiliesSupport/admin.php	(revision 9683)
+++ /extensions/SmiliesSupport/admin.php	(revision 9683)
@@ -0,0 +1,68 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $conf, $template;
+load_language('plugin.lang', SMILIES_PATH);
+$conf_smiliessupport = explode("," , $conf['smiliessupport']);
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']))
+{
+	if (!isset($_POST['text1'])) $_POST['text1'] = 'plugins/SmiliesSupport/smilies';
+	if (!isset($_POST['text2'])) $_POST['text2'] = '5';
+	if (!isset($_POST['text3'])) $_POST['text3'] = 'sourire.gif';
+	
+	$conf_smiliessupport = array(
+		$_POST['text1'],
+		$_POST['text2'],
+		$_POST['text3']
+	);
+		
+    $new_value_smiliessupport = implode ("," , $conf_smiliessupport);
+    $query = 'UPDATE ' . CONFIG_TABLE . '
+	SET value="' . $new_value_smiliessupport . '"
+	WHERE param="smiliessupport"';
+    pwg_query($query);
+    
+	$smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';	    
+
+	if (file_exists($smilies_file))
+	{
+		if  (@copy($smilies_file , get_filename_wo_extension($smilies_file).'.bak'))
+		{
+			$file = @fopen($smilies_file , "w");
+			fwrite($file , stripslashes($content_file = $_POST['text']));
+			fclose($file);        
+			array_push($page['infos'], l10n('Configuration saved.'));
+		}
+		else
+		{
+			array_push($page['errors'], l10n('Configuration not saved. (copy : '.$smilies_file.' to '.get_filename_wo_extension($smilies_file).'.bak').')' );
+		}
+	}
+	else
+	{
+		array_push($page['errors'], l10n('Configuration not saved. (file exists : '.$smilies_file.')' ));
+	}
+}
+
+$template->assign(array('TEXT1_VALUE' => $conf_smiliessupport[0]));
+$template->assign(array('TEXT2_VALUE' => $conf_smiliessupport[1]));
+$template->assign(array('TEXT3_VALUE' => $conf_smiliessupport[2]));
+
+include_once(SMILIES_PATH . '/smiliessupport.inc.php');
+$template->assign('SMILIESSUPPORT_PAGE', SmiliesTable($conf_smiliessupport));
+
+$smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';
+$content_file = '';
+
+if (file_exists($smilies_file))
+{
+	$content_file = file_get_contents($smilies_file);
+	$template->assign(array('CONTENT_FILE' =>$content_file ));
+}
+	
+$template->set_filename('smiliessupport_conf', dirname(__FILE__).'/smiliessupport_admin.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'smiliessupport_conf');
+
+?>
Index: /extensions/SmiliesSupport/index.php
===================================================================
--- /extensions/SmiliesSupport/index.php	(revision 9683)
+++ /extensions/SmiliesSupport/index.php	(revision 9683)
@@ -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/SmiliesSupport/language/en_UK/index.php
===================================================================
--- /extensions/SmiliesSupport/language/en_UK/index.php	(revision 9683)
+++ /extensions/SmiliesSupport/language/en_UK/index.php	(revision 9683)
@@ -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/SmiliesSupport/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/SmiliesSupport/language/en_UK/plugin.lang.php	(revision 9683)
+++ /extensions/SmiliesSupport/language/en_UK/plugin.lang.php	(revision 9683)
@@ -0,0 +1,7 @@
+<?php
+
+$lang['smilies_dir'] = "Smileys' folder";
+$lang['nb_columns'] = "Nb. columns";
+$lang['representant'] = "Representative";
+
+?>
Index: /extensions/SmiliesSupport/language/fr_FR/index.php
===================================================================
--- /extensions/SmiliesSupport/language/fr_FR/index.php	(revision 9683)
+++ /extensions/SmiliesSupport/language/fr_FR/index.php	(revision 9683)
@@ -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/SmiliesSupport/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/SmiliesSupport/language/fr_FR/plugin.lang.php	(revision 9683)
+++ /extensions/SmiliesSupport/language/fr_FR/plugin.lang.php	(revision 9683)
@@ -0,0 +1,7 @@
+<?php
+
+$lang['smilies_dir'] = "Dossier des smileys";
+$lang['nb_columns'] = "Nb. de colonnes";
+$lang['representant'] = "Représentant";
+
+?>
Index: /extensions/SmiliesSupport/language/index.php
===================================================================
--- /extensions/SmiliesSupport/language/index.php	(revision 9683)
+++ /extensions/SmiliesSupport/language/index.php	(revision 9683)
@@ -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/SmiliesSupport/main.inc.php
===================================================================
--- /extensions/SmiliesSupport/main.inc.php	(revision 9682)
+++ /extensions/SmiliesSupport/main.inc.php	(revision 9683)
@@ -2,13 +2,16 @@
 /*
 Plugin Name: Smilies Support
-Version: auto
+Version: 2.2.0
 Description: Allow add Smilies for comments and descriptions.
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=159
-Author: Atadilo & P@t
+Author: Atadilo & P@t & Mistic
 */
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-include_once(dirname(__FILE__).'/smiliessupport.inc.php');
+define('SMILIES_DIR' , basename(dirname(__FILE__)));
+define('SMILIES_PATH' , PHPWG_PLUGINS_PATH . SMILIES_DIR . '/');
+
+include_once(SMILIES_PATH.'smiliessupport.inc.php');
 
 add_event_handler('render_comment_content', 'SmiliesParse', 60);
@@ -17,12 +20,12 @@
 if (script_basename() == 'admin')
 {
-  add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');
-
-  function smiliessupport_admin_menu($menu) {
-      array_push($menu,
-        array('NAME' => 'Smilies Support',
-              'URL' => get_admin_plugin_menu_link(dirname(__FILE__) . '/smiliessupport_admin.php')));
-      return $menu;
-  }
+	add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');
+	function smiliessupport_admin_menu($menu) 
+	{
+		array_push($menu, array(
+			'NAME' => 'Smilies Support',
+			 'URL' => get_root_url().'admin.php?page=plugin-' . SMILIES_DIR));
+		return $menu;
+	}
 }
 ?>
Index: /extensions/SmiliesSupport/maintain.inc.php
===================================================================
--- /extensions/SmiliesSupport/maintain.inc.php	(revision 9682)
+++ /extensions/SmiliesSupport/maintain.inc.php	(revision 9683)
@@ -1,25 +1,26 @@
 <?php
-
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
 function plugin_install()
 {
-  global $conf;
+	global $conf;
 
-  if (!isset($conf['smiliessupport']))
-  {
-    $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
-VALUES ("smiliessupport","plugins/SmiliesSupport/smilies,5,sourire.gif","Parametres SmiliesSupport");';
-    pwg_query($q);
-  }
+	if (!isset($conf['smiliessupport']))
+	{
+		$q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
+			VALUES ("smiliessupport","plugins/SmiliesSupport/smilies,5,sourire.gif","Parametres SmiliesSupport");';
+		pwg_query($q);
+	}
 }
 
 function plugin_uninstall()
 {
-  global $conf;
+	global $conf;
 
-  if (isset($conf['smiliessupport']))
-  {
-    pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="smiliessupport" LIMIT 1;');
-  }
+	if (isset($conf['smiliessupport']))
+	{
+		pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="smiliessupport" LIMIT 1;');
+	}
 }
+
+?>
Index: /extensions/SmiliesSupport/smilies/index.php
===================================================================
--- /extensions/SmiliesSupport/smilies/index.php	(revision 9683)
+++ /extensions/SmiliesSupport/smilies/index.php	(revision 9683)
@@ -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: tensions/SmiliesSupport/smilies/smilies.bak
===================================================================
--- /extensions/SmiliesSupport/smilies/smilies.bak	(revision 9682)
+++ 	(revision )
@@ -1,20 +1,0 @@
-:)		sourire.gif
-:-)		sourire.gif
-:D		happy.gif
-:-D		happy.gif
-;)		wink.gif
-;-)		wink.gif
-:P		langue.gif
-:p		langue.gif
-:-p		langue.gif
-:-P		langue.gif
-:(		triste.gif
-:-(		triste.gif
-;(		pleure.gif
-;-(		pleure.gif
-oO		perplexe.gif
-Oo		perplexe.gif
-:o		surpris.gif
-:O		surpris.gif
-:-o		surpris.gif
-:-O		surpris.gif
Index: /extensions/SmiliesSupport/smiliessupport.inc.php
===================================================================
--- /extensions/SmiliesSupport/smiliessupport.inc.php	(revision 9682)
+++ /extensions/SmiliesSupport/smiliessupport.inc.php	(revision 9683)
@@ -1,88 +1,99 @@
 <?php
-
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
 function set_smiliessupport_page()
 {
-  global $template, $lang, $pwg_loaded_plugins;
+	global $template, $lang, $pwg_loaded_plugins;
 
-  if (!isset($pwg_loaded_plugins['bbcode_bar']))
-  {
-    $lang['Comment'] .= SmiliesTable();
-  }
+	if (!isset($pwg_loaded_plugins['bbcode_bar']))
+	{
+		$lang['Comment'] .= SmiliesTable();
+	}
 }
 
-function SmiliesTable()
+function SmiliesTable($new_conf=null)
 {
-  global $conf, $template;
+	global $conf, $template;
 
-  $conf_smiliessupport = explode("," , $conf['smiliessupport']);
+	// this is for live update on admin page
+	if (empty($new_conf)) 
+		$conf_smiliessupport = explode("," , $conf['smiliessupport']);
+	else
+		$conf_smiliessupport = $new_conf;
 
-  $cnt = 1;
-  
-  $template->set_filename('smiliessupport_page', dirname(__FILE__).'/smiliessupport_page.tpl');
-  
-  $template->assign(array('REPRESENTANT' => PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/'.$conf_smiliessupport[2]));
-  
-  if ($handle = opendir(PHPWG_ROOT_PATH.$conf_smiliessupport[0]))
-  {
-    while (false !== ($file = readdir($handle)))
-    {
-      $trvalue = '';
+	// edit field has a different id
+	if (isset($_GET['action']) AND $_GET['action'] == 'edit_comment')
+		$template->assign('form_name', 'editComment');
+	else
+		$template->assign('form_name', 'addComment');
 
-      if ($file != "." && $file != ".." && ( get_extension($file) == "gif" || get_extension($file) == "png"))
-      {
-        if (( $cnt > 0 ) && ( $cnt % $conf_smiliessupport[1] == 0 ))
-        {
-          $trvalue = '</tr><tr>';
-        }
-        $cnt = $cnt + 1;
-        $template->append('smiliesfiles',
-          array('PATH' => PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/'.$file,
-                'TITLE' => ':'.get_filename_wo_extension($file).':',
-                'TR'=>$trvalue));
-      }
-    }
-  }
-  else
-  {
-    array_push($page['errors'], l10n('opendir failed : '.PHPWG_ROOT_PATH.$conf_smiliessupport[0].')' ));
-  }
-  return $template->parse('smiliessupport_page', true);
+	$cnt = 1;
+	$template->set_filename('smiliessupport_page', dirname(__FILE__).'/smiliessupport_page.tpl');
+	$template->assign(array('REPRESENTANT' => PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/'.$conf_smiliessupport[2]));
+
+	if ($handle = opendir(PHPWG_ROOT_PATH.$conf_smiliessupport[0]))
+	{
+		while (false !== ($file = readdir($handle)))
+		{
+			$trvalue = '';
+
+			if ($file != "." && $file != ".." && ( get_extension($file) == "gif" || get_extension($file) == "png"))
+			{
+				if (( $cnt > 0 ) && ( $cnt % $conf_smiliessupport[1] == 0 ))
+				{
+					$trvalue = '</tr><tr>';
+				}
+				$cnt = $cnt + 1;
+				$template->append('smiliesfiles',
+				array('PATH' => PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/'.$file,
+				'TITLE' => ':'.get_filename_wo_extension($file).':',
+				'TR'=>$trvalue));
+			}
+		}
+	}
+	else
+	{
+		array_push($page['errors'], l10n('opendir failed : '.PHPWG_ROOT_PATH.$conf_smiliessupport[0].')' ));
+	}
+	
+	return $template->parse('smiliessupport_page', true);
 }
 
 function SmiliesParse($str)
 {
-  global $conf;
-  
-  $conf_smiliessupport = explode("," , $conf['smiliessupport']);
-  
-  $def_path = $conf_smiliessupport[0].'/smilies.txt';
-  if ( file_exists($def_path) )
-  {
-    $def = file($def_path);
-    foreach($def as $v)
-    {
-      $v = trim($v);
-      if (preg_match('|^([^\t]*)[\t]+(.*)$|',$v,$matches))
-      {
-        $r[] = '/(\A|[\s]+|>)('.preg_quote($matches[1],'/').')([\s]+|[<]|\Z)/ms';					
-        $s[] = '<img src="'.$conf_smiliessupport[0].'/'.$matches[2].'" '.'alt="$2" title="$2" />';
-        $str = preg_replace($r, $s, $str);
-      }
-    }
-  } 
-  if ($handle = opendir(PHPWG_ROOT_PATH.$conf_smiliessupport[0]))
-  {
-    while (false !== ($file = readdir($handle)))
-    { 
-      if ($file != "." && $file != ".." && ( get_extension($file) == "gif" || get_extension($file) == "png")) {
-        $v = ':'.get_filename_wo_extension($file).':'; 
-        $s = '<img src="'.$conf_smiliessupport[0].'/'.$file.'" '.'alt="'.get_filename_wo_extension($file).'" title="'.get_filename_wo_extension($file).'" />';
-        $str = str_replace($v, $s, $str);
-      }
-    }
-  }
-  return $str;
+	global $conf;
+
+	$conf_smiliessupport = explode("," , $conf['smiliessupport']);
+	$def_path = $conf_smiliessupport[0].'/smilies.txt';
+	
+	if ($handle = opendir(PHPWG_ROOT_PATH.$conf_smiliessupport[0]))
+	{
+		while (false !== ($file = readdir($handle)))
+		{ 
+			if ($file != "." && $file != ".." && ( get_extension($file) == "gif" || get_extension($file) == "png")) {
+				$v = ':'.get_filename_wo_extension($file).':'; 
+				$s = '<img src="'.$conf_smiliessupport[0].'/'.$file.'" alt=":'.get_filename_wo_extension($file).':" title=":'.get_filename_wo_extension($file).':"/>';
+				$str = str_replace($v, $s, $str);
+			}
+		}
+	}
+	
+	if ( file_exists($def_path) )
+	{
+		$def = file($def_path);
+		foreach($def as $v)
+		{
+			$v = trim($v);
+			if (preg_match('|^([^\t]*)[\t]+(.*)$|',$v,$matches))
+			{	
+				$r = '#'.preg_quote($matches[1],'/').'#';					
+				$t = '<img src="'.$conf_smiliessupport[0].'/'.$matches[2].'" alt=":'.get_filename_wo_extension($matches[2]).':" title=":'.get_filename_wo_extension($matches[2]).':"/>';
+				$str = preg_replace($r, $t, $str);
+			}
+		}
+	} 
+	
+	return $str;
 }
+
 ?>
Index: tensions/SmiliesSupport/smiliessupport_admin.php
===================================================================
--- /extensions/SmiliesSupport/smiliessupport_admin.php	(revision 9682)
+++ 	(revision )
@@ -1,68 +1,0 @@
-<?php
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-global $conf, $template;
-
-$conf_smiliessupport = explode("," , $conf['smiliessupport']);
-// Enregistrement de la configuration
-if (isset($_POST['submit']))
-{
-	if (!isset($_POST['text1'])) $_POST['text1'] = 'plugins/SmiliesSupport/smilies';
-	if (!isset($_POST['text2'])) $_POST['text2'] = '5';
-	if (!isset($_POST['text3'])) $_POST['text3'] = 'sourire.gif';
-	
-	$conf_smiliessupport=array(
-		$_POST['text1'],
-		$_POST['text2'],
-		$_POST['text3']);
-		
-    $new_value_smiliessupport = implode ("," , $conf_smiliessupport);
-    $query = '
-UPDATE ' . CONFIG_TABLE . '
-  SET value="' . $new_value_smiliessupport . '"
-  WHERE param="smiliessupport"
-  LIMIT 1';
-    pwg_query($query);
-    
-	$smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';	    
-
-	if (file_exists($smilies_file))
-  {
-		if  (@copy($smilies_file , get_filename_wo_extension($smilies_file).'.bak'))
-    {
-			$file = @fopen($smilies_file , "w");
-			fwrite($file , stripslashes($content_file = $_POST['text']));
-			fclose($file);        
-			array_push($page['infos'], l10n('Configuration saved.'));
-		}
-    else
-    {
-		  array_push($page['errors'], l10n('Configuration not saved. (copy : '.$smilies_file.' to '.get_filename_wo_extension($smilies_file).'.bak').')' );
-		}
-	}
-  else
-  {
-		array_push($page['errors'], l10n('Configuration not saved. (file exists : '.$smilies_file.')' ));
-	}
-}
-
-$template->assign(array('TEXT1_VALUE' => $conf_smiliessupport[0]));
-$template->assign(array('TEXT2_VALUE' => $conf_smiliessupport[1]));
-$template->assign(array('TEXT3_VALUE' => $conf_smiliessupport[2]));
-
-include_once(dirname(__FILE__) . '/smiliessupport.inc.php');
-$template->assign('SMILIESSUPPORT_PAGE', SmiliesTable());
-
-$smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';
-$content_file = '';
-if (file_exists($smilies_file))
-{
-	$content_file = file_get_contents($smilies_file);
-	$template->assign(array('CONTENT_FILE' =>$content_file ));
-}
-	
-$template->set_filename('smiliessupport_conf', dirname(__FILE__).'/smiliessupport_admin.tpl');
-$template->assign_var_from_handle('ADMIN_CONTENT', 'smiliessupport_conf');
-
-?>
Index: /extensions/SmiliesSupport/smiliessupport_admin.tpl
===================================================================
--- /extensions/SmiliesSupport/smiliessupport_admin.tpl	(revision 9682)
+++ /extensions/SmiliesSupport/smiliessupport_admin.tpl	(revision 9683)
@@ -1,21 +1,36 @@
+{combine_script id='jquery'}
+{include file='include/autosize.inc.tpl'}
+
 <div class="titrePage">
 	<h2>Smilies Support</h2>
 </div>
-<form method="post" action="" class="properties"  ENCTYPE="multipart/form-data"> 
-<div align="center">
+
+<form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
 	<fieldset>
-      <legend>SmiliesSupport</legend>	  
-	  <UL>			
-		<LI>Location : <input type="text" size="40" name="text1" value="{$TEXT1_VALUE}" /> </LI>
-		<LI>Nb Column : <input type="text" size="20" name="text2" value="{$TEXT2_VALUE}" /> </LI>		
-		<LI>Representant : <input type="text" size="20" name="text3" value="{$TEXT3_VALUE}" /> </LI>		
-	  <LI>{$SMILIESSUPPORT_PAGE}</LI>
-    </UL>
+      <legend>{'Configuration'|@translate}</legend>	  
+	  <ul>			
+		<li>
+			<span class="property">{'smilies_dir'|@translate}</span>
+			<input type="text" size="40" name="text1" value="{$TEXT1_VALUE}" />
+		</li>
+		<li>
+			<span class="property">{'nb_columns'|@translate}</span>
+			<input type="text" size="3" name="text2" value="{$TEXT2_VALUE}" />
+		</li>		
+		<li>
+			<span class="property">{'representant'|@translate}</span>
+			<input type="text" size="20" name="text3" value="{$TEXT3_VALUE}" />
+		</li>
+		<li>
+			<table><tr><td>{$SMILIESSUPPORT_PAGE}</td></tr></table>
+		</li>
+    </ul>
 	</fieldset>
+	
 	<fieldset>
 		<legend>smilies.txt</legend>
-		<textarea rows="30" name="text" cols="100">{$CONTENT_FILE}</textarea>
+		<textarea rows="5" name="text">{$CONTENT_FILE}</textarea>
 	</fieldset>	
-	<input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" />
-</div>
+	
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
 </form>
Index: /extensions/SmiliesSupport/smiliessupport_page.css
===================================================================
--- /extensions/SmiliesSupport/smiliessupport_page.css	(revision 9682)
+++ /extensions/SmiliesSupport/smiliessupport_page.css	(revision 9683)
@@ -2,5 +2,4 @@
     position:absolute; 
 	z-index:1000; 
-	width:10px;
 	visibility:hidden; 
 }
@@ -8,12 +7,14 @@
 .smiliestable {
     background: buttonface;
-    border-top: 1px solid;
-    border-left: 1px solid;
-    border-bottom: 1px solid;
-    border-right: 1px solid;
+    border: 1px solid;
     margin: 1;
 }
 
-#smiliesdiv IMG {
+#smiliesdiv img {
   cursor: pointer;
 }
+
+.properties textarea {
+	width:80%;
+	margin:0 10%;
+}
Index: /extensions/SmiliesSupport/smiliessupport_page.tpl
===================================================================
--- /extensions/SmiliesSupport/smiliessupport_page.tpl	(revision 9682)
+++ /extensions/SmiliesSupport/smiliessupport_page.tpl	(revision 9683)
@@ -1,18 +1,20 @@
-{known_script id="smiliessupport" src=$ROOT_URL|@cat:"plugins/SmiliesSupport/smiliessupport.js"}
-{html_head}
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL|@cat:"plugins/SmiliesSupport/smiliessupport_page.css"}" >
-{/html_head}
+{combine_script id="jquery"}
+{combine_script id="smiliessupport" path=$ROOT_URL|@cat:"plugins/SmiliesSupport/smiliessupport.js"}
+{combine_css path=$ROOT_URL|@cat:"plugins/SmiliesSupport/smiliessupport_page.css"}
 
-<img id="allsmilies" src="{$REPRESENTANT}" title="All Smilies" onmouseover="document.getElementById('smiliesdiv').style.visibility='visible';" >
-<div id="smiliesdiv" >
-<table class="smiliestable" 
-onmouseover="document.getElementById('smiliesdiv').style.visibility='visible';"
-onmouseout="document.getElementById('smiliesdiv').style.visibility='hidden';" >
-	<tr>
-		{foreach from=$smiliesfiles item=smiliesfile} 
-		<td><img src="{$smiliesfile.PATH}" title="{$smiliesfile.TITLE}" onclick="SmiliesWrite('addComment', 'content', '', '{$smiliesfile.TITLE}', true); document.getElementById('smiliesdiv').style.visibility='hidden';"> </td>	
-		{$smiliesfile.TR}
-		{/foreach}
-	</tr>
-</table>
+<div width="500pt">
+	<img id="allsmilies" src="{$REPRESENTANT}" title="All Smilies" onmouseover="jQuery('#smiliesdiv').css('visibility','visible');">
+
+	<div id="smiliesdiv" >
+		<table class="smiliestable" 
+		onmouseover="jQuery('#smiliesdiv').css('visibility','visible');"
+		onmouseout="jQuery('#smiliesdiv').css('visibility','hidden');">
+			<tr>
+			{foreach from=$smiliesfiles item=smiliesfile} 
+				<td><img src="{$smiliesfile.PATH}" title="{$smiliesfile.TITLE}" onclick="SmiliesWrite('{$form_name}','content','','{$smiliesfile.TITLE}',true); jQuery('#smiliesdiv').css('visibility','hidden');"> </td>	
+				{$smiliesfile.TR}
+			{/foreach}
+			</tr>
+		</table>
+	</div>
 </div>
