From d3ae9b28834e7e43b84fb81b06fb5ace521855e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Wed, 24 Nov 2010 12:49:26 +0100 Subject: [PATCH] =?utf8?q?Insertion=20du=20nom=20de=20l'objet=20encod?= =?utf8?q?=C3=A9,=20avec=20le=20SimpleTreeMaker.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- default_blocks/tree_block_script.js | 1 + skins/xml_nav_tree.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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), -- 2.20.1