Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
CMFPlone.browser.portlets.navigation.NavigationPortlet Class Reference
Inheritance diagram for CMFPlone.browser.portlets.navigation.NavigationPortlet:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.browser.portlets.navigation.NavigationPortlet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def title
def display
def includeTop
def navigationRoot
def rootTypeName
def createNavTree
def isPortalOrDefaultChild
def getNavRoot
def getNavTree

Private Attributes

 _root
 _navtree

Detailed Description

Definition at line 15 of file navigation.py.


Member Function Documentation

Definition at line 40 of file navigation.py.

00040 
00041     def createNavTree(self):
00042         context = aq_inner(self.context)
00043         data = self.getNavTree()
00044         properties = getToolByName(context, 'portal_properties')
00045         navtree_properties = getattr(properties, 'navtree_properties')
00046         bottomLevel = navtree_properties.getProperty('bottomLevel', 0)
00047         return context.portlet_navtree_macro(
00048             children=data.get('children', []),
00049             level=1, show_children=True, isNaviTree=True, bottomLevel=bottomLevel)

Here is the call graph for this function:

Definition at line 23 of file navigation.py.

00023 
00024     def display(self):
00025         tree = self.getNavTree()
00026         root = self.getNavRoot()
00027         return (root is not None and len(tree['children']) > 0)

Here is the call graph for this function:

Get and cache the navigation root

Definition at line 59 of file navigation.py.

00059 
00060     def getNavRoot(self):
00061         """Get and cache the navigation root"""
00062         if not utils.base_hasattr(self, '_root'):
00063             context = aq_inner(self.context)
00064             portal_url = getToolByName(context, 'portal_url')
00065             portal = portal_url.getPortalObject()
00066 
00067             view = getMultiAdapter((context, self.request),
00068                                    name='navtree_builder_view')
00069             rootPath = view.navigationTreeRootPath()
00070 
00071             if rootPath == portal_url.getPortalPath():
00072                 root = portal
00073             else:
00074                 try:
00075                     root = portal.unrestrictedTraverse(rootPath)
00076                 except (AttributeError, KeyError,):
00077                     root = portal
00078 
00079             self._root = [root]
00080 
00081         return self._root[0]

Here is the call graph for this function:

Here is the caller graph for this function:

Calculate the navtree

Definition at line 82 of file navigation.py.

00082 
00083     def getNavTree(self):
00084         """Calculate the navtree"""
00085         tree = getattr(self, '_navtree', None)
00086         if tree is not None:
00087             return tree
00088         else:
00089             context = aq_inner(self.context)
00090             view = getMultiAdapter((context, self.request),
00091                                    name='navtree_builder_view')
00092             self._navtree = view.navigationTree()
00093             return self._navtree
00094 
zope.deprecation.deprecated(

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 28 of file navigation.py.

00028 
00029     def includeTop(self):
00030         context = aq_inner(self.context)
00031         portal_properties = getToolByName(context, 'portal_properties')
00032         return portal_properties.navtree_properties.includeTop

Here is the call graph for this function:

Definition at line 50 of file navigation.py.

00050 
00051     def isPortalOrDefaultChild(self):
00052         context = aq_inner(self.context)
00053         root = self.getNavRoot()
00054         return (aq_base(root) == aq_base(context) or
00055                 (aq_base(root) == aq_base(aq_parent(aq_inner(context))) and
00056                 utils.isDefaultPage(context, self.request, context)))

Here is the call graph for this function:

Definition at line 33 of file navigation.py.

00033 
00034     def navigationRoot(self):
00035         return self.getNavRoot()

Here is the call graph for this function:

Definition at line 36 of file navigation.py.

00036 
00037     def rootTypeName(self):
00038         root = self.getNavRoot()
00039         return queryUtility(IIDNormalizer).normalize(root.portal_type)

Here is the call graph for this function:

Definition at line 18 of file navigation.py.

00018 
00019     def title(self):
00020         context = aq_inner(self.context)
00021         portal_properties = getToolByName(context, 'portal_properties')
00022         return portal_properties.navtree_properties.name

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 91 of file navigation.py.

Definition at line 78 of file navigation.py.


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