## Script (Python) "getFacultiesInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student=None ##title= ## # $Id:getFacultiesInfo.py 486 2006-09-06 10:09:39Z joachim $ """ return Info about the Faculties """ request = context.REQUEST wf = context.portal_workflow mtool = context.portal_membership path_info = request.get('PATH_INFO').split('/') info = {} info['is_manager'] = context.isManager() info['is_student'] = context.isStudent() info['action'] = "%s" % context.campus.absolute_url() info['choosen_ids'] = request.get('ids',[]) items = [] facs = context.portal_catalog(portal_type='Faculty') for f in facs: row = {} fo = f.getObject() fd = fo.getContent() row['id'] = fo.getId() row['title'] = fd.LongTitle() row['url'] = fo.absolute_url() row['is_editable'] = mtool.checkPermission('Modify portal content', fo) items.append(row) info['items'] = items return info