root/qPloneDropDownMenu/trunk/setuphandlers.py

Revision 1411 (checked in by piv, 2 months ago)

now this product is compatible with plone 3

  • Property svn:eol-style set to native
Line 
1 from Products.CMFCore.utils import getToolByName
2
3 from utils import updateMenu
4 from config import PROPERTY_SHEET, PROPERTY_FIELD
5
6 def installMenu(context):
7
8     if context.readDataFile('qplonedropdownmenu_various.txt') is None:
9         return
10
11     site = context.getSite()
12     portal_props = getToolByName(site, 'portal_properties')
13
14     # skip adding property if it already exists
15     prop_sheet = getattr(portal_props.aq_base, PROPERTY_SHEET, None)
16     if prop_sheet is not None:
17         prop_field = getattr(prop_sheet.aq_base, PROPERTY_FIELD, None)
18         if prop_field is not None:
19             return
20
21     updateMenu(site)
Note: See TracBrowser for help on using the browser.