Back to index

plone3  3.1.7
browser.py
Go to the documentation of this file.
00001 from zope.component.globalregistry import base
00002 from five.localsitemanager import make_objectmanager_site
00003 
00004 from Products.Five.component.browser import ObjectManagerSiteView
00005 
00006 
00007 class ObjectManagerSiteView(ObjectManagerSiteView):
00008     """Configure the site setup for an ObjectManager.
00009     """
00010 
00011     def makeSite(self):
00012         make_objectmanager_site(self.context)
00013 
00014     def sitemanagerTrail(self):
00015         if not self.isSite():
00016             return None
00017 
00018         sm = self.context.getSiteManager()
00019         trail = []
00020         while sm is not None and sm != base:
00021             trail.append(repr(sm))
00022             sm = sm.__bases__[0]
00023 
00024         if sm == base:
00025             trail.append('Global Registry')
00026 
00027         trail.reverse()
00028 
00029         return ' => '.join(trail)