Esempio n. 1
0
 def siteTree(self):
     """Cookie tree with only folders and the nearest site as root
     node.
     """
     parent = self.context
     for parent in zapi.getParents(self.context):
         if ISite.providedBy(parent):
             break
     return self.folderTree(parent)
Esempio n. 2
0
 def getId(self):
     context = self.context
     if not context.__name__:
         # always try to be unique
         return str(id(context))
     parents = [context.__name__]
     parents += [parent.__name__ for parent in zapi.getParents(context)
                 if parent.__name__]
     return '\\'.join(parents)
Esempio n. 3
0
 def crumbs(self):
     try:
         myobjects = [self.context] + list(zapi.getParents(self.context))
     except Exception:
         myobjects = []
     myobjects.reverse()
     for myobject in myobjects:
         info = zapi.getMultiAdapter((myobject, self.request),
                                     IBreadcrumbInfo)
         if info.name == u'++etc++site':
             pass
         elif info.name == u'default':
             pass
         else:
             yield {
                 'name': info.name,
                 'url': info.url,
                 'active': info.active
             }