Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
plone.app.contentmenu.menu.WorkflowSubMenuItem Class Reference
Inheritance diagram for plone.app.contentmenu.menu.WorkflowSubMenuItem:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentmenu.menu.WorkflowSubMenuItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def extra
def description
def action
def available
def selected

Public Attributes

 tools
 context
 context_state

Static Public Attributes

string MANAGE_SETTINGS_PERMISSION = 'Manage portal'
tuple title = _(u'label_state', default=u'State:')
string submenuId = 'plone_contentmenu_workflow'
int order = 40

Private Member Functions

def _manageSettings
def _transitions
def _currentStateTitle

Detailed Description

Definition at line 560 of file menu.py.


Constructor & Destructor Documentation

def plone.app.contentmenu.menu.WorkflowSubMenuItem.__init__ (   self,
  context,
  request 
)

Definition at line 569 of file menu.py.

00569 
00570     def __init__(self, context, request):
00571         BrowserSubMenuItem.__init__(self, context, request)
00572         self.tools = getMultiAdapter((context, request), name='plone_tools')
00573         self.context = context
00574         self.context_state = getMultiAdapter((context, request), name='plone_context_state')

Here is the caller graph for this function:


Member Function Documentation

Definition at line 615 of file menu.py.

00615 
00616     def _currentStateTitle(self):
00617         state = self.context_state.workflow_state()
00618         workflows = self.tools.workflow().getWorkflowsFor(self.context)
00619         if workflows:
00620             for w in workflows:
00621                 if w.states.has_key(state):
00622                     return w.states[state].title or state
00623 

Here is the caller graph for this function:

Definition at line 606 of file menu.py.

00606 
00607     def _manageSettings(self):
00608         return self.tools.membership().checkPermission(WorkflowSubMenuItem.MANAGE_SETTINGS_PERMISSION, self.context)

Here is the caller graph for this function:

Definition at line 610 of file menu.py.

00610 
00611     def _transitions(self):
00612         wf_tool = getToolByName(aq_inner(self.context), 'portal_workflow')
00613         return wf_tool.listActionInfos(object=aq_inner(self.context), max=1)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 592 of file menu.py.

00592 
00593     def action(self):
00594         if self._manageSettings() or len(self._transitions()) > 0:
00595             return self.context.absolute_url() + '/content_status_history'
00596         else:
00597             return ''

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 599 of file menu.py.

00599 
00600     def available(self):
00601         return (self.context_state.workflow_state() is not None)

Here is the caller graph for this function:

Definition at line 585 of file menu.py.

00585 
00586     def description(self):
00587         if self._manageSettings() or len(self._transitions()) > 0:
00588             return _(u'title_change_state_of_item', default=u'Change the state of this item')
00589         else:
00590             return u''

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 576 of file menu.py.

00576 
00577     def extra(self):
00578         state = self.context_state.workflow_state()
00579         stateTitle = self._currentStateTitle()
00580         return {'id'         : 'plone-contentmenu-workflow',
00581                 'class'      : 'state-%s' % state,
00582                 'state'      : state,
00583                 'stateTitle' : stateTitle,}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 602 of file menu.py.

00602 
00603     def selected(self):
00604         return False


Member Data Documentation

Definition at line 572 of file menu.py.

Definition at line 573 of file menu.py.

Definition at line 563 of file menu.py.

Definition at line 567 of file menu.py.

string plone.app.contentmenu.menu.WorkflowSubMenuItem.submenuId = 'plone_contentmenu_workflow' [static]

Definition at line 566 of file menu.py.

tuple plone.app.contentmenu.menu.WorkflowSubMenuItem.title = _(u'label_state', default=u'State:') [static]

Definition at line 565 of file menu.py.

Definition at line 571 of file menu.py.


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