From: Benoît Pin Date: Wed, 24 Nov 2010 11:49:26 +0000 (+0100) Subject: Insertion du nom de l'objet encodé, avec le SimpleTreeMaker. X-Git-Url: https://svn.cri.ensmp.fr/git/MosaicDocument.git/commitdiff_plain/d3ae9b28834e7e43b84fb81b06fb5ace521855e8?ds=sidebyside;hp=545e024b40032a938384466e31a4fa637b70b01a Insertion du nom de l'objet encodé, avec le SimpleTreeMaker. --- diff --git a/default_blocks/tree_block_script.js b/default_blocks/tree_block_script.js index c057e28..228d405 100644 --- a/default_blocks/tree_block_script.js +++ b/default_blocks/tree_block_script.js @@ -157,6 +157,7 @@ TreeMaker.prototype.importRows = function(req, parentRow) { if (row.getAttribute("state") == "-1") { var stateLink = document.createElement("A"); stateLink.href = "."; + stateLink.setAttribute("name", row.getAttribute("name")); var stateImg = document.createElement("IMG"); stateImg.src = this.baseImgUrl + "pl.gif"; stateImg.border = "0"; diff --git a/skins/xml_nav_tree.py b/skins/xml_nav_tree.py index 30013fb..05967d9 100644 --- a/skins/xml_nav_tree.py +++ b/skins/xml_nav_tree.py @@ -1,5 +1,6 @@ ##parameters=filter='' - +from ZTUtils import SimpleTreeMaker +stm = SimpleTreeMaker() def replaceXMLEntities(text) : for c, ent in (('<', '<'), ('>', '>'), ('&', '&')) : text = text.replace(c, ent) @@ -18,8 +19,8 @@ for ob in context.listNearestFolderContents(contentFilter={'portal_type':filter} state = 0 if not getattr(ob, 'isPortalContent', False) : state = ob.listNearestFolderContents(contentFilter={'portal_type':filter}) and "-1" or "0" - row = '%(title)s' % { - 'id' : ob.getId(), + row = '%(title)s' % { + 'name' : stm.node(ob).id, 'url' : ob.absolute_url(), 'title' : ' '+replaceXMLEntities(ob.title_or_id()), 'description' : ob.Description().translate(rmBadAttrChars),