Index: plugins/optional/tags_web/sitemap.xmap
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/tags_web/sitemap.xmap,v
retrieving revision 1.3
diff -u -r1.3 sitemap.xmap
--- plugins/optional/tags_web/sitemap.xmap	31 Jul 2008 10:00:40 -0000	1.3
+++ plugins/optional/tags_web/sitemap.xmap	12 Aug 2009 08:58:19 -0000
@@ -126,13 +126,13 @@
 				<map:transform src="pages/assign.xsl" type="xslt">
                     <map:parameter name="contextPath" value="{request:contextPath}"/>
                     <map:parameter name="pluginName" value="{request-attr:pluginName}"/>
-					<map:parameter name="path" value="{path}"/>
-					<map:parameter name="options" value="{options}"/>
+					<map:parameter name="start-folded-pages-and-content" value="{site-configuration:{request-param:sitename}:tags.pages.contents.start.folded}"/>
+					<map:parameter name="start-folded-pages" value="{site-configuration:{request-param:sitename}:tags.pages.start.folded}"/>
 				</map:transform>
 				<map:transform type="i18n">
 					<map:parameter name="locale" value="{locale:locale}"/>
 				</map:transform>
-				<map:serialize type="html"/>
+				<map:serialize type="xml"/>
 			</map:match>
 
 			<map:match pattern="filter.html">
Index: plugins/optional/tags_web/plugin.xml
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/tags_web/plugin.xml,v
retrieving revision 1.2
diff -u -r1.2 plugin.xml
--- plugins/optional/tags_web/plugin.xml	31 Jul 2008 10:00:40 -0000	1.2
+++ plugins/optional/tags_web/plugin.xml	12 Aug 2009 08:58:19 -0000
@@ -30,85 +30,27 @@
                 </Static>
 			</extension>
 
-         <!--    <extension  point="org.ametys.runtime.ui.item.UIItemManager" 
-                        id="org.ametys.anycontent.plugins.tags_web.assign.Contents"
-                        class="org.ametys.anycontent.plugins.web.ui.ContentStaticUIItemFactory"
-                        logger="org.ametys.anycontent.plugins.tags_web.assign">
-                <Static>
-                    <LabelKey>PLUGINS_TAGS_ASSIGN_CONTENTS_LABEL</LabelKey>
-                    <DescriptionKey>PLUGINS_TAGS_ASSIGN_CONTENTS_DESCRIPTION</DescriptionKey>
-                    <Right>ANWRT_Rights_Tags_Public_Tags_Assign</Right>
-                    <Contexts>
-                    	<Context>content_read</Context>
-                    </Contexts>
-                    <Icons>
-                        <Small>img/assign_small.gif</Small>
-                        <Medium>img/assign_medium.gif</Medium>
-                        <Large>img/assign_large.gif</Large>
-                    </Icons>
-                    <Action type="class">
-                        <Class value="Plugin_Tags_Assign_Pages">
-                        </Class>
-                        <Imports>
-                            <File>js/assign.js.i18n</File>
-                        </Imports>
-                    </Action>
-                </Static>
-			</extension> -->
-			
-<!--            <extension  point="org.ametys.runtime.ui.item.UIItemManager" -->
-<!--                        id="org.ametys.anycontent.plugins.tags_web.filter.Contents"-->
-<!--                        class="org.ametys.anycontent.plugins.web.ui.PageStaticUIItemFactory"-->
-<!--                        logger="org.ametys.anycontent.plugins.tags_web.filter">-->
-<!--                <Static>-->
-<!--                    <LabelKey>PLUGINS_TAGS_FILTER_LABEL</LabelKey>-->
-<!--                    <DescriptionKey>PLUGINS_TAGS_FILTER_DESCRIPTION</DescriptionKey>-->
-<!--                    <Right>ANWRT_Rights_Tags_Public_Tags_Assign</Right>-->
-<!--                    <Contexts>-->
-<!--                    	<Context>page</Context>-->
-<!--                    </Contexts>-->
-<!--                    <Icons>-->
-<!--                        <Small>img/filter_small.gif</Small>-->
-<!--                        <Medium>img/filter_medium.gif</Medium>-->
-<!--                        <Large>img/filter_large.gif</Large>-->
-<!--                    </Icons>-->
-<!--                    <Action type="class">-->
-<!--                        <Class value="Plugin_Tags_Filters">-->
-<!--                        	<target>page</target>-->
-<!--                        </Class>-->
-<!--                        <Imports>-->
-<!--                            <File>js/filters.js.i18n</File>-->
-<!--                        </Imports>-->
-<!--                    </Action>-->
-<!--                </Static>-->
-<!--			</extension>-->
-<!--			-->
-<!--            <extension  point="org.ametys.runtime.ui.item.UIItemManager" -->
-<!--                        id="org.ametys.anycontent.plugins.tags_web.filter.Pages"-->
-<!--                        class="org.ametys.anycontent.plugins.web.ui.PageStaticUIItemFactory"-->
-<!--                        logger="org.ametys.anycontent.plugins.tags_web.filter.Pages">-->
-<!--                <Static>-->
-<!--                    <LabelKey>PLUGINS_TAGS_FILTER_PAGES_LABEL</LabelKey>-->
-<!--                    <DescriptionKey>PLUGINS_TAGS_FILTER_PAGES_DESCRIPTION</DescriptionKey>-->
-                    <!--Right>ANWRT_Rights_Tags_Public_Tags_Filter_Pages</Right-->
-<!--                    <Contexts>-->
-<!--                    	<Context>page</Context>-->
-<!--                    </Contexts>-->
-<!--                    <Icons>-->
-<!--                        <Small>img/filter_page_small.gif</Small>-->
-<!--                        <Medium>img/filter_page_medium.gif</Medium>-->
-<!--                        <Large>img/filter_page_large.gif</Large>-->
-<!--                    </Icons>-->
-<!--                    <Action type="class">-->
-<!--                        <Class value="Plugin_Tags_Filters_Pages">-->
-<!--                        	<target>page</target>-->
-<!--                        </Class>-->
-<!--                        <Imports>-->
-<!--                            <File>js/filters_pages.js.i18n</File>-->
-<!--                        </Imports>-->
-<!--                    </Action>-->
-<!--                </Static>-->
-<!--			</extension>-->
+            <extension point="org.ametys.anycontent.extensions.site.SiteExtensionPoint"
+                       id="org.ametys.anycontent.plugins.tags_web.SiteConfiguration">
+                <site-configuration id="tags.pages.start.folded">
+                    <label>PLUGINS_TAGS_CONF_PAGES_START_FOLDED_LABEL</label>
+                    <description>PLUGINS_TAGS_CONF_PAGES_START_FOLDED_DESCRIPTION</description>
+                    <type>boolean</type>
+                    <default>false</default>
+                    <category>PLUGINS_TAGS_CATEGORY</category>
+                    <group>PLUGINS_TAGS_ASSIGN_GROUP</group>
+                    <priority>10</priority>
+                </site-configuration>
+                <site-configuration id="tags.pages.contents.start.folded">
+                    <label>PLUGINS_TAGS_CONF_PAGES_CONTENTS_START_FOLDED_LABEL</label>
+                    <description>PLUGINS_TAGS_CONF_PAGES_CONTENTS_START_FOLDED_DESCRIPTION</description>
+                    <type>boolean</type>
+                    <default>true</default>
+                    <category>PLUGINS_TAGS_CATEGORY</category>
+                    <group>PLUGINS_TAGS_ASSIGN_GROUP</group>
+                    <priority>5</priority>
+                </site-configuration>
+            </extension>
 		</extensions>
 	</feature>
 </plugin>
\ No newline at end of file
Index: plugins/optional/tags_web/i18n/messages_fr.xml
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/tags_web/i18n/messages_fr.xml,v
retrieving revision 1.3
diff -u -r1.3 messages_fr.xml
--- plugins/optional/tags_web/i18n/messages_fr.xml	31 Jul 2008 10:00:41 -0000	1.3
+++ plugins/optional/tags_web/i18n/messages_fr.xml	12 Aug 2009 08:58:19 -0000
@@ -1,5 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <catalogue xml:lang="fr">
+
+    <!-- Configuration -->
+    <message key="PLUGINS_TAGS_CATEGORY">Etiquettes</message>
+    <message key="PLUGINS_TAGS_ASSIGN_GROUP">Interface d'assignation des étiquettes</message>
+    <message key="PLUGINS_TAGS_CONF_PAGES_START_FOLDED_LABEL">Afficher l'arbre replié (pages)</message>
+    <message key="PLUGINS_TAGS_CONF_PAGES_START_FOLDED_DESCRIPTION">Afficher l'arbre des étiquettes plié (recommandé si le nombre de catégories dépasse 8 ou si le nombre total d'étiquettes dépasse 30)</message>
+    <message key="PLUGINS_TAGS_CONF_PAGES_CONTENTS_START_FOLDED_LABEL">Afficher l'arbre replié (contenus)</message>
+    <message key="PLUGINS_TAGS_CONF_PAGES_CONTENTS_START_FOLDED_DESCRIPTION">Afficher l'arbre des étiquettes de pages plié (recommandé si le nombre de catégories dépasse 8 ou si le nombre total d'étiquettes de pages dépasse 30)</message>
+
 	<!-- UI Texts -->
 	<!-- Assignement -->
 	<message key="PLUGINS_TAGS_ASSIGN_LABEL">Etiqueter</message>
@@ -11,6 +20,10 @@
 	<message key="PLUGINS_TAGS_DIALOG_EDIT">Modifier</message>
 	<message key="PLUGINS_TAGS_DIALOG_DELETE">Supprimer</message>
 	<message key="PLUGINS_TAGS_DIALOG_CLOSE">Fermer</message>
+	<message key="PLUGINS_TAGS_DIALOG_AVAILABLE_TAGS">Etiquettes disponibles</message>
+	<message key="PLUGINS_TAGS_DIALOG_ASSIGNED_TAGS">Etiquettes assignées :</message>
+	<message key="PLUGINS_TAGS_DIALOG_OPEN_ALL">Tout ouvrir</message>
+	<message key="PLUGINS_TAGS_DIALOG_CLOSE_ALL">Tout fermer</message>
 	<message key="PLUGINS_TAGS_DIALOG_ASSIGN_LABEL">Choix des étiquettes</message>
 	<message key="PLUGINS_TAGS_DIALOG_NO_SELECTION_ERROR">Au moins une étiquette doit être sélectionnée</message>
 	<message key="PLUGINS_TAGS_DIALOG_RETRIEVING_ERROR">Une erreur est survenue lors de la récupération des étiquettes déjà associées</message>
Index: plugins/optional/tags_web/resources_dynamic/js/assign.js
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/tags_web/resources_dynamic/js/assign.js,v
retrieving revision 1.5
diff -u -r1.5 assign.js
--- plugins/optional/tags_web/resources_dynamic/js/assign.js	13 Oct 2008 13:08:52 -0000	1.5
+++ plugins/optional/tags_web/resources_dynamic/js/assign.js	12 Aug 2009 08:58:19 -0000
@@ -15,6 +15,323 @@
 {
 }
 
+// Checkbox images, values are initialized with the dialog, as we need to know the plugin name.
+var checkImgOff;
+var checkImgOn;
+
+function getCheckboxImg(element)
+{
+    var imgNode;
+    for (var i = 0; element.childNodes != null &amp;&amp; i &lt; element.childNodes.length; i++)
+    {
+        var child = element.childNodes[i];
+        if (child.tagName &amp;&amp; child.tagName.toLowerCase() == 'img' &amp;&amp; child.className &amp;&amp; child.className == 'checkbox')
+        {
+            imgNode = child;
+        }
+    }
+    return imgNode;
+}
+
+function selectTag(tagLink)
+{
+    var _document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
+    var tagKey = tagLink.getAttribute('key');
+    var summaryDiv;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages');
+    }
+    else
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages_And_Content');
+    }
+    
+    // "Checkbox" image node.
+    var imgNode = getCheckboxImg(tagLink);
+    
+    imgNode.setAttribute('src', checkImgOn);
+    imgNode.setAttribute('checked', 'checked');
+    tagLink.setAttribute('selected', 'selected');
+    
+    // Get the tag category.
+    var categorySpan = STools.getDirectChildrenByTagName(tagLink.parentNode.parentNode.parentNode, 'span')[0];
+    var catName = categorySpan.getAttribute('category');
+    var catId = categorySpan.getAttribute('categoryId');
+    
+    // Set the tag category bold
+    categorySpan.style.fontWeight = 'bold';
+}
+
+function deselectTag(tagLink)
+{
+    var _document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
+    var tagKey = tagLink.getAttribute('key');
+    var summaryDiv;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages');
+    }
+    else
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages_And_Content');
+    }
+    
+    // "Checkbox" image node.
+    var imgNode = getCheckboxImg(tagLink);
+    
+    // Uncheck the checkbox
+    imgNode.setAttribute('src', checkImgOff);
+    imgNode.removeAttribute('checked');
+    tagLink.removeAttribute('selected');
+    
+    // Get the tag category.
+    var categorySpan = STools.getDirectChildrenByTagName(tagLink.parentNode.parentNode.parentNode, 'span')[0];
+    var catId = categorySpan.getAttribute('categoryId');
+    
+    // Remove 'bold' style from the tag category if there is no more selected tag in it.
+    var selectedList = false;
+    var categoryTags = STools.getChildrenByTagName(tagLink.parentNode.parentNode, 'a');
+    for (var i = 0; i &lt; categoryTags.length &amp;&amp; !selectedList; i++)
+    {
+        if (categoryTags[i].getAttribute('key') != null &amp;&amp; categoryTags[i].getAttribute('selected') != null)
+        {
+            selectedList = true;
+        }
+    }
+    if (!selectedList)
+    {
+        categorySpan.style.fontWeight = 'normal';
+    }
+}
+
+function fillSummary()
+{
+    var _document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
+    var summaryDiv;
+    var treeDiv;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages');
+        treeDiv = _document.getElementById("Plugin_Tags_Assign_Pages_tree");
+    }
+    else
+    {
+        summaryDiv = _document.getElementById('selected_tags_Pages_And_Content');
+        treeDiv = _document.getElementById("Plugin_Tags_Assign_Pages_And_Content_tree");
+    }
+    var summaryList = summaryDiv.firstChild;
+    
+    // Clear the list.
+    while (summaryList.hasChildNodes())
+    {
+        summaryList.removeChild(summaryList.firstChild);
+    }
+    
+    // Fill in the list.
+    var categories = STools.getChildrenByTagName(treeDiv, 'span');
+    for (var i = 0; i &lt; categories.length; i++)
+    {
+        var categoryTags = STools.getChildrenByTagName(categories[i].parentNode, 'a');
+        var catList = null;
+        for (var j = 0; j &lt; categoryTags.length; j++)
+        {
+            if (categoryTags[j].getAttribute('key') != null &amp;&amp; categoryTags[j].getAttribute('selected') != null)
+            {
+                // First time, create the category 'li' tag.
+                if (catList == null)
+                {
+                    var catId = categories[i].getAttribute('categoryId');
+                    var catName = categories[i].getAttribute('category');
+                    catList = addSummaryCategory(_document, summaryList, catId, catName);
+                }
+                
+                // Add the tag to the summary.
+                var tagId = categoryTags[j].getAttribute('id');
+                var tagName = categoryTags[j].getAttribute('name');
+                var tagKey = categoryTags[j].getAttribute('key');
+                addSummaryTag(_document, catList, tagId, tagName, tagKey);
+            }
+        }
+    }
+}
+
+function addSummaryCategory(doc, list, id, name)
+{
+    var text = doc.createTextNode(name);
+    var categoryLi = doc.createElement('li');
+    var categoryList = doc.createElement('ul');
+    categoryLi.setAttribute('categoryId', id);
+    categoryLi.appendChild(text);
+    categoryLi.appendChild(categoryList);
+    
+    list.appendChild(categoryLi);
+    
+    return categoryList;
+}
+
+function addSummaryTag(doc, list, id, name, key)
+{
+    var text = doc.createTextNode(name);
+    var tagItem = doc.createElement('li');
+    var tagLink = doc.createElement('a');
+    
+    tagLink.setAttribute('href', '#');
+    tagLink.setAttribute('treeId', id);
+    tagLink.setAttribute('tagKey', key);
+    tagLink.appendChild(text);
+    tagLink.onclick = function() {
+        summaryClick(tagLink);
+        return false;
+    };
+    tagItem.appendChild(tagLink);
+    
+    list.appendChild(tagItem);
+    
+    return tagItem;
+}
+
+function summaryClick(tagLink)
+{
+    var _document = tagLink.ownerDocument;
+    var treeId = tagLink.getAttribute('treeId');
+    var catId = tagLink.parentNode.parentNode.parentNode.getAttribute('categoryId');
+    openCategory(_document.getElementById('category' + catId).parentNode);
+    _document.getElementById(treeId).focus();
+}
+
+function foldAll(fold)
+{
+    var _document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
+    var treeDiv;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        treeDiv = _document.getElementById("Plugin_Tags_Assign_Pages_tree");
+    }
+    else
+    {
+        treeDiv = _document.getElementById("Plugin_Tags_Assign_Pages_And_Content_tree");
+    }
+    
+    var categories = STools.getChildrenByTagName(treeDiv, 'span');
+    for (var i = 0; i &lt; categories.length; i++)
+    {
+        var category = categories[i].parentNode;
+        
+        if (fold)
+        {
+            closeCategory(category);
+        }
+        else
+        {
+            openCategory(category);
+        }
+    }
+}
+
+function openCategory(category)
+{
+    if (category.className == "closed_intermediate")
+    {
+        category.className = "opened_intermediate";
+        category.style.display = "";
+    }
+    else if (category.className == "closed_terminal")
+    {
+        category.className = "opened_terminal";
+        category.style.display = "";
+    }
+}
+
+function closeCategory(category)
+{
+    if (category.className == "opened_intermediate")
+    {
+        category.className = "closed_intermediate";
+    }
+    else if (category.className == "opened_terminal")
+    {
+        category.className = "closed_terminal";
+    }
+}
+
+Plugin_Tags_Assign_Pages.stree_Pages;
+Plugin_Tags_Assign_Pages.stree_PagesAndContent;
+
+function streeListener_PagesAndContent ()
+{
+}
+streeListener_PagesAndContent.canDrag = false;
+
+streeListener_PagesAndContent.canRename = false;
+
+streeListener_PagesAndContent.onStartDrag = function (stree, element)
+{
+    return false;
+}
+streeListener_PagesAndContent.onCanDrop = function (stree, element, onelement)
+{
+    return false;
+}
+streeListener_PagesAndContent.onDrop = function (stree, element, onelement)
+{
+    return false;
+}
+streeListener_PagesAndContent.onBeforeEditLabel = function (stree, element)
+{
+    return false;
+}
+streeListener_PagesAndContent.onCancelEditLabel = function (stree, element)
+{
+    return false;
+}
+streeListener_PagesAndContent.onEditLabel = function (stree, element, newname)
+{
+    return false;
+}
+streeListener_PagesAndContent.onOpenNode = function(stree, element)
+{
+}
+streeListener_PagesAndContent.onSelect = function(element)
+{
+    if (element == null)
+    {
+        return;
+    }
+    
+    // If the node represents a tag and not a category.
+    if (element.getAttribute('key') != null)
+    {
+        // "Checkbox" image node.
+        var imgNode = getCheckboxImg(element);
+        
+        if (element.getAttribute('selected') == null)
+        {
+            selectTag(element);
+        }
+        else
+        {
+            deselectTag(element);
+        }
+        fillSummary();
+    }
+    
+    var treeVar;
+    var treeDocumentVar;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        treeVar = 'Plugin_Tags_Assign_Pages.stree_Pages.tree';
+        treeDocumentVar = 'Plugin_Tags_Assign_Pages.sdialog_Pages.ui.iframe.contentWindow.document';
+    }
+    else
+    {
+        treeVar = 'Plugin_Tags_Assign_Pages.stree_PagesAndContent.tree';
+        treeDocumentVar = 'Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.ui.iframe.contentWindow.document';
+    }
+    
+    window.setTimeout('STree.select(' + treeVar + ', null, ' + treeDocumentVar + ')', 1);
+}
+
 Plugin_Tags_Assign_Pages.initialize = function(plugin)
 {
 	Plugin_Tags_Assign_Pages.plugin = plugin;
@@ -43,27 +360,39 @@
 
 	var config = new SDialog.Config()
 	config.innerTableClass = "dialog";
-  
+	
+	// Page tag dialog.
 	Plugin_Tags_Assign_Pages.sdialog_Pages = new SDialog("Plugin_Tags_Assign_Pages", 
 								"<i18n:text i18n:key="PLUGINS_TAGS_DIALOG_ASSIGN_LABEL"/>", 
 								getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + "/img/assign_small.gif", 
-								320, 450, config, Plugin_Tags_Assign_Pages);
+								620, 450, config, Plugin_Tags_Assign_Pages);
 	
 	
 	Plugin_Tags_Assign_Pages.sdialog_Pages.paint();
 
 	Tools.loadStyle(Plugin_Tags_Assign_Pages.sdialog_Pages.ui.iframe.contentWindow.document, context.contextPath + '/kernel/resources/css/dialog.css');
-
+	Tools.loadStyle(Plugin_Tags_Assign_Pages.sdialog_Pages.ui.iframe.contentWindow.document, getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + '/css/assign.css');
+	Plugin_Tags_Assign_Pages.sdialog_Pages.ui.iframe.contentWindow.document.charset = "UTF-8";
+	
+    Plugin_Tags_Assign_Pages.stree_Pages = new STree("Plugin_Tags_Assign_Pages_tree", Plugin_Tags_Assign_Pages.sdialog_Pages.ui.iframe.contentWindow.document, 0, streeListener_PagesAndContent);
+    
+    // Page and content tag dialog.
 	Plugin_Tags_Assign_Pages.sdialog_PagesAndContent= new SDialog("Plugin_Tags_Assign_Pages_And_Content", 
 								"<i18n:text i18n:key="PLUGINS_TAGS_DIALOG_ASSIGN_LABEL"/>", 
 								getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + "/img/assign_small.gif", 
-								320, 450, config, Plugin_Tags_Assign_Pages);
+								620, 450, config, Plugin_Tags_Assign_Pages);
 
-	
 	Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.paint();
 	
 	Tools.loadStyle(Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.ui.iframe.contentWindow.document, context.contextPath + '/kernel/resources/css/dialog.css');
+    Tools.loadStyle(Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.ui.iframe.contentWindow.document, getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + '/css/assign.css');
+	Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.ui.iframe.contentWindow.document.charset = "UTF-8";
 
+	Plugin_Tags_Assign_Pages.stree_PagesAndContent = new STree("Plugin_Tags_Assign_Pages_And_Content_tree", Plugin_Tags_Assign_Pages.sdialog_PagesAndContent.ui.iframe.contentWindow.document, 0, streeListener_PagesAndContent);
+    
+	checkImgOff = getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + '/img/checkbox.gif';
+	checkImgOn = getPluginResourcesUrl(Plugin_Tags_Assign_Pages.plugin) + '/img/checkbox-on-tick.gif';
+	
     Plugin_Tags_Assign_Pages.initialized = true;
     
     return true;
@@ -96,53 +425,55 @@
 
     Plugin_Tags_Assign_Pages.target = Tools.getFromXML(result,"target");
     
-    var _document;    
+    var _document;
+    var category;
     if (Plugin_Tags_Assign_Pages.target == "page")
     {
     	Plugin_Tags_Assign_Pages.box = Plugin_Tags_Assign_Pages.sdialog_Pages;
     	_document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
     	_document.getElementById("keysPrivateSelected").value = "";
+    	category = _document.getElementById("Plugin_Tags_Assign_Pages_tree");
     }
     else
     {
-    	Plugin_Tags_Assign_Pages.box = Plugin_Tags_Assign_Pages.sdialog_PagesAndContent;    	
-    	_document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document
+    	Plugin_Tags_Assign_Pages.box = Plugin_Tags_Assign_Pages.sdialog_PagesAndContent;
+    	_document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
     	_document.getElementById("keysPrivateSelectedPagesAndContent").value = "";
+        category = _document.getElementById("Plugin_Tags_Assign_Pages_And_Content_tree");
     }
-        
     
 	// Initial tag selection
-	var category = _document.getElementById("tag");
 	if (Tools.getFromXML(result,"keys").indexOf(",") &gt;= 0)
 	{
-	Plugin_Tags_Assign_Pages.keys = Tools.getFromXML(result,"keys").split(",");
+	    Plugin_Tags_Assign_Pages.keys = Tools.getFromXML(result,"keys").split(",");
 	}
 	else
 	{
 		Plugin_Tags_Assign_Pages.keys = [Tools.getFromXML(result,"keys")];
 	}
 	var keysArray = Plugin_Tags_Assign_Pages.keys;
-
-	for (var i = 0; i &lt; category.options.length; i++)
-	{
-		category.options[i].selected = false;
-	}
-
-	if (keysArray != null &amp;&amp; keysArray.length > 0)
-	{
-		for (var i = 0; i &lt; category.options.length; i++)
-		{
-			for (var j = 0; j &lt; keysArray.length; j++)
-			{
-				if (keysArray[j] == category.options[i].value)
-				{
-					category.options[i].selected = true;
-//					keysArray[j] = "";
-				}
-			}
-		}
-	}
-
+	
+	// Select all the 'a' tags (representing both categories and tags).
+	var links = STools.getChildrenByTagName(category, 'a');
+	for (var i = 0; i &lt; links.length; i++)
+    {
+	    // If the node has a 'key' attribute, it's a tag
+	    if (links[i].getAttribute('key') != null)
+	    {
+	        var linkKey = links[i].getAttribute('key');
+	        
+            for (var j = 0; j &lt; keysArray.length; j++)
+            {
+                if (keysArray[j] == linkKey)
+                {
+                    selectTag(links[i]);
+                }
+            }
+	    }
+    }
+	// When all the tags are selected, synchronize the right view (summary).
+	fillSummary();
+	
 	var keysPrivate;
 	for (var i = 0; i &lt; keysArray.length; i++)
 	{
@@ -163,10 +494,8 @@
     {    	
     	_document.getElementById("keysPrivateSelectedPagesAndContent").value = keysPrivate;
     }
-	
+
 	Plugin_Tags_Assign_Pages.box.showModal();
-	
-    try { _document.getElementById('tag').focus(); } catch (e) { }
   
     return true;
 }
@@ -175,31 +504,47 @@
 {
 	var _document = Plugin_Tags_Assign_Pages.box.ui.iframe.contentWindow.document;
 	
-	var category = _document.getElementById("tag");
-
-	// Searching for selected items
-	var selected = false;
-	var selectedKeys = "";
-	var unselectedKeys = "";
-	for (var i = 0; i &lt; category.options.length; i++)
-	{
-		if (category.options[i].selected)
-		{
-			selected = true;
-			// Building keys list
-			selectedKeys += category.options[i].value + ",";
-		}
-		else
-		{
-			for (var j = 0; j &lt; Plugin_Tags_Assign_Pages.keys.length; j++)
-			{
-				if (Plugin_Tags_Assign_Pages.keys[j] == category.options[i].value)
-				{
-					unselectedKeys += category.options[i].value + ",";
-				}
-			}
-		}
-	}
+    var category;
+    if (Plugin_Tags_Assign_Pages.target == "page")
+    {
+        category = _document.getElementById("Plugin_Tags_Assign_Pages_tree");
+    }
+    else
+    {
+        category = _document.getElementById("Plugin_Tags_Assign_Pages_And_Content_tree");
+    }
+	
+    var selected = false;
+    var selectedKeys = "";
+    var unselectedKeys = "";
+    
+    var links = STools.getChildrenByTagName(category, 'a');
+    for (var i = 0; i &lt; links.length; i++)
+    {
+        // If the node has a 'key' attribute, it's a tag
+        if (links[i].getAttribute('key') != null)
+        {
+            var tagKey = links[i].getAttribute('key');
+            
+            // If the tag is selected
+            if (links[i].getAttribute('selected') != null)
+            {
+                selected = true;
+                // Building keys list
+                selectedKeys += tagKey + ",";
+            }
+            else
+            {
+                for (var j = 0; j &lt; Plugin_Tags_Assign_Pages.keys.length; j++)
+                {
+                    if (Plugin_Tags_Assign_Pages.keys[j] == tagKey)
+                    {
+                        unselectedKeys += tagKey + ",";
+                    }
+                }
+            }
+        }
+    }
 
 	selectedKeys = selectedKeys.substring(0, selectedKeys.lastIndexOf(","));
 	unselectedKeys = unselectedKeys.substring(0, unselectedKeys.lastIndexOf(","));
Index: releaseNotes.xml
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/releaseNotes.xml,v
retrieving revision 1.320
diff -u -r1.320 releaseNotes.xml
--- releaseNotes.xml	11 Aug 2009 13:51:31 -0000	1.320
+++ releaseNotes.xml	12 Aug 2009 08:58:19 -0000
@@ -203,7 +203,6 @@
     	<note module="odf" type="bug">AMCMS-678: possible NPE when no language node in the plugin ODF.</note>
     	<note module="anycontent" type="bug">CMS-715: Random NPE when accessing a value from site configuration.</note>
     	<note module="kernel" type="add">CMS-720 The generated html root tag should have a lang attribute to conform with accessibiliy guidelines</note>
-    	<note module="accessibility" type="fix">CMS-749: English translation of accessibility plugin is incomplete</note>
     	<note module="generation" type="bug">CMS-722: Omit xml declaration when using Ametys Runtime XHTMLSerializer</note>
     	<note module="structured" type="update">CMS-724 Allow the alternative text for an image to be optional</note>
     	<note module="structured" type="update">CMS-725 New field for selecting a file from the resources explorer</note>
@@ -219,5 +218,6 @@
     	<note module="web" type="add">CMS-745: shared content UI Item.</note>
     	<note module="accessibility" type="fix">CMS-749: English translation of accessibility plugin is incomplete</note>
     	<note module="kernel" type="update">CMS-756: IE8 Compatibility mode : Table, images are not created at the right place</note>    	
+    	<note module="tags" type="update">CMS-757: improve the ergonomy of the tag assignation dialog.</note>    	
     </release>
 </releases>
\ No newline at end of file
Index: plugins/optional/tags_web/pages/assign.xsl
===================================================================
RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/tags_web/pages/assign.xsl,v
retrieving revision 1.3
diff -u -r1.3 assign.xsl
--- plugins/optional/tags_web/pages/assign.xsl	31 Jul 2008 10:00:41 -0000	1.3
+++ plugins/optional/tags_web/pages/assign.xsl	12 Aug 2009 08:58:19 -0000
@@ -5,46 +5,83 @@
 
 	<xsl:param name="contextPath"/>
 	<xsl:param name="pluginName"/>
+	<xsl:param name="start-folded-pages-and-content">true</xsl:param>
+	<xsl:param name="start-folded-pages">false</xsl:param>
 	
 	<xsl:variable name="resourcesDir"><xsl:value-of select="$contextPath"/>/plugins/<xsl:value-of select="$pluginName"/>/resources</xsl:variable>
 
 	<xsl:template match="/">
 		<xml>
-			<table id="Plugin_Tags_Assign_Pages_And_Content" style="display: none; width: 300px; height:365px; margin-top: 5px; margin-left: 10px; margin-right: 10px;">
-				<tr>
-					<td style="padding-top: 5px; padding-left: 10px; padding-right: 10px;">
-						<div style="border: 1px solid black; padding: 5px;">
-						<i18n:text i18n:key="EXPLANATIONS" i18n:catalogue="plugin.{$pluginName}"/>
-						</div>
-					</td>
-				</tr>
-				<tr>
-					<td style="padding-top: 10px; padding-left: 10px" height="290px">
-						<select id="tag" name="tag" multiple="multiple" height="290px" style="width: 300px; height: 290;">
-							<xsl:for-each select="Model/categories/category">
-								<xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and count(tag[@type='Publique']) != 0) or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and count(tag[@type='Privée']) != 0)">
-									<optgroup label="{@name}">
-										<xsl:for-each select="tag">
-											<xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and @type = 'Publique') or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and @type = 'Privée')">
-												<option value="{@key}" style="width: 300px;"><xsl:value-of select="@name"/></option>
-											</xsl:if>
-										</xsl:for-each>
-									</optgroup>
-								</xsl:if>
-							</xsl:for-each>
-						</select>
-					</td>
+			<table id="Plugin_Tags_Assign_Pages_And_Content" class="assign-tags" style="display: none; width: 600px; height:365px; margin-top: 5px; margin-left: 10px; margin-right: 10px;">
+                <tr>
+                    <td style="padding: 10px 10px 0px 10px">
+                        <span><i18n:text i18n:key="PLUGINS_TAGS_DIALOG_AVAILABLE_TAGS" i18n:catalogue="plugin.{$pluginName}"/></span>
+                        <span id="fold-options">
+                            <xsl:text> (</xsl:text>
+                            <a class="fold-option" href="#" title="Ouvrir toutes les catégories" onclick="parent.foldAll(false); return false;">
+                                <i18n:text i18n:key="PLUGINS_TAGS_DIALOG_OPEN_ALL" i18n:catalogue="plugin.{$pluginName}"/>
+                            </a>
+                            <xsl:text> | </xsl:text>
+                            <a class="fold-option" href="#" title="Replier toutes les catégories" onclick="parent.foldAll(true); return false;">
+                                <i18n:text i18n:key="PLUGINS_TAGS_DIALOG_CLOSE_ALL" i18n:catalogue="plugin.{$pluginName}"/>
+                            </a>
+                            <xsl:text>)</xsl:text>
+                        </span>
+                    </td>
+                    <td style="padding: 10px 10px 0px 10px">
+                        <span><i18n:text i18n:key="PLUGINS_TAGS_DIALOG_ASSIGNED_TAGS" i18n:catalogue="plugin.{$pluginName}"/></span>
+                    </td>
+                </tr>           
+				<tr>
+					<td style="padding-top: 10px; padding-left: 10px; margin:0px; width:300px; height:350px; vertical-align:top">
+                        <div id="Plugin_Tags_Assign_Pages_And_Content_tree" style="width: 300px; height: 350px; border:solid 1px black; display:none;">
+                            <ul>
+    							<xsl:for-each select="Model/categories/category">
+    								<xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and count(tag[@type='Publique']) != 0) or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and count(tag[@type='Privée']) != 0)">
+                                        <li>
+                                            <xsl:attribute name="class">
+                                                <xsl:choose>
+                                                    <xsl:when test="$start-folded-pages-and-content = 'true'">closed</xsl:when>
+                                                    <xsl:otherwise>opened</xsl:otherwise>
+                                                </xsl:choose>
+                                            </xsl:attribute>
+                                            <span category="{@name}" categoryId="{@id}" id="category{@id}" style="margin-left:5px"><xsl:value-of select="@name"/></span>
+                                            <ul>
+                                                <xsl:for-each select="tag">
+                                                    <xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and @type = 'Publique') or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and @type = 'Privée')">
+                                                        <li tagKey="{@key}">
+                                                            <a key="{@key}" name="{@name}" title="{@description}">
+                                                                <img class="checkbox" src="{$resourcesDir}/img/checkbox.gif"/>
+                                                                <xsl:value-of select="@name"/>
+                                                            </a>
+                                                        </li>
+                                                    </xsl:if>
+                                                </xsl:for-each>
+                                            </ul>
+                                        
+                                        </li>
+    								</xsl:if>
+    							</xsl:for-each>
+                            </ul>
+                        </div>
+					</td>
+                    <td style="padding:10px 10px 0px 10px; margin:0px; width:300px; height:350px; vertical-align:top">
+                        <div id="selected_tags_Pages_And_Content" class="summary" style="height:350px; overflow-y:scroll; border:solid 1px black;">
+                            <ul>
+                            </ul>
+                        </div>
+                    </td>
 				</tr>
 				<tr>
-					<td>
+					<td colspan="2">
 						<input type="hidden" id="keysPrivateSelectedPagesAndContent">							
 						</input>
 					</td>
-				</tr>			
+				</tr>
 				
 				<!-- **************** -->
 				<tr>
-					<td style="padding-top: 10px; text-align:center;">
+					<td colspan="2" style="padding-top: 10px; text-align:center;">
 						<button onclick="parent.Plugin_Tags_Assign_Pages.ok(); return false" style="width: 80px">
 							<i18n:text i18n:key="PLUGINS_TAGS_DIALOG_OK" i18n:catalogue="plugin.{$pluginName}"/>
 						</button>
@@ -56,41 +93,75 @@
 				</tr>
 			</table>
 			
-			<table id="Plugin_Tags_Assign_Pages" style="display: none; width: 300px; height:365px; margin-top: 5px; margin-left: 10px; margin-right: 10px;">
-				<tr>
-					<td style="padding-top: 5px; padding-left: 10px; padding-right: 10px;">
-						<div style="border: 1px solid black; padding: 5px;">
-						<i18n:text i18n:key="EXPLANATIONS" i18n:catalogue="plugin.{$pluginName}"/>
-						</div>
-					</td>
-				</tr>
-				<tr>
-					<td style="padding-top: 10px; padding-left: 10px" height="290px">
-						<select id="tag" name="tag" multiple="multiple" height="290px" style="width: 300px; height: 290;">
-							<xsl:for-each select="Model/categories/category">
-								<xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and count(tag[@target = 'page' and @type='Publique']) != 0) or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and count(tag[@target = 'page' and @type='Privée']) != 0)">
-									<optgroup label="{@name}">
-										<xsl:for-each select="tag">
-											<xsl:if test="@target = 'page' and ((/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and @type = 'Publique') or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and @type = 'Privée'))">
-											<option value="{@key}" style="width: 300px;"><xsl:value-of select="@name"/></option>
-											</xsl:if>											
-										</xsl:for-each>
-									</optgroup>
-								</xsl:if>
-							</xsl:for-each>
-						</select>
-					</td>
+			<table id="Plugin_Tags_Assign_Pages" class="assign-tags" style="display: none; width: 600px; height:365px; margin-top: 5px; margin-left: 10px; margin-right: 10px;">
+                <tr>
+                    <td style="padding: 10px 10px 0px 10px">
+                        <span><i18n:text i18n:key="PLUGINS_TAGS_DIALOG_AVAILABLE_TAGS" i18n:catalogue="plugin.{$pluginName}"/></span>
+                        <span id="fold-options">
+                            <xsl:text> (</xsl:text>
+                            <a class="fold-option" href="#" title="Ouvrir toutes les catégories" onclick="parent.foldAll(false); return false;">
+                                <i18n:text i18n:key="PLUGINS_TAGS_DIALOG_OPEN_ALL" i18n:catalogue="plugin.{$pluginName}"/>
+                            </a>
+                            <xsl:text> | </xsl:text>
+                            <a class="fold-option" href="#" title="Replier toutes les catégories" onclick="parent.foldAll(true); return false;">
+                                <i18n:text i18n:key="PLUGINS_TAGS_DIALOG_CLOSE_ALL" i18n:catalogue="plugin.{$pluginName}"/>
+                            </a>
+                            <xsl:text>)</xsl:text>
+                        </span>
+                    </td>
+                    <td style="padding: 10px 10px 0px 10px">
+                        <span><i18n:text i18n:key="PLUGINS_TAGS_DIALOG_ASSIGNED_TAGS" i18n:catalogue="plugin.{$pluginName}"/></span>
+                    </td>
+                </tr>           
+				<tr>
+                    <td style="padding-top: 10px; padding-left: 10px; margin:0px; width:300px; height:350px; vertical-align:top">
+                        <div id="Plugin_Tags_Assign_Pages_tree" style="width: 300px; height: 350px; border:solid 1px black; display:none;">
+                            <ul>
+                                <xsl:for-each select="Model/categories/category">
+                                    <xsl:if test="(/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and count(tag[@target = 'page' and @type='Publique']) != 0) or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and count(tag[@target = 'page' and @type='Privée']) != 0)">
+                                        <li>
+                                            <xsl:attribute name="class">
+                                                <xsl:choose>
+                                                    <xsl:when test="$start-folded-pages = 'true'">closed</xsl:when>
+                                                    <xsl:otherwise>opened</xsl:otherwise>
+                                                </xsl:choose>
+                                            </xsl:attribute>
+                                            <span category="{@name}" categoryId="{@id}" id="category{@id}" style="margin-left:5px"><xsl:value-of select="@name"/></span>
+                                            <ul>
+                                                <xsl:for-each select="tag">
+                                                    <xsl:if test="@target = 'page' and ((/Model/rights/CAN_ASSIGN_PUBLIC_TAGS = 'true' and @type = 'Publique') or (/Model/rights/CAN_ASSIGN_PRIVATE_TAGS = 'true' and @type = 'Privée'))">
+                                                        <li tagKey="{@key}">
+                                                            <a key="{@key}" name="{@name}" title="{@description}">
+                                                                <img class="checkbox" src="{$resourcesDir}/img/checkbox.gif"/>
+                                                                <xsl:value-of select="@name"/>
+                                                            </a>
+                                                        </li>
+                                                    </xsl:if>
+                                                </xsl:for-each>
+                                            </ul>
+                                        </li>
+                                    </xsl:if>
+                                </xsl:for-each>
+                            </ul>
+                        </div>
+                    </td>
+                    <td style="padding:10px 10px 0px 10px; margin:0px; width:300px; height:350px; vertical-align:top">
+                        <div id="selected_tags_Pages" class="summary" style="height:350px; overflow-y:scroll; border:solid 1px black;">
+                            <ul>
+                            </ul>
+                        </div>
+                    </td>
 				</tr>
 				<tr>
-					<td>
+					<td colspan="2">
 						<input type="hidden" id="keysPrivateSelected">							
 						</input>
 					</td>
-				</tr>				
+				</tr>
 				
 				<!-- **************** -->
 				<tr>
-					<td style="padding-top: 10px; text-align:center;">
+					<td colspan="2" style="padding-top: 10px; text-align:center;">
 						<button onclick="parent.Plugin_Tags_Assign_Pages.ok(); return false" style="width: 80px">
 							<i18n:text i18n:key="PLUGINS_TAGS_DIALOG_OK" i18n:catalogue="plugin.{$pluginName}"/>
 						</button>
Index: plugins/optional/tags_web/resources/css/assign.css
===================================================================
RCS file: plugins/optional/tags_web/resources/css/assign.css
diff -N plugins/optional/tags_web/resources/css/assign.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugins/optional/tags_web/resources/css/assign.css	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,47 @@
+#selected_tags_Pages ul, #selected_tags_Pages_And_Content ul {
+	list-style-type: none;
+    margin-left: -25px;
+	/margin-top: 10px;
+    /margin-left: 10px;
+}
+
+#selected_tags_Pages ul li, #selected_tags_Pages_And_Content ul li {
+    font-weight: bold;
+    margin-bottom: 4px;
+}
+
+#selected_tags_Pages ul ul, #selected_tags_Pages_And_Content ul ul {
+    list-style-type: none;
+    margin-left: -20px;
+    /margin-top: 0px;
+    /margin-left: 20px;
+}
+
+#selected_tags_Pages ul ul li, #selected_tags_Pages_And_Content ul ul li {
+    margin-bottom: 0px;
+}
+
+#selected_tags_Pages a, #selected_tags_Pages_And_Content a {
+    color: #215DC6;
+    font-weight: normal;
+    text-decoration: none;
+}
+
+#selected_tags_Pages a:hover, #selected_tags_Pages_And_Content a:hover {
+    color: #669EFB;
+    text-decoration: underline;
+}
+
+#fold-options a.fold-option {
+    color: #215DC6;
+    text-decoration: none;
+}
+
+#fold-options a.fold-option:hover {
+    color: #669EFB;
+    text-decoration: underline;
+}
+
+#Plugin_Tags_Assign_Pages_tree li a, #Plugin_Tags_Assign_Pages_And_Content_tree li a {
+    /padding: 0px;
+}
