[CMF-checkins] CVS: CMF/CMFDefault - URLTool.py:1.7.12.2
Andrew Sawyers
andrew@zope.com
Thu, 3 Jan 2002 10:07:54 -0500
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv19741/CMFDefault
Modified Files:
Tag: andrew_ttw_actions-branch
URLTool.py
Log Message:
*Various logic and bug fixes to ActionsTool and
ActionProviderBase
*Added TTW Action support to SkinsTool and URLTool
=== CMF/CMFDefault/URLTool.py 1.7.12.1 => 1.7.12.2 ===
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
+from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.ActionInformation import ActionInformation
+from Products.CMFCore.Expression import Expression
from Products.CMFCore import CMFCorePermissions
from utils import _dtmldir
-class URLTool (UniqueObject, SimpleItem):
+class URLTool (UniqueObject, SimpleItem, ActionProviderBase):
id = 'portal_url'
meta_type = 'Default URL Tool'
+ _actions = []
security = ClassSecurityInfo()
- manage_options = ( { 'label' : 'Overview', 'action' : 'manage_overview' }
+ manage_options = ( ActionProviderBase.manage_options +
+ ({ 'label' : 'Overview', 'action' : 'manage_overview' }
,
) + SimpleItem.manage_options
+ )
#
# ZMI methods
@@ -55,6 +61,13 @@
Returns the absolute URL of the portal.
'''
return aq_parent(aq_inner(self)).absolute_url(relative=relative)
+
+ security.declarePrivate('listActions')
+ def listActions(self, info=None):
+ """
+ Return a list of actions provided via the tool
+ """
+ return self._actions
security.declarePublic( 'getPortalObject' )
def getPortalObject( self ):