[CMF-checkins] CVS: CMF/CMFDefault - MembershipTool.py:1.17.12.2 PropertiesTool.py:1.5.12.1 RegistrationTool.py:1.8.8.2
Andrew Sawyers
andrew@zope.com
Wed, 2 Jan 2002 19:13:56 -0500
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv1238/CMFDefault
Modified Files:
Tag: andrew_ttw_actions-branch
MembershipTool.py PropertiesTool.py RegistrationTool.py
Log Message:
*Cleanup of changeActions in ActionProviderbase
*Removed tools from action_providers which do not have any
default actions
*Moved Join action to Registration Tool
*Moved Reconfigure Portal to ProtertiesTool
=== CMF/CMFDefault/MembershipTool.py 1.17.12.1 => 1.17.12.2 ===
"""
"""
- _actions =[ActionInformation(id='join'
- , title='Join'
- , description='Click here to Join'
- , action=Expression(
- text='string: ${portal_url}/join_form')
- , permissions=(View,)
- , category='user'
- , condition=Expression(text='not: member')
- , visible=1
- )
- , ActionInformation(id='login'
+ _actions =[ActionInformation(id='login'
, title='Login'
, description='Click here to Login'
, action=Expression(
@@ -83,16 +73,6 @@
, permissions=(View,)
, category='user'
, condition=Expression(text='member')
- , visible=1
- )
- , ActionInformation(id='configPortal'
- , title='Reconfigure Portal'
- , description='Reconfigure the portal'
- , action=Expression(
- text='string: ${portal_url}/reconfig_form')
- , permissions=(ManagePortal,)
- , category='global'
- , condition=None
, visible=1
)
, ActionInformation(id='addFavorite'
=== CMF/CMFDefault/PropertiesTool.py 1.5 => 1.5.12.1 ===
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 PropertiesTool (UniqueObject, SimpleItem):
+class PropertiesTool(UniqueObject, SimpleItem, ActionProviderBase):
id = 'portal_properties'
meta_type = 'Default Properties Tool'
+ _actions = [ActionInformation(id='configPortal'
+ , title='Reconfigure Portal'
+ , description='Reconfigure the portal'
+ , action=Expression(
+ text='string: ${portal_url}/reconfig_form')
+ , permissions=(CMFCorePermissions.ManagePortal,)
+ , category='global'
+ , condition=None
+ , visible=1
+ )]
security = ClassSecurityInfo()
- manage_options = ( { 'label' : 'Overview', 'action' : 'manage_overview' }
+ manage_options = ( ActionProviderBase.manage_options +
+ ({ 'label' : 'Overview', 'action' : 'manage_overview' }
,
) + SimpleItem.manage_options
+ )
#
# ZMI methods
@@ -48,6 +63,13 @@
#
# 'portal_properties' interface methods
#
+ security.declarePrivate('listActions')
+ def listActions(self, info=None):
+ """
+ Return actions provided by tool.
+ """
+ return self._actions
+
security.declareProtected( CMFCorePermissions.ManagePortal
, 'editProperties' )
def editProperties(self, props):
=== CMF/CMFDefault/RegistrationTool.py 1.8.8.1 => 1.8.8.2 ===
from Products.CMFCore.utils import UniqueObject
from Products.CMFCore.utils import _checkPermission, getToolByName
+from Products.CMFCore.ActionInformation import ActionInformation
+from Products.CMFCore.Expression import Expression
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.RegistrationTool import RegistrationTool
@@ -31,7 +33,16 @@
class RegistrationTool (RegistrationTool, ActionProviderBase):
meta_type = 'Default Registration Tool'
- _actions = []
+ _actions = [ActionInformation(id='join'
+ , title='Join'
+ , description='Click here to Join'
+ , action=Expression(
+ text='string: ${portal_url}/join_form')
+ , permissions=(CMFCorePermissions.View,)
+ , category='user'
+ , condition=Expression(text='not: member')
+ , visible=1
+ )]
security = ClassSecurityInfo()