Index: /extensions/typetags/admin.php
===================================================================
--- /extensions/typetags/admin.php	(revision 9862)
+++ /extensions/typetags/admin.php	(revision 9863)
@@ -1,23 +1,23 @@
 <?php
-
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
 load_language('plugin.lang', typetags_PATH);
 
 function get_color_text($color)
 {
-  if (strlen($color) == 7)
-  {
-    $rgb[] = hexdec(substr($color, 1, 2))/255;
-    $rgb[] = hexdec(substr($color, 3, 2))/255;
-    $rgb[] = hexdec(substr($color, 5, 2))/255;
-  }
-  elseif (strlen($color) == 4)
-  {
-    $rgb[] = hexdec(substr($color, 1, 1))/15;
-    $rgb[] = hexdec(substr($color, 2, 1))/15;
-    $rgb[] = hexdec(substr($color, 3, 1))/15;
-  }
-  $l = (min($rgb) + max($rgb)) / 2;
-  return $l > 0.45 ? '#000' : '#fff';
+	if (strlen($color) == 7)
+	{
+		$rgb[] = hexdec(substr($color, 1, 2))/255;
+		$rgb[] = hexdec(substr($color, 3, 2))/255;
+		$rgb[] = hexdec(substr($color, 5, 2))/255;
+	}
+	else if (strlen($color) == 4)
+	{
+		$rgb[] = hexdec(substr($color, 1, 1))/15;
+		$rgb[] = hexdec(substr($color, 2, 1))/15;
+		$rgb[] = hexdec(substr($color, 3, 1))/15;
+	}
+	$l = (min($rgb) + max($rgb)) / 2;
+	return $l > 0.45 ? '#000' : '#fff';
 }
 
@@ -26,83 +26,93 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['submit']) and !is_adviser())
-{
-  $typetag = mysql_escape_string($_POST['edited_typetag']);
-  $typetag_name = mysql_escape_string($_POST['typetag_name']);
-  $typetag_color = mysql_escape_string($_POST['typetag_color']);
-
-  $existing_names = array();
-  
-  $query = '
-SELECT id, name, color
-  FROM '.typetags_TABLE.'
-;';
-  $result = pwg_query($query);
-  while ($row = mysql_fetch_array($result))
-  {
-    array_push($existing_names, $row['name']);
-    if ($typetag == $row['id'])
-    {
-      $current_name = $row['name'];
-      $current_color = $row['color'];
-    }
-  }
-  
-  // we must not rename typetag with an already existing name
-  if ($typetag_name != $current_name and in_array($typetag_name, $existing_names))
-  {
-    array_push($page['errors'], l10n('typetags_already exists'));
-
-    $edited_typetag = array(
-      'id' => $typetag,
-      'name' => $typetag_name,
-      'color' => $typetag_color);
-  }
-  else
-  {
-    array_push($page['infos'], l10n('typetags_saved'));
-
-    mass_updates(typetags_TABLE,
-      array(
-        'primary' => array('id'),
-        'update' => array('name', 'color')),
-      array(
-        array(
-          'id' => $typetag,
-          'name' => $typetag_name,
-          'color' => $typetag_color)));
-  }
-}
-
-// +-----------------------------------------------------------------------+
-// |                               delete typetags                             |
-// +-----------------------------------------------------------------------+
-
-if (isset($_POST['deletetypetag']) and isset($_POST['typetags']) and !is_adviser())
-{
-  $query = '
-SELECT name
-  FROM '.typetags_TABLE.'
-  WHERE id IN ('.implode(',', $_POST['typetags']).')
-;';
-  $typetag_names = array_from_query($query, 'name');
-  
-  $query = ' UPDATE '. TAGS_TABLE .'
-      SET id_typetags =  NULL
-      WHERE id_typetags IN ('.implode(',', $_POST['typetags']).')
-         ;';
- pwg_query($query);   
-
-  $query = '
-  DELETE
-  FROM '.typetags_TABLE.'
-  WHERE id IN ('.implode(',', $_POST['typetags']).')
-;';
-  pwg_query($query);
-  
-  array_push($page['infos'],
-    l10n_dec('typetag_suppr', 'typetags_suppr', count($typetag_names))
-    .' : '.implode(', ', $typetag_names)
-  );
+if (isset($_POST['edittypetag']) and (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])))
+{
+	$edited_typetag = array(
+		'id' => $_POST['edited_typetag'],
+		'name' => $_POST['typetag_name'],
+		'color' => $_POST['typetag_color'],
+	);
+	$page['errors'][] = l10n('typetag_error');
+}
+else if (isset($_POST['edittypetag']))
+{
+	$typetag = mysql_escape_string($_POST['edited_typetag']);
+	$typetag_name = mysql_escape_string($_POST['typetag_name']);
+	$typetag_color = mysql_escape_string($_POST['typetag_color']);
+
+	$all_typetags = pwg_query("
+		SELECT 
+			id, 
+			name, 
+			color
+		FROM  `". typetags_TABLE ."`;
+	");
+	
+	while ($row = mysql_fetch_array($all_typetags))
+	{
+		$existing_names[] = $row['name'];
+		if ($typetag == $row['id'])
+		{
+			$current_name = $row['name'];
+			$current_color = $row['color'];
+		}
+	}
+
+	// we must not rename typetag with an already existing name
+	if ($typetag_name != $current_name AND in_array($typetag_name, $existing_names))
+	{
+		$edited_typetag = array(
+			'id' => $typetag,
+			'name' => $typetag_name,
+			'color' => $typetag_color,
+		);
+		
+		$page['errors'][] = l10n('typetag_already_exists');
+	}
+	else
+	{
+		pwg_query("
+			UPDATE `". typetags_TABLE ."` SET 
+				`name` = '". $typetag_name ."',
+				`color` = '". $typetag_color ."'
+			WHERE `id` = ". $typetag .";
+		");
+		
+		$page['infos'][] = l10n('typetag_saved');
+	}
+}
+
+// +-----------------------------------------------------------------------+
+// |                           delete typetags                             |
+// +-----------------------------------------------------------------------+
+
+if (isset($_GET['deletetypetag']))
+{
+	$query = "
+		SELECT name
+		FROM `". typetags_TABLE ."`
+		WHERE id = ". $_GET['deletetypetag'] .";
+	";
+	$typetag_name = array_from_query($query, 'name');
+	
+	if (count($typetag_name) != 0)
+	{
+		pwg_query("
+			UPDATE `". TAGS_TABLE ."`
+			SET id_typetags = NULL
+			WHERE id_typetags = ". $_GET['deletetypetag'] .";
+		");
+
+		pwg_query("
+			DELETE FROM `". typetags_TABLE ."`
+			WHERE id = ". $_GET['deletetypetag'] .";
+		");
+
+		$page['infos'][] = l10n('typetag_suppr').' : '.$typetag_name[0];
+	}
+	else
+	{
+		$page['errors'][] = l10n('typetag_unknown').' : '.$_GET['deletetypetag'];
+	}
 }
 
@@ -111,52 +121,50 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['addtypetag']) and (empty($_POST['add_typetag']) or empty ($_POST['hexval'])))
-{
-  array_push($page['errors'], l10n('typetags_error'));
-  
-  $template->assign('typetag', array(
-    'NAME' => isset($_POST['add_typetag']) ? $_POST['add_typetag'] : '',
-    'COLOR' => isset($_POST['hexval']) ? $_POST['hexval'] : ''));
-}
-elseif (isset($_POST['addtypetag']) and !empty($_POST['add_typetag']) and !empty ($_POST['hexval']) and !is_adviser())
-{
-  $typetag_name = $_POST['add_typetag'];
-  $typetag_color = $_POST['hexval'];
-
-  // does the tag already exists?
-  $query = '
-SELECT id
-  FROM '.typetags_TABLE.'
-  WHERE name = \''.$typetag_name.'\'
-;';
-  $existing_tags = array_from_query($query, 'id');
-
-  if (count($existing_tags) == 0)
-  {
-    mass_inserts(
-      typetags_TABLE,
-      array('name', 'color'),
-      array(
-        array(
-          'name' => $typetag_name,
-          'color' => $typetag_color,
-          )
-        )
-      );
-    
-    array_push($page['infos'], l10n('typetags_saved'));
-  }
-  else
-  {
-    array_push($page['errors'],l10n('typetags_already exists'));
-
-    $template->assign('typetag', array(
-      'NAME' => $typetag_name,
-      'COLOR' => $typetag_color));
-  }
-}
-elseif (isset($_POST['add']) and !is_adviser())
-{ 
-  array_push($page['errors'], l10n('typetags_error'));
+if (isset($_POST['addtypetag']) and (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])))
+{
+	$template->assign('typetag', array(
+		'NAME' => isset($_POST['typetag_name']) ? $_POST['typetag_name'] : '',
+		'COLOR' => isset($_POST['typetag_color']) ? $_POST['typetag_color'] : '',
+	));
+	
+	$page['errors'][] = l10n('typetag_error');
+}
+else if (isset($_POST['addtypetag']))
+{
+	$typetag_name = $_POST['typetag_name'];
+	$typetag_color = $_POST['typetag_color'];
+
+	// does the tag already exists?
+	$query = "
+		SELECT id
+		FROM `". typetags_TABLE ."`
+		WHERE name = '". $typetag_name ."';
+	";
+	$existing_tags = array_from_query($query, 'id');
+
+	if (count($existing_tags) == 0)
+	{
+		pwg_query("
+			INSERT INTO `". typetags_TABLE ."`(
+				`name`,
+				`color`
+			)
+			VALUES(
+				'". $typetag_name ."',
+				'". $typetag_color ."'
+			);
+		");
+
+		$page['infos'][] = l10n('typetag_saved');
+	}
+	else
+	{
+		$template->assign('typetag', array(
+			'NAME' => $typetag_name,
+			'COLOR' => $typetag_color,
+		));
+		
+		$page['errors'][] = l10n('typetag_already_exists');
+	}
 }
 
@@ -165,53 +173,36 @@
 // +-----------------------------------------------------------------------+
 
-		
-if (isset($_POST['associate']) AND !empty($_POST['assoc_tags']) AND ($_POST['typetaglist'] != 0))
-{
-  $typetag_id = $_POST['typetaglist'];
-
-  $query = ' UPDATE '. TAGS_TABLE .'
-      SET id_typetags = '. $typetag_id .'
-       WHERE id IN ('.implode(',', $_POST['assoc_tags']).')
-         ;';
- pwg_query($query);   
-    
-    array_push(
-      $page['infos'],
-      sprintf(
-        l10n('typetags_associated'),
-        stripslashes($typetag_id)
-        )
-      );
-}
-elseif (isset($_POST['associate']) and !is_adviser())
-{ 
-  array_push($page['errors'], l10n('error_associate'));
-}
-
-// +-----------------------------------------------------------------------+
-// |                           Dissociate Tag to Typetage                  |
-// +-----------------------------------------------------------------------+
-
-if (isset($_POST['dissociate']) AND !empty($_POST['dissoc_tags']) and !is_adviser())
-{
-  $associated_tag_id = implode(',', $_POST['dissoc_tags']);
-
- $query = ' UPDATE '. TAGS_TABLE .'
-          SET id_typetags = NULL
-          WHERE id IN (' . $associated_tag_id . ')
-          ;';
-   pwg_query($query);
-
- 
-    array_push($page['infos'],
-      sprintf(l10n('typetags_dissociated'),
-        stripslashes($associated_tag_id )
-        )
-      );
-}
-elseif (isset($_POST['dissociate']) and !is_adviser())
-{ 
-  array_push($page['errors'], l10n('error_dissociate'));
-}
+if (isset($_POST['delete_all_assoc'])) 
+{
+	pwg_query("UPDATE `". TAGS_TABLE ."` SET id_typetags = NULL;");
+	$page['infos'][] = l10n('All associations have been removed');
+
+} 
+else if (isset($_POST['associations'])) 
+{
+		// beautify the parameters array
+		$string = preg_replace('#[;]$#', '', $_POST['associations']);
+		$associations = array();
+		$a = explode(';', $string);
+		
+		foreach ($a as $s) 
+		{
+		   $v = explode(':', $s);
+		   $associations[ltrim($v[0],'t-')] = ltrim($v[1],'tt-');
+		}
+
+		// save associations
+		foreach ($associations AS $tag => $typetag) 
+		{
+			pwg_query("
+				UPDATE `". TAGS_TABLE ."`
+				SET id_typetags = ". $typetag ."
+				WHERE id = ". $tag .";
+			");
+		}
+		
+		$page['infos'][] = l10n('typetags_associated');
+}
+
 
 // +-----------------------------------------------------------------------+
@@ -221,91 +212,61 @@
 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin/typetags_admin.tpl'));
 
-//Recupere les tags associés
-$query = '
-  SELECT t.id , t.name, tt.color
-	  FROM ' . TAGS_TABLE . ' as t
-	  INNER JOIN ' .typetags_TABLE. ' as tt
-	  ON  t.id_typetags = tt.id
-	  WHERE t.id_typetags is NOT NULL
-	  ORDER by t.id';
-$result = pwg_query($query);
-
-$tags = array();
-
-while ($row = mysql_fetch_assoc($result))
-{
-  array_push($tags, $row);		
-}
-
-usort($tags, 'name_compare');
-$template->assign('typetags_dissociation', $tags);
-
 // Récupère tous les tags
-$query = '
-	SELECT t.id , t.name, tt.color
-	  FROM ' . TAGS_TABLE . ' as t 
-		LEFT JOIN ' .typetags_TABLE.' as tt
-		ON  t.id_typetags = tt.id';
-$result = pwg_query($query);
-
-$tags = array();
-
-while ($row = mysql_fetch_assoc($result))
-{
-  array_push($tags, $row);		
-}
-
-usort($tags, 'name_compare');
-$template->assign('typetags_association', $tags);
-
-// +-----------------------------------------------------------------------+
-// |                             form creation                             |
-// +-----------------------------------------------------------------------+
-
-$query = 'SELECT * FROM '.typetags_TABLE.';';
-$result = pwg_query($query);
-$typetags = array();
-while ($row = mysql_fetch_assoc($result))
-{
-  $row['color_text'] = get_color_text($row['color']);
-  array_push($typetags, $row);
-}
-
-usort($typetags, 'name_compare');
-
-$template->assign('typetags_selection', $typetags);
-
-if (isset($_POST['edittypetag']) and isset($_POST['typetags']))
-{
-  if (count($_POST['typetags']) > 1)
-  {
-    array_push($page['errors'], l10n('You should select only one Typetag to edit.'));
-  }
-  else
-  {
-    $edited_typetag['id'] = $_POST['typetags'][0];
-  }
-}
-if (isset($edited_typetag))
-{
-  $template->assign('edited_typetag', $edited_typetag['id']);
-
-  $query = '
-    SELECT id, name, color
-    FROM '.typetags_TABLE.'
-    WHERE id = '.$edited_typetag['id'].'
-    ;';
-  $result = pwg_query($query);
-  while ($row = mysql_fetch_array($result))
-  {
-    $template->assign('typetag',
-      array(
-        'ID' => $row['id'],
-        'OLD_NAME' => $row['name'],
-        'OLD_COLOR' => $row['color'],
-        'COLOR_TEXT' => get_color_text($row['color']),
-        'NAME' => isset($edited_typetag['name']) ? $edited_typetag['name'] : $row['name'],
-        'COLOR'=> isset($edited_typetag['color']) ? $edited_typetag['color'] : $row['color']));
-  }
+$all_tags = pwg_query("
+	SELECT 
+		t.id as tagid,
+		t.name as tagname, 
+		tt.id as typetagid,
+		tt.name as typetagname
+	FROM `". TAGS_TABLE ."` as t 
+	LEFT JOIN `". typetags_TABLE ."` as tt
+	ON  t.id_typetags = tt.id
+	ORDER BY t.name ASC;
+");
+
+while ($row = pwg_db_fetch_assoc($all_tags)) {
+	if ($row['typetagname'] == null) $row['typetagid'] = 'NULL';
+	$template->append('typetags_association', $row);
+}
+
+// Récupère tous les typetags
+$all_typetags = pwg_query("SELECT * FROM `". typetags_TABLE ."` ORDER BY `name`;");
+
+while ($row = mysql_fetch_assoc($all_typetags))
+{
+	$row['color_text'] = get_color_text($row['color']);
+	$row['u_edit'] = typetags_ADMIN . '&edittypetag=' . $row['id'];
+	$row['u_delete'] = typetags_ADMIN . '&deletetypetag=' . $row['id'];
+	
+	$template->append('typetags_selection', $row);
+}
+
+// formualire d'édition
+if (isset($_GET['edittypetag'])) {
+	$edited_typetag['id'] = $_GET['edittypetag'];
+}
+
+if (isset($edited_typetag['id']))
+{
+	$template->assign('edited_typetag', $edited_typetag['id']);
+
+	$tag = pwg_query("
+		SELECT 
+			id,
+			name,
+			color
+		FROM `". typetags_TABLE ."`
+		WHERE id = ".$edited_typetag['id'].";
+	");
+	$row = pwg_db_fetch_assoc($tag);
+
+	$template->assign('typetag', array(
+		'ID' => $row['id'],
+		'OLD_NAME' => $row['name'],
+		'OLD_COLOR' => $row['color'],
+		'COLOR_TEXT' => get_color_text($row['color']),
+		'NAME' => isset($edited_typetag['name']) ? $edited_typetag['name'] : $row['name'],
+		'COLOR'=> isset($edited_typetag['color']) ? $edited_typetag['color'] : $row['color'],
+	));
 }
 
@@ -314,4 +275,5 @@
 // +-----------------------------------------------------------------------+
 
+$template->assign('typetags_ADMIN', typetags_ADMIN);
 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 
Index: /extensions/typetags/admin/farbtastic/index.php
===================================================================
--- /extensions/typetags/admin/farbtastic/index.php	(revision 9863)
+++ /extensions/typetags/admin/farbtastic/index.php	(revision 9863)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | 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/typetags/admin/typetags_admin.tpl
===================================================================
--- /extensions/typetags/admin/typetags_admin.tpl	(revision 9862)
+++ /extensions/typetags/admin/typetags_admin.tpl	(revision 9863)
@@ -1,10 +1,68 @@
+{combine_script id="jquery.ui.draggable" require="jquery.ui"}
+{combine_script id="jquery.ui.droppable"}
+
 {combine_script id="farbtastic" require="jquery" path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.js"}
 {combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.css"}
+{combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/typetags_style.css"}
 
 {footer_script}
 {literal}
-  $(document).ready(function(){
-    $('#colorpicker').farbtastic('#hexval');
-  });
+	$(document).ready(function(){
+		// colorpicker
+		$('#colorpicker').farbtastic('#hexval');
+
+		// déplace chaque élément dans la bonne case
+		jQuery('ul#tt-NULL li').each(function() {
+			var $target = jQuery('ul#' + jQuery(this).attr('title'));
+			jQuery(this).appendTo($target).css('float', 'left');
+		});
+		
+		// initialise les déplacement
+		jQuery("li").draggable({
+			revert: "invalid",
+			helper: "clone",
+			cursor: "move"
+		});
+
+		// initialise le dépôt
+		jQuery('.tt-container').droppable({
+			accept: "li",
+			hoverClass: "active",
+			drop: function(event, ui) {
+				var $gallery = this;
+				ui.draggable.fadeOut(function() {
+					jQuery(this).appendTo($gallery).fadeIn();
+					equilibrate(); // on rééquilibre les colonnes à chaque déplacement
+				});			
+			}
+		});
+		
+		// équilibrage des colonnes
+		equilibrate();
+	});
+			
+	function equilibrate() {
+		jQuery("#associations").each(function(){
+			var h=0;
+			jQuery("> ul", this).css('height', 'auto')
+				.each(function(){ h=Math.max(h,jQuery(this).height()); })
+				.css({'height': h+'px'});
+		});
+	}
+	
+	// génération des couples tag:typetag avant de valider le formulaire
+	function save_datas(form) {
+		var out = '';
+		
+		jQuery(".tt-container").each(function(){
+			var section = jQuery(this).attr('id');
+			jQuery("> li", this).each(function(){ 
+				out += jQuery(this).attr('id') + ':' + section + ';';
+			});
+		});
+		
+		jQuery('#assoc-input').val(out);
+		submit(form);
+	}
 {/literal}
 {/footer_script}
@@ -14,85 +72,80 @@
 </div>
 
-<form action="" method="post" name="form">
-  {if isset($edit_tags)}
-    <input type="hidden" name="edit_list" value="{$edit_tags}" />
-  {/if}
+<form action="{$typetags_ADMIN}" method="post" name="form">
+	<fieldset>
+	{if isset($edited_typetag)}
+		<legend>{'Edit typetag'|@translate}</legend>
+		<input type="hidden" name="edited_typetag" value="{$edited_typetag}" />
+		<div class="edit-container">
+			<div id="colorpicker" style="float:right;"></div>
+			<p><b>{'Edited TypeTag'|@translate} : <input type="text" readonly="readonly" size="18" style="background-color:{$typetag.OLD_COLOR};color:{$typetag.COLOR_TEXT};" value="{$typetag.OLD_NAME}"></b></p>
+			<p>&nbsp;</p>
+			<p>{'New name'|@translate} : <input type="text" size="18" name="typetag_name" value="{$typetag.NAME}"/></p>
+			<p>{'New color'|@translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{$typetag.COLOR}"/></p>
+			<p>&nbsp;</p>
+			<p>
+				<input class="submit" type="submit" name="edittypetag" value="{'Modify'|@translate}"/>
+				<input class="submit" type="submit" name="cancel" value="{'Reset'|@translate}"/>
+			</p>
+		</div>
+	{else}
+		<legend>{'Create a Typetag'|@translate}</legend>
+		<div class="edit-container">
+			<div id="colorpicker" style="float:right;"></div>
+			<p>&nbsp;</p>
+			<p>{'New TypeTag'|@translate} : <input type="text" size="18" name="typetag_name" value="{if isset($typetag.NAME)}{$typetag.NAME}{/if}"/></p>
+			<p>{'Color TypeTag'|@translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{if isset($typetag.COLOR)}{$typetag.COLOR}{else}#444444{/if}"/></p>
+			<p>&nbsp;</p>
+			<p>
+				<input class="submit" type="submit" name="addtypetag" value="{'Create a Typetag'|@translate}"/>
+			</p>
+		</div>
+	{/if}
+	</fieldset>
+</form>
 
-<fieldset>
-{if isset($edited_typetag)}
-    <legend>{'Edit typetags'|translate}</legend>
-    <input type="hidden" name="edited_typetag" value="{$edited_typetag}" />
-    
-    <div style="width: 500px; margin: auto;">
-    <div id="colorpicker" style="float: right;"></div>
-      <p><b>{'Edited TypeTag'|translate} : &nbsp;<input type="text" readonly="readonly"  size="20" style="background-color: {$typetag.OLD_COLOR}; color: {$typetag.COLOR_TEXT};" value="{$typetag.OLD_NAME}"></b>
-      <p>&nbsp;</p>
-      <p>{'New name'|translate}&nbsp;&nbsp;<input type="text" size="20" maxlength="15" name="typetag_name" value="{$typetag.NAME}"/></p>
-			<p>{'New color'|translate}&nbsp;&nbsp;<input type="text" id="hexval" name="typetag_color" size="9" maxlength="7" value="{$typetag.COLOR}"/></p>
-      <p>&nbsp;</p>
-      <p><input class="submit" type="submit" name="submit" value="{'Modify'|translate}"/>
-         <input class="submit" type="submit" name="cancel" value="{'Reset'|translate}" /></p>
-    </div>
-{else}
-    <legend>{'Create a Typetag'|translate}</legend>
-    <div style="width: 500px; margin: auto;">
-    <div id="colorpicker" style="float: right;"></div>
-      <p>&nbsp;</p>
-      <p>{'New TypeTag'|translate}&nbsp;&nbsp;<input type="text" size="20" maxlength="15" name="add_typetag" value="{if isset($typetag.NAME)}{$typetag.NAME}{/if}"/></p>
-			<p>{'ColorTypeTag'|translate}&nbsp;&nbsp;<input type="text" id="hexval" name="hexval" size="9" value="{if isset($typetag.COLOR)}{$typetag.COLOR}{else}#444444{/if}"/></p>
-      <p>&nbsp;</p>
-      <p><input class="submit" type="submit" name="addtypetag" value="{'Create a Typetag'|translate}"/></p>
-    </div>
-{/if}
-</fieldset>
+	{if !empty($typetags_selection)}
+	<fieldset>
+		<legend>{'TypeTag selection'|@translate}</legend>
+		<ul class="tagSelection">
+			{foreach from=$typetags_selection item=typetag}
+			<li>
+				<input type="text" readonly="readonly" size="18" style="background-color:{$typetag.color};color:{$typetag.color_text};margin:5px 0;" value="{$typetag.name}">
+				<a href="{$typetag.u_edit}" title="{'edit'|@translate}"><img src="{$themeconf.icon_dir}/edit.png" class="button" alt="{'edit'|@translate}"/></a>
+				<a href="{$typetag.u_delete}" title="{'delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"><img src="{$themeconf.admin_icon_dir}/plug_delete.png" class="button" alt="{'delete'|@translate}"/></a>
+			</li>
+			{/foreach}
+		</ul>
+	</fieldset>
+	{/if}
 
-{if !empty($typetags_selection)}
-<fieldset>
-    <legend>{'TypeTag selection'|translate}</legend>
-    <ul class="tagSelection">
-    {foreach from=$typetags_selection item=typetag}
-      <li>
-        <label><input type="checkbox" name="typetags[]" value="{$typetag.id}" style="margin: 5px 0;"/>&nbsp;
-          <input type="text" readonly="readonly" size="18" style="background-color: {$typetag.color}; color: {$typetag.color_text}; margin: 5px 0;" value="{$typetag.name}"></label></li>
-    {/foreach}
-    </ul>
-    <p><br>
-     <input class="submit" type="submit" name="edittypetag" value="{'Edit selected typetags'|translate}"/>
-     <input class="submit" type="submit" name="deletetypetag" value="{'Delete selected typetags'|translate}" onclick="return confirm('{'Are you sure?'|translate}');"/>
-    </p>
-</fieldset>
-{/if}
-
-{if !empty($typetags_association) and !empty($typetags_selection)}
-<fieldset>
-    <legend>{'TypeTag association'|translate}</legend>
-      <ul class="tagSelection">
-      {foreach from=$typetags_association item=tag}
-        <li style="margin: 10px 0;">
-          <label><input type="checkbox" name="assoc_tags[]" value="{$tag.id}" /><span style="color: {$tag.color}; font-weight: bold;"> {$tag.name}</span></label></li>
-      {/foreach}
-      </ul>
- 	    <p><br>{'existing_typetag_list'|translate}
-			  <select class="categoryDropDown" name="typetaglist">
-        <option value=""> {'choose_typetag'|@translate}</option>
-			  {foreach from=$typetags_selection item=typetag}
-		     	<option value="{$typetag.id}"> {$typetag.name}</option>
-			  {/foreach}
-			  </select>
-			  <input class="submit" type="submit" name="associate" value="{'associate'|translate}" onclick="return confirm('{'Are you sure?'|translate}');"/></p>
-</fieldset>
-{/if}
-
-{if !empty($typetags_dissociation)}
-<fieldset>
-    <legend>{'TypeTag dissociation'|translate}</legend>
-      <ul class="tagSelection">
-      {foreach from=$typetags_dissociation item=tag}
-        <li style="margin: 10px 0;">
-          <label><input type="checkbox" name="dissoc_tags[]" value="{$tag.id}" /><span style="color: {$tag.color}; font-weight: bold;"> {$tag.name}</span></label></li>
-      {/foreach}
-      </ul>
-      <p><br><input class="submit" type="submit" name="dissociate" value="{'dissociate'|translate}"onclick="return confirm('{'Are you sure?'|translate}');"/></p>
-</fieldset>
-{/if}
+<form action="{$typetags_ADMIN}" method="post" name="form" onsubmit="save_datas(this);">
+	{if !empty($typetags_association) and !empty($typetags_selection)}
+	<fieldset>
+		<legend>{'TypeTag association'|@translate}</legend>
+		
+		<ul id="tt-NULL" class="tt-container NULL">
+			<h5>Non associés</h5>
+			{foreach from=$typetags_association item=tag}
+			<li id="t-{$tag.tagid}" title="tt-{$tag.typetagid}">
+				{$tag.tagname}
+			</li>
+			{/foreach}
+		</ul>
+		
+		<div id="associations">
+		{foreach from=$typetags_selection item=typetag}
+			<ul id="tt-{$typetag.id}" class="tt-container" style="box-shadow:inset 0 0 5px {$typetag.color};">
+				<h5 style="background-color:{$typetag.color};color:{$typetag.color_text};">{$typetag.name}</h5>
+			</ul>
+		{/foreach}
+		</div>
+		
+		<p style="clear:both;">
+			<input type="hidden" name="associations" id="assoc-input"/>
+			<input class="submit" type="submit" name="associate" value="{'Validate'|@translate}"/>
+			<input class="submit" type="submit" name="delete_all_assoc" value="{'Delete all associations'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"/>
+		</p>
+	</fieldset>
+	{/if}
 </form>
Index: /extensions/typetags/admin/typetags_style.css
===================================================================
--- /extensions/typetags/admin/typetags_style.css	(revision 9863)
+++ /extensions/typetags/admin/typetags_style.css	(revision 9863)
@@ -0,0 +1,57 @@
+.edit-container {
+	width: 500px;
+	margin: auto;
+}
+
+ul.tagSelection li {
+	width:170px !important;
+}
+
+.tt-container {
+	float:left;
+	width:150px;
+	min-height:50px;
+	height:auto;
+	margin:5px !important;
+	padding:0 5px 5px 5px;
+	list-style:none;
+	background-color:#888;
+	border-radius:5px;
+	//border:1px solid #bbb;
+}
+.tt-container li {
+	display:inline;
+	float:none;
+	padding:2px 8px;
+	margin:5px;
+	background-color:#ddd;
+	box-shadow:1px 1px 0px #fff;
+	border-radius:5px;
+	cursor:move;
+}
+.tt-container li:hover {
+	background-color:#c2f5c2;
+	opacity:0.8;
+}
+.tt-container h5 {
+	margin:0 -5px;
+	border-radius:5px 5px 0 0;
+	padding:2px 0;
+	text-align:center;
+	font-size:12px;
+	letter-spacing:0.5em;
+	font-weight:normal;
+}
+.active {
+	background-color:#7cba0f;
+}
+
+.tt-container.NULL {
+	width:98%;
+	box-shadow:inset 0 0 5px #bbb;
+	padding-bottom:10px;
+}
+.tt-container.NULL h5 {
+	background-color:#bbb;
+	font-weight:bold;
+}
Index: /extensions/typetags/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/typetags/language/de_DE/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/de_DE/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Alle Felder müssen ausgefüllt werden (Name und Farbe).';
-$lang['typetags_saved'] = 'TypeTag gespeichert.';
-$lang['typetags_suppr'] = 'TypeTags gelöscht.';
-$lang['typetag_suppr'] = 'TypeTag gelöscht.';
-$lang['typetags_already exists'] = 'Dieser TypeTag existiert bereits.';
-$lang['Edit selected typetags'] = 'Die ausgewählten TypeTags bearbeiten.';
-$lang['Delete selected typetags'] = 'Die ausgewählten TypeTags löschen.';
-$lang['Edit typetags'] = 'TypeTags bearbeiten';
+/* section */
+$lang['Create a Typetag'] = 'Einen TypeTag erstellen';
+$lang['Edit typetag'] = 'TypeTag bearbeiten';
+$lang['TypeTag selection'] = 'TypeTags bearbeiten - löschen';
+$lang['TypeTag association'] = 'TypeTags assoziieren - dissoziieren';
+
+/* fields */
+$lang['Edited TypeTag'] = 'TypeTag bearbeiten';
 $lang['New color'] = 'Neue Farbe';
-$lang['Create a Typetag'] = 'Einen TypeTag erstellen';
-$lang['New TypeTag'] = 'Name des TypeTags';
-$lang['ColorTypeTag'] = 'Farbe des TypeTags';
-$lang['TypeTag selection'] = 'TypeTags bearbeiten - löschen';
-$lang['TypeTag association'] = 'TypeTags assoziieren';
-$lang['TypeTag dissociation'] = 'TypeTags dissoziieren';
-$lang['existing_typetag_list'] = 'Zu assoziierende TypeTags :';
-$lang['associate'] = 'Assoziieren';
-$lang['dissociate'] = 'Dissoziieren';
-$lang['typetags_associated'] = 'TypeTag wurde assoziiert.';
-$lang['typetags_dissociated'] = 'TypeTag wurde dissoziiert.';
-$lang['choose_typetag'] = ' TypeTag auswählen, welcher assoziiert werden soll ';
-$lang['error_associate'] = ' Sie müssen einen oder mehreren Tags und einen Typetag auswählen ';
-$lang['error_dissociate'] = ' Sie müssen die zu dissoziierenden Tags auswählen ';
+$lang['New TypeTag'] = 'Name de TypeTag';
+$lang['New name'] = 'Neuer Name';
+$lang['Color TypeTag'] = 'Farbe de TypeTag';
 
-$lang['Edited TypeTag'] = 'Typetag bearbeiten';
-$lang['New name'] = 'Neuer Name';
+/* buttons */
 $lang['Modify'] = 'Modifizieren';
-$lang['You should select only one Typetag to edit.'] = 'Sie sollten nur einen zu bearbeitenden Typetag auswählen.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Dieser TypeTag existiert bereits';
+$lang['typetag_saved'] = 'TypeTag gespeichert';
+$lang['typetag_suppr'] = 'TypeTag gelöscht';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'Alle Felder müssen ausgefüllt werden (Name und Farbe)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTags wurde assoziiert';
 
 ?>
Index: /extensions/typetags/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/typetags/language/en_UK/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/en_UK/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'You have to inform all fileds (name and color).';
-$lang['typetags_saved'] = 'TypeTag saved.';
-$lang['typetags_suppr'] = 'TypeTags deleted.';
-$lang['typetag_suppr'] = 'TypeTag deleted.';
-$lang['typetags_already exists'] = 'This TypeTag already exist.';
-$lang['Edit selected typetags'] = 'Edit selected TypeTags.';
-$lang['Delete selected typetags'] = 'Delete selected TypeTags.';
-$lang['Edit typetags'] = 'Edit TypeTags';
+/* section */
+$lang['Create a Typetag'] = 'Create a TypeTag';
+$lang['Edit typetag'] = 'Edit TypeTag';
+$lang['TypeTag selection'] = 'Edit - Delete TypeTags';
+$lang['TypeTag association'] = 'Associate - Dissociate TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'TypeTag edited';
 $lang['New color'] = 'New color';
-$lang['Create a Typetag'] = 'Create a TypeTag';
-$lang['New TypeTag'] = 'Name of TypeTag';
-$lang['ColorTypeTag'] = 'Color of TypeTag';
-$lang['TypeTag selection'] = 'Edit - Delete TypeTags';
-$lang['TypeTag association'] = 'Associate TypeTags';
-$lang['TypeTag dissociation'] = 'Dissociate TypeTags';
-$lang['existing_typetag_list'] = 'TypeTag to associate :';
-$lang['associate'] = 'Associate';
-$lang['dissociate'] = 'Dissociate';
-$lang['typetags_associated'] = 'TypeTag associated.';
-$lang['typetags_dissociated'] = 'TypeTag dissociated.';
-$lang['choose_typetag'] = ' Choose TypeTag to associate ';
-$lang['error_associate'] = ' You must choose Tag(s) AND a TypeTag ';
-$lang['error_dissociate'] = ' You must to chosse Tag(s) to dissociate ';
+$lang['New TypeTag'] = 'TypeTag name';
+$lang['New name'] = 'New name';
+$lang['Color TypeTag'] = 'TypeTag color';
 
-$lang['Edited TypeTag'] = 'Edited Typetag';
-$lang['New name'] = 'New name';
+/* buttons */
 $lang['Modify'] = 'Modify';
-$lang['You should select only one Typetag to edit.'] = 'You should select only one Typetag to edit.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'This TypeTag already exists';
+$lang['typetag_saved'] = 'TypeTag saved';
+$lang['typetag_suppr'] = 'TypeTag deleted';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'You must fill all fields (name and color)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTags associated';
 
 ?>
Index: /extensions/typetags/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/typetags/language/es_ES/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/es_ES/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Usted debe informar todos los campos (nombre y color).';
-$lang['typetags_saved'] = 'TypeTag registrado.';
-$lang['typetags_suppr'] = 'TypeTags suprimidos.';
-$lang['typetag_suppr'] = 'TypeTag suprimido.';
-$lang['typetags_already exists'] = 'Este TypeTag ya existe.';
-$lang['Edit selected typetags'] = 'Editar TypeTags seleccionados.';
-$lang['Delete selected typetags'] = 'Suprimir TypeTags seleccionados.';
-$lang['Edit typetags'] = 'Editar TypeTags';
+/* section */
+$lang['Create a Typetag'] = 'Crear TypeTag';
+$lang['Edit typetag'] = 'Editar TypeTag';
+$lang['TypeTag selection'] = 'Editar - Suprimir TypeTags';
+$lang['TypeTag association'] = 'Asociar - Disociar TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'Typetag editado';
 $lang['New color'] = 'Nuevo color';
-$lang['Create a Typetag'] = 'Crear TypeTag';
 $lang['New TypeTag'] = 'Nombre de TypeTag';
-$lang['ColorTypeTag'] = 'Color de TypeTag';
-$lang['TypeTag selection'] = 'Editar - Suprimir TypeTags';
-$lang['TypeTag association'] = 'Asociar TypeTags';
-$lang['TypeTag dissociation'] = 'Disociar TypeTags';
-$lang['existing_typetag_list'] = 'TypeTag :';
-$lang['associate'] = 'Asociar';
-$lang['dissociate'] = 'Disociar';
-$lang['typetags_associated'] = 'TypeTag asociado.';
-$lang['typetags_dissociated'] = 'TypeTag disociado.';
-$lang['choose_typetag'] = ' Escoger TypeTag a asociar ';
-$lang['error_associate'] = ' Usted debe escoger por lo menos una Tag Y un TypeTag ';
-$lang['error_dissociate'] = ' Usted debe escoger por lo menos un Tag que hay que disociar ';
+$lang['New name'] = 'Nuevo nombre';
+$lang['Color TypeTag'] = 'Color de TypeTag';
 
-$lang['Edited TypeTag'] = 'Typetag editado';
-$lang['New name'] = 'Nuevo nombre';
+/* buttons */
 $lang['Modify'] = 'Cambiar';
-$lang['You should select only one Typetag to edit.'] = 'Puede editar Typetag sólo de uno en uno.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Este TypeTag ya existe';
+$lang['typetag_saved'] = 'TypeTag registrado';
+$lang['typetag_suppr'] = 'TypeTag suprimido';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'Usted debe informar todos los campos (nombre y color)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTags asociado';
 
 ?>
Index: /extensions/typetags/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/typetags/language/fr_FR/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/fr_FR/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Vous devez renseigner tous les champs (nom et couleur).';
-$lang['typetags_saved'] = 'TypeTag enregistré.';
-$lang['typetags_suppr'] = 'TypeTags supprimés (%d)';
+/* section */
+$lang['Create a Typetag'] = 'Créer un TypeTag';
+$lang['Edit typetag'] = 'Editer le TypeTag';
+$lang['TypeTag selection'] = 'Editer - Supprimer des TypeTags';
+$lang['TypeTag association'] = 'Associer - Dissocier des TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'TypeTag édité';
+$lang['New color'] = 'Nouvelle couleur';
+$lang['New TypeTag'] = 'Nom du TypeTag';
+$lang['New name'] = 'Nouveau nom';
+$lang['Color TypeTag'] = 'Couleur du TypeTag';
+
+/* buttons */
+$lang['Modify'] = 'Modifier';
+$lang['Delete all associations'] = 'Supprimer toutes les associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Ce TypeTag existe déjà';
+$lang['typetag_saved'] = 'TypeTag enregistré';
 $lang['typetag_suppr'] = 'TypeTag supprimé';
-$lang['typetags_already exists'] = 'Ce TypeTag existe déjà.';
-$lang['Edit selected typetags'] = 'Editer les TypeTags selectionnés.';
-$lang['Delete selected typetags'] = 'Supprimer les TypeTags selectionnés.';
-$lang['Edit typetags'] = 'Editer les TypeTags';
-$lang['New color'] = 'Nouvelle couleur';
-$lang['Create a Typetag'] = 'Créer un TypeTag';
-$lang['New TypeTag'] = 'Nom du TypeTag';
-$lang['ColorTypeTag'] = 'Couleur du TypeTag';
-$lang['TypeTag selection'] = 'Editer - Supprimer des TypeTags';
-$lang['TypeTag association'] = 'Associer des TypeTags';
-$lang['TypeTag dissociation'] = 'Dissocier des TypeTags';
-$lang['existing_typetag_list'] = 'TypeTag :';
-$lang['associate'] = 'Associer';
-$lang['dissociate'] = 'Dissocier';
-$lang['typetags_associated'] = 'TypeTag associé.';
-$lang['typetags_dissociated'] = 'TypeTag dissocié.';
-$lang['choose_typetag'] = ' Choisir un TypeTag à associer ';
-$lang['error_associate'] = ' Vous devez choisir au moins un Tag ET un TypeTag ';
-$lang['error_dissociate'] = ' Vous devez choisir au moins un Tag à dissocier ';
-
-$lang['Edited TypeTag'] = 'Typetag édité';
-$lang['New name'] = 'Nouveau nom';
-$lang['Modify'] = 'Modifier';
-$lang['You should select only one Typetag to edit.'] = 'Vous ne pouvez éditer qu\'un seul Typetag à la fois.';
+$lang['typetag_unknown'] = 'TypeTag inconnu';
+$lang['typetag_error'] = 'Vous devez renseigner tous les champs (nom et couleur)';
+$lang['All associations have been removed'] = 'Tous les associations ont été supprimées';
+$lang['typetags_associated'] = 'TypeTags associés';
 
 ?>
Index: /extensions/typetags/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/typetags/language/it_IT/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/it_IT/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Dovete inserire tutti campi (nome e colore).';
-$lang['typetags_saved'] = 'TypeTag registrato.';
-$lang['typetags_suppr'] = 'TypeTags cancellati (%d).';
-$lang['typetag_suppr'] = 'TypeTag cancellato.';
-$lang['typetags_already exists'] = 'Questo TypeTag esiste già.';
-$lang['Edit selected typetags'] = 'Modificare i TypeTags selezionati.';
-$lang['Delete selected typetags'] = 'Cancellare i TypeTags selezionati.';
-$lang['Edit typetags'] = 'Modificare i TypeTags';
+/* section */
+$lang['Create a Typetag'] = 'Creare un TypeTag';
+$lang['Edit typetag'] = 'Modificare i TypeTag';
+$lang['TypeTag selection'] = 'Modificare - Cancellare i TypeTags';
+$lang['TypeTag association'] = 'Associare - Dissociare i TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'TypeTag modificato';
 $lang['New color'] = 'Nuovo colore';
-$lang['Create a Typetag'] = 'Creare un TypeTag';
 $lang['New TypeTag'] = 'Nome del TypeTag';
-$lang['ColorTypeTag'] = 'Colore del TypeTag';
-$lang['TypeTag selection'] = 'Modificare - Cancellare i TypeTags';
-$lang['TypeTag association'] = 'Associare i TypeTags';
-$lang['TypeTag dissociation'] = 'Dissociare i TypeTags';
-$lang['existing_typetag_list'] = 'TypeTag :';
-$lang['associate'] = 'Associare';
-$lang['dissociate'] = 'Dissociare';
-$lang['typetags_associated'] = 'TypeTag associato.';
-$lang['typetags_dissociated'] = 'TypeTag dissociato.';
-$lang['choose_typetag'] = ' Cegliere un TypeTag da associare ';
-$lang['error_associate'] = ' Dovete scegliere almeno un Tag E un TypeTag ';
-$lang['error_dissociate'] = ' Dovete scegliere almeno un Tag da dissociare ';
+$lang['New name'] = 'Nuovo nome';
+$lang['Color TypeTag'] = 'Colore del TypeTag';
 
-$lang['Edited TypeTag'] = 'Typetag modificato';
-$lang['New name'] = 'Nuovo nome';
+/* buttons */
 $lang['Modify'] = 'Modificare';
-$lang['You should select only one Typetag to edit.'] = 'Non potete modificare più di un Typetag alla volta.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Questo TypeTag esiste già';
+$lang['typetag_saved'] = 'TypeTag registrato';
+$lang['typetag_suppr'] = 'TypeTag cancellato';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'Dovete inserire tutti campi (nome e colore)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTag associato';
 
 ?>
Index: /extensions/typetags/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/typetags/language/lv_LV/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/lv_LV/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Jums jāinformē visus laukus (nosaukums un krāsa).';
-$lang['typetags_saved'] = 'TypeTags saglabāts.';
-$lang['typetags_suppr'] = 'TypeTagi dzēsti.';
-$lang['typetag_suppr'] = 'TypeTags dzēsts.';
-$lang['typetags_already exists'] = 'Šis TypeTags jau eksistē.';
-$lang['Edit selected typetags'] = 'Rediģēt atlasītos TypeTagus.';
-$lang['Delete selected typetags'] = 'Dzēst atlasītos TypeTagus.';
-$lang['Edit typetags'] = 'Rediģēt TypeTagus';
+/* section */
+$lang['Create a Typetag'] = 'Izveidot TypeTag';
+$lang['Edit typetag'] = 'Rediģēt TypeTag';
+$lang['TypeTag selection'] = 'Rediģēt - Dzēst TypeTags';
+$lang['TypeTag association'] = 'Sasaistīt - Atsaistīt TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'Rediģētais TypeTags';
 $lang['New color'] = 'Jauna krāsa';
-$lang['Create a Typetag'] = 'Izveidot TypeTagu';
-$lang['New TypeTag'] = 'TypeTaga nosaukums';
-$lang['ColorTypeTag'] = 'TypeTaga krāsa';
-$lang['TypeTag selection'] = 'Rediģēt - Dzēst TypeTagus';
-$lang['TypeTag association'] = 'Sasaistīt TypeTagus';
-$lang['TypeTag dissociation'] = 'Atsaistīt TypeTagus';
-$lang['existing_typetag_list'] = 'TypeTags, ko sasaistīt :';
-$lang['associate'] = 'Sasaistīt';
-$lang['dissociate'] = 'Atsaistīt';
-$lang['typetags_associated'] = 'TypeTags sasaistīts.';
-$lang['typetags_dissociated'] = 'TypeTags atsaistīts.';
-$lang['choose_typetag'] = ' Izvēlēties TypeTagu, ko sasaistīt ';
-$lang['error_associate'] = ' Jums jāizvēlas iezīme Tags UND TypeTags ';
-$lang['error_dissociate'] = ' Jums jāizvēlas iezīme/s Tag(s), lai atsaistītu ';
+$lang['New TypeTag'] = 'TypeTag nosaukums';
+$lang['New name'] = 'Jauns vārds';
+$lang['Color TypeTag'] = 'TypeTag krāsa';
 
-$lang['Edited TypeTag'] = 'Rediģētais Typetags';
-$lang['New name'] = 'Jauns vārds';
+/* buttons */
 $lang['Modify'] = 'Modificēt';
-$lang['You should select only one Typetag to edit.'] = 'Jums jāizvēlas tikai viens Typetags, ko rediģēt.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Šis TypeTag jau eksistē';
+$lang['typetag_saved'] = 'TypeTag saglabāts';
+$lang['typetag_suppr'] = 'TypeTag dzēsti';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'Jums jāinformē visus laukus (nosaukums un krāsa)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTags sasaistīts';
 
 ?>
Index: /extensions/typetags/language/no_NO/plugin.lang.php
===================================================================
--- /extensions/typetags/language/no_NO/plugin.lang.php	(revision 9862)
+++ /extensions/typetags/language/no_NO/plugin.lang.php	(revision 9863)
@@ -1,32 +1,29 @@
 <?php
 
-$lang['typetags_error'] = 'Du må inkludere alle felter (navn og farge).';
-$lang['typetags_saved'] = 'TypeTag lagre.';
-$lang['typetags_suppr'] = 'TypeTager slettet.';
-$lang['typetag_suppr'] = 'TypeTag slettet.';
-$lang['typetags_already exists'] = 'Denne TypeTagen eksisterer allerede.';
-$lang['Edit selected typetags'] = 'Rediger valgte TypeTager.';
-$lang['Delete selected typetags'] = 'Slett valgte TypeTager.';
-$lang['Edit typetags'] = 'Rediger TypeTags';
+/* section */
+$lang['Create a Typetag'] = 'Lag en TypeTag';
+$lang['Edit typetag'] = 'Rediger TypeTag';
+$lang['TypeTag selection'] = 'Rediger - Slett TypeTags';
+$lang['TypeTag association'] = 'Assosier - Dissossier TypeTags';
+
+/* fields */
+$lang['Edited TypeTag'] = 'Rediger TypeTag';
 $lang['New color'] = 'Ny farge';
-$lang['Create a Typetag'] = 'Lag en TypeTag';
 $lang['New TypeTag'] = 'Navn på TypeTag';
-$lang['ColorTypeTag'] = 'Farge på TypeTag';
-$lang['TypeTag selection'] = 'Rediger - Slett TypeTager';
-$lang['TypeTag association'] = 'Assosier TypeTager';
-$lang['TypeTag dissociation'] = 'Dissossier TypeTager';
-$lang['existing_typetag_list'] = 'TypeTag å assosiere med :';
-$lang['associate'] = 'Assossiere';
-$lang['dissociate'] = 'Dissossiere';
-$lang['typetags_associated'] = 'TypeTag assossiert.';
-$lang['typetags_dissociated'] = 'TypeTag dissossiert.';
-$lang['choose_typetag'] = ' Velg TypeTag a assossiere med ';
-$lang['error_associate'] = ' Du må velge Tagger OG en TypeTag ';
-$lang['error_dissociate'] = ' Du må velge Tagger å dissosiere med ';
+$lang['New name'] = 'Nytt navn';
+$lang['Color TypeTag'] = 'Farge på TypeTag';
 
-$lang['Edited TypeTag'] = 'Rediger Typetag';
-$lang['New name'] = 'Nytt navn';
+/* buttons */
 $lang['Modify'] = 'Endre';
-$lang['You should select only one Typetag to edit.'] = 'Du bør velge kun en Typetag å redigere.';
+$lang['Delete all associations'] = 'Delete all associations';
+
+/* messages */
+$lang['typetag_already_exists'] = 'Denne TypeTag eksisterer allerede';
+$lang['typetag_saved'] = 'TypeTag lagre';
+$lang['typetag_suppr'] = 'TypeTag slettet';
+$lang['typetag_unknown'] = 'Unknown TypeTag';
+$lang['typetag_error'] = 'Du må inkludere alle felter (navn og farge)';
+$lang['All associations have been removed'] = 'All associations have been removed';
+$lang['typetags_associated'] = 'TypeTags assossiert';
 
 ?>
Index: /extensions/typetags/main.inc.php
===================================================================
--- /extensions/typetags/main.inc.php	(revision 9862)
+++ /extensions/typetags/main.inc.php	(revision 9863)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: TypeT@gs
-Version: 2.2.0
+Version: 2.2.1
 Description: Allow to manage color of tags, as you want...
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=166
@@ -15,4 +15,5 @@
 define('typetags_PATH' , PHPWG_PLUGINS_PATH . typetags_DIR . '/');
 define('typetags_TABLE' , $prefixeTable . 'typetags');
+define('typetags_ADMIN', get_root_url().'admin.php?page=plugin-' . typetags_DIR);
 
 function typetags_admin_menu($menu)
@@ -20,5 +21,5 @@
   array_push($menu, array(
     'NAME' => 'TypeT@gs',
-    'URL' => get_root_url().'admin.php?page=plugin-' . typetags_DIR,
+    'URL' => typetags_ADMIN,
   ));
   return $menu;
Index: /extensions/typetags/maintain.inc.php
===================================================================
--- /extensions/typetags/maintain.inc.php	(revision 9862)
+++ /extensions/typetags/maintain.inc.php	(revision 9863)
@@ -1,39 +1,38 @@
 <?php
-
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
 function plugin_install()
 {
-  global $prefixeTable;
+	global $prefixeTable;
 
-  $query = 'SHOW FULL COLUMNS FROM ' . TAGS_TABLE . ';';
-  $result = array_from_query($query, 'Field');
-  if (!in_array('id_typetags', $result))
-  {
-    pwg_query('ALTER TABLE '.TAGS_TABLE.' ADD COLUMN `id_typetags` SMALLINT(5)');
-  }
+	$query = 'SHOW FULL COLUMNS FROM ' . TAGS_TABLE . ';';
+	$result = array_from_query($query, 'Field');
+	if (!in_array('id_typetags', $result))
+	{
+		pwg_query('ALTER TABLE '.TAGS_TABLE.' ADD COLUMN `id_typetags` SMALLINT(5)');
+	}
 
-  $result = pwg_query('SHOW TABLES LIKE "' . $prefixeTable .'typetags"');
-  if (!mysql_fetch_row($result))
-  {
-    $q = 'CREATE TABLE '. $prefixeTable .'typetags(
-      id smallint(5) unsigned NOT NULL auto_increment,
-      name VARCHAR(255) NOT NULL,
-      color VARCHAR(255) NOT NULL,
-      PRIMARY KEY  (id));';
-    pwg_query($q);
-  }
+	$result = pwg_query('SHOW TABLES LIKE "' . $prefixeTable .'typetags"');
+	if (!mysql_fetch_row($result))
+	{
+		$q = 'CREATE TABLE '. $prefixeTable .'typetags(
+			id smallint(5) unsigned NOT NULL auto_increment,
+			name VARCHAR(255) NOT NULL,
+			color VARCHAR(255) NOT NULL,
+			PRIMARY KEY  (id));';
+		pwg_query($q);
+	}
 }
-  
+
 function plugin_uninstall()
 {
-  global $prefixeTable;
+	global $prefixeTable;
 
-  $q = ' ALTER TABLE '.TAGS_TABLE.' DROP COLUMN `id_typetags`';
-  pwg_query( $q );
+	$q = ' ALTER TABLE '.TAGS_TABLE.' DROP COLUMN `id_typetags`';
+	pwg_query( $q );
 
-  $q = ' DROP TABLE '. $prefixeTable .'typetags;';
-  pwg_query($q);
+	$q = ' DROP TABLE '. $prefixeTable .'typetags;';
+	pwg_query($q);
 }
-  
+
 ?>
