Déplacement pour eggification.
[Plinn.git] / Products / Plinn / skins / generic / makeGrufTree.py
diff --git a/Products/Plinn/skins/generic/makeGrufTree.py b/Products/Plinn/skins/generic/makeGrufTree.py
new file mode 100755 (executable)
index 0000000..c665ce0
--- /dev/null
@@ -0,0 +1,19 @@
+##parameters=
+aclu = context.acl_users
+groupPrefix = aclu.getGroupPrefix()
+gtool = context.portal_groups
+from ZTUtils import SimpleTreeMaker
+
+def getGroups(object) :
+       """ return children groups """
+       if object is aclu :
+               return gtool.getGroups(gtool.getRootGroups())
+       else :
+               return gtool.getGroups(gtool.getGroupsOfGroup(object.id))
+       
+stm = SimpleTreeMaker("group_tree")
+stm.setChildAccess(function = getGroups)
+stm.setIdAttr('id')
+
+tree, rows = stm.cookieTree(aclu)
+return {'tree' : tree, 'rows' : rows}
\ No newline at end of file