-##parameters=filter=''
+##parameters=root_name='',expansion='',filter=''
from ZTUtils import SimpleTreeMaker
stm = SimpleTreeMaker()
def replaceXMLEntities(text) :
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 '<xml>'
-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) :
print '</xml>'
-
+context.REQUEST.RESPONSE.setCookie('%s-state' % root_name, expansion, path='/')
return printed
\ No newline at end of file