source: main/waeup.plonetheme.ngren3/trunk/waeup/plonetheme/ngren3/setuphandlers.py @ 10827

Last change on this file since 10827 was 10084, checked in by Henrik Bettermann, 12 years ago

Fill trunk.

  • Property svn:keywords set to Id
File size: 834 bytes
Line 
1from Products.CMFCore.ActionInformation import Action
2from Products.CMFCore.utils import getToolByName
3
4
5def setupVarious(context):
6    """ Only in plonetheme.sunburst profile """
7
8    if context.readDataFile('waeup.plonetheme.ngren3_various.txt') is None:
9        return
10
11    # Do what plonetheme.sunburst does
12    # Copy the plone_setup action to the user category
13    atool = getToolByName(context.getSite(), 'portal_actions')
14    user_category = atool.user
15    if 'plone_setup' in user_category:
16        return
17
18    state = dict(atool.site_actions.plone_setup.propertyItems())
19    state['visible'] = True
20    new_action = Action('plone_setup', **state)
21    user_category['plone_setup'] = new_action
22
23    position = user_category.getObjectPosition('preferences') + 1
24    user_category.moveObjectToPosition('plone_setup', position)
Note: See TracBrowser for help on using the repository browser.