X-Git-Url: https://scm.cri.mines-paristech.fr/git/MosaicDocument.git/blobdiff_plain/d3ae9b28834e7e43b84fb81b06fb5ace521855e8..212fdab6c913532b7776f6c5670b2c7598e0df86:/skins/xml_nav_tree.py?ds=inline diff --git a/skins/xml_nav_tree.py b/skins/xml_nav_tree.py index 05967d9..79c069c 100644 --- a/skins/xml_nav_tree.py +++ b/skins/xml_nav_tree.py @@ -1,4 +1,4 @@ -##parameters=filter='' +##parameters=root_name='',expansion='',filter='' from ZTUtils import SimpleTreeMaker stm = SimpleTreeMaker() def replaceXMLEntities(text) : @@ -11,10 +11,12 @@ rmBadAttrChars = maketrans('<&"', ' ') filter = filter.split(',') -root = context +childs = list(context.listNearestFolderContents(contentFilter={'portal_type':filter})) +childs.sort(lambda x, y : cmp(y.title_or_id().lower(), x.title_or_id().lower())) + context.REQUEST.RESPONSE.setHeader('content-type', 'text/xml; charset=utf-8') print '' -for ob in context.listNearestFolderContents(contentFilter={'portal_type':filter}) : +for ob in childs : icon = context.restrictedTraverse(ob.getIcon()) state = 0 if not getattr(ob, 'isPortalContent', False) : @@ -33,5 +35,5 @@ for ob in context.listNearestFolderContents(contentFilter={'portal_type':filter} print '' - +context.REQUEST.RESPONSE.setCookie('%s-state' % root_name, expansion, path='/') return printed \ No newline at end of file