root/qPloneDropDownMenu/trunk/DropDownMenuTool.py

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

now this product is compatible with plone 3

Line 
1 from Globals import InitializeClass
2 from OFS.SimpleItem import SimpleItem
3 from AccessControl import ClassSecurityInfo
4
5 from Products.CMFCore.utils import UniqueObject, getToolByName
6
7 from utils import updateMenu
8 from config import MANAGE_PERMISSION, PROJECT_NAME, UNIQUE_ID
9
10
11 class DropDownMenuTool(UniqueObject, SimpleItem):
12
13     meta_type = 'DropDownMenu Tool'
14     id = UNIQUE_ID
15     title="DropDown Menu Tool"
16
17     security = ClassSecurityInfo()
18
19     security.declareProtected(MANAGE_PERMISSION, 'regenerateMenu')
20     def regenerateMenu(self):
21         portal = getToolByName(self, 'portal_url').getPortalObject()
22         updateMenu(portal)
23
24 InitializeClass(DropDownMenuTool)
Note: See TracBrowser for help on using the browser.