Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
CMFCore.fiveactionstool.FiveActionsTool Class Reference
Inheritance diagram for CMFCore.fiveactionstool.FiveActionsTool:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.fiveactionstool.FiveActionsTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getReqestURL
def listActions

Static Public Attributes

string id = 'portal_fiveactions'
string meta_type = 'Five Actions Tool'
tuple security = ClassSecurityInfo()

Static Private Attributes

tuple __implements__ = (ActionProviderBase.__implements__)

Detailed Description

Links content to discussions.

Definition at line 34 of file fiveactionstool.py.


Member Function Documentation

Definition at line 46 of file fiveactionstool.py.

00046 
00047     def getReqestURL(self):
00048         return self.REQUEST.URL

def CMFCore.fiveactionstool.FiveActionsTool.listActions (   self,
  info = None,
  object = None 
)
List all the actions defined by a provider.

Definition at line 50 of file fiveactionstool.py.

00050 
00051     def listActions(self, info=None, object=None):
00052         """ List all the actions defined by a provider.
00053         """
00054         if object is None:
00055             if  info is None:
00056                 # There is no support for global actions
00057                 return ()
00058             else:
00059                 object = info.content
00060 
00061         actions = []
00062         for menu_id in _listMenuIds():
00063             for entry in getMenu(menu_id, object, self.REQUEST):
00064                 # The action needs a unique name, so I'll build one
00065                 # from the object_id and the action url. That is sure
00066                 # to be unique.
00067                 action = str(entry['action'])
00068                 if object is None:
00069                     act_id = 'action_%s' % action
00070                 else:
00071                     act_id = 'action_%s_%s' % (object.getId(), action)
00072 
00073                 if entry.get('filter') is None:
00074                     filter = None
00075                 else:
00076                     filter = Expression(text=str(entry['filter']))
00077 
00078                 title = entry['title']
00079                 # Having bits of unicode here can make rendering very confused,
00080                 # so we convert it to plain strings, but NOT if it is a 
00081                 # messageID. In Zope 3.2 there are two types of messages,
00082                 # Message and MessageID, where MessageID is depracated. We can 
00083                 # type-check for both but that provokes a deprecation warning, 
00084                 # so we check for the "domain" attribute instead. 
00085                 if not hasattr(title, 'domain'):
00086                     title = str(title)
00087                 act = ActionInformation(id=act_id,
00088                     title=title,
00089                     action=Expression(text='string:%s' % action),
00090                     condition=filter,
00091                     category=str(menu_id),
00092                     visible=1)
00093                 actions.append(act)
00094 
00095         return tuple(actions)
00096 
00097 InitializeClass( FiveActionsTool )

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tuple CMFCore.fiveactionstool.FiveActionsTool.__implements__ = (ActionProviderBase.__implements__) [static, private]

Definition at line 39 of file fiveactionstool.py.

string CMFCore.fiveactionstool.FiveActionsTool.id = 'portal_fiveactions' [static]

Definition at line 41 of file fiveactionstool.py.

string CMFCore.fiveactionstool.FiveActionsTool.meta_type = 'Five Actions Tool' [static]

Definition at line 42 of file fiveactionstool.py.

tuple CMFCore.fiveactionstool.FiveActionsTool.security = ClassSecurityInfo() [static]

Definition at line 44 of file fiveactionstool.py.


The documentation for this class was generated from the following file: