[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.10

Tres Seaver tseaver@zope.com
Mon, 8 Jul 2002 16:12:03 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv2414/CMFCore

Modified Files:
	ActionInformation.py 
Log Message:
 - Fix up older instances.

=== CMF/CMFCore/ActionInformation.py 1.9 => 1.10 ===
         info['id'] = self.id
         info['name'] = self.Title()
-        info['url'] = self.action and self.action( ec ) or ''
+        action_obj = self._getActionObject()
+        info['url'] = action_obj and action_obj( ec ) or ''
         info['permissions'] = self.getPermissions()
         info['category'] = self.getCategory()
         info['visible'] = self.getVisibility()
         return info 
 
-    security.declarePublic( 'getActionExpression' )
-    def getActionExpression( self ):
+    security.declarePrivate( '_getActionObject' )
+    def _getActionObject( self ):
 
-        """ Return the text of the TALES expression for our URL.
+        """ Find the action object, working around name changes.
         """
         action = getattr( self, 'action', None )
 
@@ -120,6 +121,14 @@
                 self.action = self._action
                 del self._action
 
+        return action
+
+    security.declarePublic( 'getActionExpression' )
+    def getActionExpression( self ):
+
+        """ Return the text of the TALES expression for our URL.
+        """
+        action = self._getActionObject()
         return action and action.text or ''
 
     security.declarePublic( 'getCondition' )