Back to index

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

List of all members.

Public Member Functions

def getDiscussionFor
def isDiscussionAllowedFor
def listActions

Static Public Attributes

string id = 'portal_discussion'
string meta_type = 'Oldstyle CMF Discussion Tool'
tuple security = ClassSecurityInfo()
tuple manage_options
tuple manage_overview = DTMLFile( 'explainDiscussionTool', _dtmldir )

Static Private Attributes

tuple __implements__

Detailed Description

Definition at line 121 of file DiscussionTool.py.


Member Function Documentation

Gets the PortalDiscussion object that applies to content.

Definition at line 147 of file DiscussionTool.py.

00147 
00148     def getDiscussionFor(self, content):
00149         '''Gets the PortalDiscussion object that applies to content.
00150         '''
00151         return OldDiscussable( content ).__of__( content )

Here is the caller graph for this function:

    Returns a boolean indicating whether a discussion is
    allowed for the specified content.

Definition at line 153 of file DiscussionTool.py.

00153 
00154     def isDiscussionAllowedFor(self, content):
00155         '''
00156             Returns a boolean indicating whether a discussion is
00157             allowed for the specified content.
00158         '''
00159         if hasattr( content, 'allow_discussion' ):
00160             return content.allow_discussion
00161         typeInfo = content.getTypeInfo()
00162         if typeInfo:
00163             return typeInfo.allowDiscussion()
00164         return 0

Here is the caller graph for this function:

def CMFCore.DiscussionTool.DiscussionTool.listActions (   self,
  info = None,
  object = None 
)

Definition at line 166 of file DiscussionTool.py.

00166 
00167     def listActions(self, info=None, object=None):
00168         # Return actions for reply and show replies
00169         if object is not None or info is None:
00170             info = self._getOAI(object)
00171         content = info.object
00172         if content is None or not self.isDiscussionAllowedFor(content):
00173             return ()
00174 
00175         discussion = self.getDiscussionFor(content)
00176         if discussion.aq_base == content.aq_base:
00177             discussion_url = info.object_url
00178         else:
00179             discussion_url = discussion.absolute_url()
00180 
00181         actions = (
00182             {'name': 'Reply',
00183              'url': discussion_url + '/discussion_reply_form',
00184              'permissions': [ReplyToItem],
00185              'category': 'object'
00186              },
00187             )
00188 
00189         return actions
00190 
00191 InitializeClass(DiscussionTool)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
(z2IOldstyleDiscussionTool,
                      ActionProviderBase.__implements__)

Definition at line 124 of file DiscussionTool.py.

string CMFCore.DiscussionTool.DiscussionTool.id = 'portal_discussion' [static]

Definition at line 127 of file DiscussionTool.py.

Initial value:
( { 'label' : 'Overview', 'action' : 'manage_overview' }
                     ,
                     )

Definition at line 133 of file DiscussionTool.py.

tuple CMFCore.DiscussionTool.DiscussionTool.manage_overview = DTMLFile( 'explainDiscussionTool', _dtmldir ) [static]

Definition at line 141 of file DiscussionTool.py.

string CMFCore.DiscussionTool.DiscussionTool.meta_type = 'Oldstyle CMF Discussion Tool' [static]

Definition at line 128 of file DiscussionTool.py.

tuple CMFCore.DiscussionTool.DiscussionTool.security = ClassSecurityInfo() [static]

Definition at line 131 of file DiscussionTool.py.


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