[z3-checkins] r7551 - z3/CMFonFive/branch/regebro-action_menus

regebro at codespeak.net regebro at codespeak.net
Mon Nov 22 12:32:13 MET 2004


Author: regebro
Date: Mon Nov 22 12:32:12 2004
New Revision: 7551

Added:
   z3/CMFonFive/branch/regebro-action_menus/fiveactionstool.py   (contents, props changed)
   z3/CMFonFive/branch/regebro-action_menus/metadirectives.py   (contents, props changed)
Modified:
   z3/CMFonFive/branch/regebro-action_menus/__init__.py
   z3/CMFonFive/branch/regebro-action_menus/interfaces.py
Log:
Temporary commit, not in a useful state yet

Modified: z3/CMFonFive/branch/regebro-action_menus/__init__.py
==============================================================================
--- z3/CMFonFive/branch/regebro-action_menus/__init__.py	(original)
+++ z3/CMFonFive/branch/regebro-action_menus/__init__.py	Mon Nov 22 12:32:12 2004
@@ -2,7 +2,13 @@
 
 $Id$
 """
+from Products.CMFCore.utils import ToolInit
+import fiveactionstool
 
 def initialize(context):
 
-    pass
+    ToolInit( 'Five Tools'
+            , tools=(fiveactionstool.FiveActionsTool,)
+            , product_name='CMFonFive'
+            , icon='tool.gif'
+            ).initialize( context )

Added: z3/CMFonFive/branch/regebro-action_menus/fiveactionstool.py
==============================================================================
--- (empty file)
+++ z3/CMFonFive/branch/regebro-action_menus/fiveactionstool.py	Mon Nov 22 12:32:12 2004
@@ -0,0 +1,51 @@
+""" Basic portal discussion access tool.
+
+$Id: DiscussionTool.py,v 1.21 2004/08/12 15:07:40 jens Exp $
+"""
+
+from AccessControl import ClassSecurityInfo
+from Acquisition import aq_base
+from Globals import InitializeClass
+from OFS.SimpleItem import SimpleItem
+
+from Products.CMFCore.ActionInformation import ActionInformation
+from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.Expression import Expression
+from Products.CMFCore.utils import UniqueObject
+
+from Products.Five.globalbrowsermenuservice import \
+     globalBrowserMenuService
+
+    
+class FiveActionsTool( UniqueObject, SimpleItem, ActionProviderBase ):
+    """ Links content to discussions.
+    """
+
+    __implements__ = (ActionProviderBase.__implements__)
+
+    id = 'portal_fiveactions'
+    meta_type = 'Five Actions Tool'
+
+    security = ClassSecurityInfo()
+
+    def getReqestURL(self):
+        return self.REQUEST.URL
+    
+    security.declarePrivate('listActions')
+    def listActions(self, info=None, object=None):
+        """ List all the actions defined by a provider.
+        """
+        self.REQUEST.getURL = self.getReqestURL
+        menu = globalBrowserMenuService.getMenu(u'actionmenu', object, self.REQUEST)
+        actions = []
+        for entry in menu:
+            act = {}
+            act['category'] = 'folder'
+            act['url'] = str(entry['action'])
+            act['name'] = 'action_%s%s' % (object.getId(), act['url'])
+            act['title'] = str(entry['title'])
+            actions.append(act)
+        return actions or ()
+
+
+InitializeClass( FiveActionsTool )

Modified: z3/CMFonFive/branch/regebro-action_menus/interfaces.py
==============================================================================
--- z3/CMFonFive/branch/regebro-action_menus/interfaces.py	(original)
+++ z3/CMFonFive/branch/regebro-action_menus/interfaces.py	Mon Nov 22 12:32:12 2004
@@ -75,3 +75,12 @@
         edit began.
         """
 
+from zope.app.publisher.browser.interfaces.browser import IBrowserMenu
+
+class IActionMenu(IBrowserMenu):
+
+    category = TextLine(
+        title=_("Category"),
+        description=_("The action category of this action menu"),
+        required=True)
+

Added: z3/CMFonFive/branch/regebro-action_menus/metadirectives.py
==============================================================================
--- (empty file)
+++ z3/CMFonFive/branch/regebro-action_menus/metadirectives.py	Mon Nov 22 12:32:12 2004
@@ -0,0 +1,4 @@
+""" Meta directives from CMFonFive
+
+"""
+from Products.Five.


More information about the z3-checkins mailing list