當前位置: 首頁>>代碼示例>>Python>>正文


Python SitemapNavtreeStrategy.__init__方法代碼示例

本文整理匯總了Python中Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python SitemapNavtreeStrategy.__init__方法的具體用法?Python SitemapNavtreeStrategy.__init__怎麽用?Python SitemapNavtreeStrategy.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy的用法示例。


在下文中一共展示了SitemapNavtreeStrategy.__init__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
 def __init__(self, context, portlet):
     SitemapNavtreeStrategy.__init__(self, context, portlet)
     self.bottomLevel = 0
     currentFolderOnly = True
     topLevel = 0
     root = getattr(portlet, 'root', uuidToObject(portlet.root_uid))
     self.rootPath = getRootPath(context, currentFolderOnly, topLevel, root)
開發者ID:collective,項目名稱:Solgema.NavigationPortlet,代碼行數:9,代碼來源:navigation.py

示例2: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
    def __init__(self, context, portlet):
        SitemapNavtreeStrategy.__init__(self, context, portlet)

        # XXX: We can't do this with a 'depth' query to EPI...
        self.bottomLevel = portlet.bottomLevel or 0

        self.rootPath = getRootPath(context,
                                    portlet.currentFolderOnly,
                                    portlet.topLevel,
                                    portlet.root_uid)
開發者ID:SyZn,項目名稱:plone.app.portlets,代碼行數:12,代碼來源:navigation.py

示例3: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
    def __init__(self, context, portlet):
        SitemapNavtreeStrategy.__init__(self, context, portlet)
        portal_properties = getToolByName(context, 'portal_properties')
        navtree_properties = getattr(portal_properties, 'navtree_properties')
        
        # XXX: We can't do this with a 'depth' query to EPI...
        self.bottomLevel = portlet.bottomLevel or navtree_properties.getProperty('bottomLevel', 0)

        currentFolderOnly = portlet.currentFolderOnly or navtree_properties.getProperty('currentFolderOnlyInNavtree', False)
        topLevel = portlet.topLevel or navtree_properties.getProperty('topLevel', 0)
        self.rootPath = getRootPath(context, currentFolderOnly, topLevel, portlet.root)
開發者ID:uwosh,項目名稱:uwosh.portlet.expandingnav,代碼行數:13,代碼來源:expandingnavigation.py

示例4: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
    def __init__(self, context, tile):
        SitemapNavtreeStrategy.__init__(self, context, tile)
        portal_properties = getToolByName(context, 'portal_properties')
        navtree_properties = getattr(portal_properties, 'navtree_properties')

        # XXX: We can't do this with a 'depth' query to EPI...
        self.bottomLevel = tile.data.get('bottomLevel') or \
                           navtree_properties.getProperty('bottomLevel', 0)

        currentFolderOnly = tile.data.get('currentFolderOnly') or \
                            navtree_properties.getProperty(
                                    'currentFolderOnlyInNavtree', False)
        topLevel = tile.data.get('topLevel') or \
                   navtree_properties.getProperty('topLevel', 0)
        tileRoot = uuidToFolderishPath(context, tile.data.get('root'))
        self.rootPath = getRootPath(context, currentFolderOnly,
                                    topLevel, tileRoot)
開發者ID:hatchddigital,項目名稱:plone.app.standardtiles,代碼行數:19,代碼來源:navigation.py

示例5: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
    def __init__(self, context, portlet):
        
        SitemapNavtreeStrategy.__init__(self, context, portlet)
        portal_properties = getToolByName(context, 'portal_properties')
        navtree_properties = getattr(portal_properties, 'navtree_properties')

        # XXX: We can't do this with a 'depth' query to EPI...
        self.bottomLevel = portlet.bottomLevel or navtree_properties.getProperty('bottomLevel', 0)

        currentFolderOnly = portlet.currentFolderOnly or navtree_properties.getProperty('currentFolderOnlyInNavtree', False)
        topLevel = portlet.topLevel or navtree_properties.getProperty('topLevel', 0)
        #custom implementation starts here
        currentObject = self.context
        parentList = currentObject.aq_chain
        parentspace = None
        found = 0

        try:
            for type in parentList:
                if type.portal_type == 'Space' and type.meta_type == 'Space':
                    parentspace = type
                    found = 1
                if found == 1:
                    break
        except AttributeError:
                pass

        rootObject = self.context.portal_url.getPortalObject()

        objNavtree = 1

        isMemberFolder = False
        members = rootObject.Members
        if parentspace is None:
            if members in parentList:
                isMemberFolder = True
        
        if parentspace <> None:
            self.rootPath = '/'.join(parentspace.getPhysicalPath())                
        else:
            topLevel = portlet.topLevel or navtree_properties.getProperty('topLevel', 0)
            self.rootPath = getRootPath(context, currentFolderOnly, topLevel, portlet.root)
開發者ID:Cenditel,項目名稱:cenditel.comunidades.cynin,代碼行數:44,代碼來源:navigation.py

示例6: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
    def __init__(self, context, portlet):
        SitemapNavtreeStrategy.__init__(self, context, portlet)
        portal_properties = getToolByName(context, 'portal_properties')
        navtree_properties = getattr(portal_properties, 'navtree_properties')
        portal_languages = getToolByName(context, 'portal_languages')

        # XXX: We can't do this with a 'depth' query to EPI...
        self.bottomLevel = portlet.bottomLevel or navtree_properties.getProperty('bottomLevel', 0)

        currentFolderOnly = portlet.currentFolderOnly or navtree_properties.getProperty('currentFolderOnlyInNavtree', False)
        topLevel = portlet.topLevel or navtree_properties.getProperty('topLevel', 0)
        #self.rootPath = getRootPath(context, currentFolderOnly, topLevel, portlet.root)
        #self.rootPath = "%s/%s" % ( getRootPath(context, currentFolderOnly, topLevel, portlet.root), portal_languages.getPreferredLanguage())
        portal_url = getToolByName(context, 'portal_url')
        portal_root = portal_url.getPortalPath()

        self.rootPath = "%s/%s" % ( portal_root, portal_languages.getPreferredLanguage())
        if "//" in self.rootPath:
            self.rootPath = self.rootPath.replace("//","/")
        self.showAllParents = False
開發者ID:EU-OSHA,項目名稱:osha.theme,代碼行數:22,代碼來源:adapter.py

示例7: __init__

# 需要導入模塊: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 別名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import __init__ [as 別名]
 def __init__(self, context, view=None):
     SitemapNavtreeStrategy.__init__(self, context, view)
     self.rootPath = '/'.join(context.getPhysicalPath())
     self.bottomLevel = 65535
開發者ID:Tamosauskas,項目名稱:Products.CMFContentPanels,代碼行數:6,代碼來源:subnavtree.py


注:本文中的Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。