source: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/getCreatableItems.py @ 9819

Last change on this file since 9819 was 486, checked in by joachim, 18 years ago

svn -R propset svn:keywords "Id" .
added layout_application_/edit/create/view
and cleaned that up.

  • Property svn:keywords set to Id
File size: 670 bytes
Line 
1## Script (Python) "getCreatableItems"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10items = []
11utool = context.portal_url
12base_url = utool.getBaseUrl()
13#return context.getPortalTypeName()
14
15if context.getPortalTypeName() == 'Portal':
16    return items
17
18content_types = context.getSortedContentTypes(allowed=1)
19renderIcon = context.portal_cpsportlets.renderIcon
20
21for ptype in content_types:
22    ptype_id = ptype.getId()
23    items.append({
24        'title': ptype.Title(),
25        'id': ptype_id,
26        'icon_tag': renderIcon(ptype_id, base_url, '')
27    })
28
29return items
Note: See TracBrowser for help on using the repository browser.