source: WAeUP_SRP/base/skins/cps_custom/getCreatableItems.py @ 2600

Last change on this file since 2600 was 2217, checked in by Henrik Bettermann, 17 years ago

move content from waeup_custom to cps_custom

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.