Insertion du nom de l'objet encodé, avec le SimpleTreeMaker.
[MosaicDocument.git] / skins / xml_nav_tree.py
index 30013fb..05967d9 100644 (file)
@@ -1,5 +1,6 @@
 ##parameters=filter=''
-
+from ZTUtils import SimpleTreeMaker
+stm = SimpleTreeMaker()
 def replaceXMLEntities(text) :
        for c, ent in (('<', '&lt;'), ('>', '&gt;'), ('&', '&amp;')) :
                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),