Back to index

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

List of all members.

Public Member Functions

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

Public Attributes

 context_state

Static Public Attributes

tuple title = _(u'label_choose_template', default=u'Display')
string submenuId = 'plone_contentmenu_display'
int order = 20

Detailed Description

Definition at line 116 of file menu.py.


Constructor & Destructor Documentation

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

Definition at line 124 of file menu.py.

00124 
00125     def __init__(self, context, request):
00126         BrowserSubMenuItem.__init__(self, context, request)
00127         self.context_state = getMultiAdapter((context, request), name='plone_context_state')

Here is the caller graph for this function:


Member Function Documentation

Definition at line 140 of file menu.py.

00140 
00141     def action(self):
00142         if self.disabled():
00143             return ''
00144         else:
00145             if self.context_state.is_default_page():
00146                 return self.context_state.parent().absolute_url() + '/select_default_view'
00147             else:
00148                 return self.context.absolute_url() + '/select_default_view'

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file menu.py.

00150 
00151     def available(self):
00152         if self.disabled():
00153             return False
00154 
00155         isDefaultPage = self.context_state.is_default_page()
00156 
00157         folder = None
00158         context = None
00159 
00160         folderLayouts = []
00161         contextLayouts = []
00162 
00163         # If this is a default page, also get menu items relative to the parent
00164         if isDefaultPage:
00165             folder = ISelectableBrowserDefault(utils.parent(self.context), None)
00166 
00167         context = ISelectableBrowserDefault(self.context, None)
00168 
00169         folderLayouts = []
00170         folderCanSetLayout = False
00171         folderCanSetDefaultPage = False
00172 
00173         if folder is not None:
00174             folderLayouts = folder.getAvailableLayouts()
00175             folderCanSetLayout = folder.canSetLayout()
00176             folderCanSetDefaultPage = folder.canSetDefaultPage()
00177 
00178         contextLayouts = []
00179         contextCanSetLayout = False
00180         contextCanSetDefaultPage = False
00181 
00182         if context is not None:
00183             contextLayouts = context.getAvailableLayouts()
00184             contextCanSetLayout = context.canSetLayout()
00185             contextCanSetDefaultPage = context.canSetDefaultPage()
00186 
00187         # Show the menu if we either can set a default-page, or we have more
00188         # than one layout to choose from.
00189         if (folderCanSetDefaultPage) or \
00190            (folderCanSetLayout and len(folderLayouts) > 1) or \
00191            (folder is None and contextCanSetDefaultPage) or \
00192            (contextCanSetLayout and len(contextLayouts) > 1):
00193             return True
00194         else:
00195             return False

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file menu.py.

00133 
00134     def description(self):
00135         if self.disabled():
00136             return _(u'title_remove_index_html_for_display_control', default=u'Delete or rename the index_html item to gain full control over how this folder is displayed.')
00137         else:
00138             return _(u'title_choose_default_view', default=u'Select the view mode for this folder, or set a content item as its default view.')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 200 of file menu.py.

00200 
00201     def disabled(self):
00202         context = self.context
00203         if self.context_state.is_default_page():
00204             context = utils.parent(context)
00205         if not getattr(context, 'isPrincipiaFolderish', False):
00206             return False
00207         elif 'index_html' not in context.objectIds():
00208             return False
00209         else:
00210             return True
00211 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 129 of file menu.py.

00129 
00130     def extra(self):
00131         return {'id': 'plone-contentmenu-display', 'disabled': self.disabled()}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 196 of file menu.py.

00196 
00197     def selected(self):
00198         return False


Member Data Documentation

Definition at line 126 of file menu.py.

Definition at line 122 of file menu.py.

string plone.app.contentmenu.menu.DisplaySubMenuItem.submenuId = 'plone_contentmenu_display' [static]

Definition at line 120 of file menu.py.

tuple plone.app.contentmenu.menu.DisplaySubMenuItem.title = _(u'label_choose_template', default=u'Display') [static]

Definition at line 119 of file menu.py.


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