[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.19 PortalFolder.py:1.28

Andrew Sawyers andrew@zope.com
Mon, 10 Dec 2001 15:19:58 -0500


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

Modified Files:
	ActionsTool.py PortalFolder.py 
Log Message:

*Due to folder_contents not playing well with index_html, we need
to have a better way to handle its display....so for now it's
been removed from PortalFolder and put back on ActionsTool
*RegistrationTool had an impartial implementation of listActions.


=== CMF/CMFCore/ActionsTool.py 1.18 => 1.19 ===
     meta_type = 'CMF Actions Tool'
 
-    action_providers = ( 'portal_memberdata'
+    action_providers = ( 'portal_actions'
+                       , 'portal_memberdata'
                        , 'portal_registration'
                        , 'portal_discussion'
                        , 'portal_membership'
@@ -112,7 +113,23 @@
 
     security.declarePrivate('listActions')
     def listActions(self, info):
-        return None
+        """
+        List actions available from this tool
+        """
+        if info.isAnonymous:
+            return None
+        else:
+            actions = []
+            folder_url = info.folder_url   
+            content_url = info.content_url   
+            if folder_url is not None: 
+                actions.append(
+                    { 'name'          : 'Folder contents'
+                    , 'url'        : folder_url + '/folder_contents'
+                    , 'permissions'   : ['List folder contents']
+                    , 'category'      : 'folder'
+                   })
+            return actions
 
     security.declareProtected( CMFCorePermissions.ManagePortal
                              , 'deleteActionProvider'


=== CMF/CMFCore/PortalFolder.py 1.27 => 1.28 ===
                                   , 'category'      : 'folder'
                                   }
-                                , { 'id'            : 'foldercontents'
-                                  , 'name'          : 'Folder contents'
-                                  , 'action'        : 'folder_contents'
-                                  , 'permissions'   : (CMFCorePermissions.ListFolderContents,)
-                                  , 'category'      : 'folder'
-                                  }
                                 )
                              }
                            ,