source: WAeUP_SRP/trunk/skins/waeup_default/getFolderObjectsInfo.py @ 9030

Last change on this file since 9030 was 3473, checked in by joachim, 17 years ago

remove Title from all StudentObjects?,
adjust templates to use getStudentObjectitles,
remove waeup_academics.getDocumentInfo (was duplicate),
do not use portal_catalog for listing faculties and departments.

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1## Script (Python) "getFolderObjectsInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None
8##title=
9##
10# $Id:getFolderObjectsInfo.py 486 2006-09-06 10:09:39Z joachim $
11"""
12return Info about the FolderObjects
13"""
14request = context.REQUEST
15
16wf = context.portal_workflow
17mtool = context.portal_membership
18#path_info = request.get('PATH_INFO').split('/')
19
20info = context.waeup_tool.getAccessInfo(context)
21info['action'] = "%s" % context.absolute_url()
22info['choosen_ids'] = request.get('ids',[])
23info['doc'] = context.getContent()
24items = []
25for id, object in context.objectItems():
26    row = {}
27    row['id'] = id
28    content = object.getContent()
29    row['title'] = getattr(content,'LongTitle',None) or content.Title
30    row['url'] = object.absolute_url()
31    row['is_editable'] = mtool.checkPermission('Modify portal content', object)
32    items.append(row)
33items.sort(cmp=lambda x,y: cmp(x['id'].lower(), y['id'].lower()))
34info['items'] = items
35return info
Note: See TracBrowser for help on using the repository browser.