X-Git-Url: https://svn.cri.mines-paristech.fr/git/MosaicDocument.git/blobdiff_plain/545e024b40032a938384466e31a4fa637b70b01a..d3ae9b28834e7e43b84fb81b06fb5ace521855e8:/skins/xml_nav_tree.py?ds=sidebyside 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 = '<row id="%(id)s" url="%(url)s" icon="%(icon)s" height="%(height)d" width="%(width)d" state="%(state)s" description="%(description)s">%(title)s</row>' % { - 'id' : ob.getId(), + row = '<row name="%(name)s" url="%(url)s" icon="%(icon)s" height="%(height)d" width="%(width)d" state="%(state)s" description="%(description)s">%(title)s</row>' % { + 'name' : stm.node(ob).id, 'url' : ob.absolute_url(), 'title' : 'Â '+replaceXMLEntities(ob.title_or_id()), 'description' : ob.Description().translate(rmBadAttrChars),