Example #1
0
 def __init__(self, context, depth):
     NavtreeQueryBuilder.__init__(self, context)
     self.query['path'] = {
         'query': '/'.join(context.getPhysicalPath()),
         'navtree_start': 1,
         'depth': depth - 1
     }
Example #2
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     self.query['path'] = {
         'query': '/'.join(context.getPhysicalPath()),
         'navtree_start': 1,
         'depth': _get_cfg('dropdown_depth')
     }
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     self.query['path'] = {
         'query': '/'.join(context.getPhysicalPath()),
         'navtree_start': 1,
         'depth': _get_cfg('dropdown_depth')
     }
Example #4
0
 def __init__(self, context, depth):
     NavtreeQueryBuilder.__init__(self, context)
     self.query["path"] = {
         "query": "/".join(context.getPhysicalPath()),
         "navtree_start": 1,
         "depth": depth - 1,
     }
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     portal_path = context.portal_url.getPortalObject().getPhysicalPath()
     portal_len = len(portal_path)
     context_url = context.getPhysicalPath()
     self.query['path'] = {'query': '/'.join(context_url[:(portal_len + 1)]),
                           'navtree_start': 1,
                           'depth': 2}
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     dropdown_properties = getToolByName(
         context, 'portal_properties').dropdown_properties
     dropdown_depth = dropdown_properties.getProperty('dropdown_depth', 3)
     self.query['path']['depth'] = dropdown_depth
     if 'navtree' in self.query['path']:
         del self.query['path']['navtree']
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     dropdown_properties = getToolByName(
         context, 'portal_properties').dropdown_properties
     dropdown_depth = dropdown_properties.getProperty('dropdown_depth', 3)
     self.query['path'] = {'query': '/'.join(context.getPhysicalPath()),
                           'navtree_start': 1,
                           'depth': dropdown_depth}
Example #8
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     dropdown_properties = getToolByName(
         context, 'portal_properties').dropdown_properties
     dropdown_depth = dropdown_properties.getProperty('dropdown_depth', 3)
     self.query['path'] = {'query': '/'.join(context.getPhysicalPath()),
                           'navtree_start': 1,
                           'depth': dropdown_depth}
Example #9
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     #dropdown_properties = getToolByName(context,
     #                             'portal_properties').dropdown_properties
     #dropdown_depth = dropdown_properties.getProperty('dropdown_depth', 3)
     portal_path = context.portal_url.getPortalObject().getPhysicalPath()
     portal_len = len(portal_path)
     context_url = context.getPhysicalPath()
     self.query['path'] = {'query': '/'.join(context_url[:(portal_len + 1)]),
                           'navtree_start': 1,
                           'depth': 2}
Example #10
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     portal_url = getToolByName(context, 'portal_url')
     portal_properties = getToolByName(context, 'portal_properties')
     navtree_properties = getattr(portal_properties, 'navtree_properties')
     sitemapDepth = navtree_properties.getProperty('sitemapDepth', 4)
     if context.isArchive() and not context.getId() == "archive":
         sitemapDepth += 3
     self.query['path'] = {'query': context.isArchive() and not context.getId() == "archive" and "/".join(context.myELANArchive().getPhysicalPath()) or portal_url.getPortalPath(),
                           'depth': sitemapDepth}
     adaptQuery(self.query, context)
Example #11
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     portal_url = getToolByName(context, 'portal_url')
     
     portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state')
     navigation_root_path = portal_state.navigation_root_path()
     
     portal_properties = getToolByName(context, 'portal_properties')
     navtree_properties = getattr(portal_properties, 'navtree_properties')
     sitemapDepth = navtree_properties.getProperty('sitemapDepth', 2)
     self.query['path'] = {'query' : navigation_root_path,
                           'depth' : sitemapDepth}
def SitemapQueryBuilder__init__(self, context):

    NavtreeQueryBuilder.__init__(self, context)
    portal_url = getToolByName(context, 'portal_url')
    portal_properties = getToolByName(context, 'portal_properties')
    navtree_properties = getattr(portal_properties, 'navtree_properties')
    sitemapDepth = navtree_properties.getProperty('sitemapDepth', 2)

    if context.REQUEST.get('sitemap_for_current_context', False):
        self.query['path'] = {'query' : '/'.join(context.getPhysicalPath()),
                              'depth' : sitemapDepth}
    else:
        self.query['path'] = {'query' : portal_url.getPortalPath(),
                              'depth' : sitemapDepth}
Example #13
0
    def __init__(self, context):
        NavtreeQueryBuilder.__init__(self, context)
        portal_url = getToolByName(context, 'portal_url')

        portal_state = getMultiAdapter((context, context.REQUEST),
                                       name=u'plone_portal_state')
        navigation_root_path = portal_state.navigation_root_path()

        portal_properties = getToolByName(context, 'portal_properties')
        navtree_properties = getattr(portal_properties, 'navtree_properties')
        sitemapDepth = navtree_properties.getProperty('sitemapDepth', 2)
        self.query['path'] = {
            'query': navigation_root_path,
            'depth': sitemapDepth
        }
Example #14
0
def SitemapQueryBuilder__init__(self, context):

    NavtreeQueryBuilder.__init__(self, context)
    portal_url = getToolByName(context, 'portal_url')
    portal_properties = getToolByName(context, 'portal_properties')
    navtree_properties = getattr(portal_properties, 'navtree_properties')
    sitemapDepth = navtree_properties.getProperty('sitemapDepth', 2)

    if context.REQUEST.get('sitemap_for_current_context', False):
        self.query['path'] = {
            'query': '/'.join(context.getPhysicalPath()),
            'depth': sitemapDepth
        }
    else:
        self.query['path'] = {
            'query': portal_url.getPortalPath(),
            'depth': sitemapDepth
        }
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     try:
         # webcouturier.dropdownmenu version 3.x
         dropdown_depth = api.portal.get_registry_record(
             'dropdown_depth',
             interface=IDropdownConfiguration)  # noqa: E501
     except KeyError:
         # webcouturier.dropdownmenu version 2.x
         propertiesTool = api.portal.get_tool(u'portal_properties')
         dmprops = propertiesTool[u'dropdown_properties']
         if dmprops.hasProperty(u'dropdown_depth'):
             dropdown_depth = dmprops.getProperty('dropdown_depth', 3)
     self.query['path'] = {
         'query': '/'.join(context.getPhysicalPath()),
         'navtree_start': 1,
         'depth': dropdown_depth
     }
Example #16
0
    def navigationTree(self):
        context = aq_inner(self.context)

        queryBuilder = NavtreeQueryBuilder(context)
        query = queryBuilder()

        strategy = getMultiAdapter((context, self), INavtreeStrategy)

        return buildFolderTree(context, obj=context, query=query, strategy=strategy)
Example #17
0
    def navigationTree(self):
        """Returns list of dictionary of navigation tree components

        :rtype: list
        """
        context = aq_inner(self.context)
        query = NavtreeQueryBuilder(context)()
        query['path'] = {
            'query': self.navigationTreeRootPath(),
            'depth': 2,
        }
        strategy = getMultiAdapter((context, self), INavtreeStrategy)
        return buildFolderTree(context, obj=context, query=query, strategy=strategy)['children']
Example #18
0
    def getNavTree(self):
        context = aq_inner(self.context)

        queryBuilder = NavtreeQueryBuilder(context)
        query = queryBuilder()
        query['path']['query'] = self.root_path
        query['path']['depth'] = 3
        query['review_state'] = ('published_and_shown', )

        strategy = getMultiAdapter((context, self), INavtreeStrategy)
        strategy.showAllParents = False

        return buildFolderTree(
            context,
            obj=context,
            query=query,
            strategy=strategy,
        )
Example #19
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     self.query['path'] = {'query' : "/".join(context.getPhysicalPath()),
                           'depth' : 3}
Example #20
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     self.query['path'] = {
         'query': "/".join(context.getPhysicalPath()),
         'depth': 3
     }
Example #21
0
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     dropdown_depth = api.portal.get_registry_record('webcouturier.dropdownmenu.browser.interfaces.IDropdownConfiguration.dropdown_depth')
     self.query['path'] = {'query': '/'.join(context.getPhysicalPath()),
                           'navtree_start': 1,
                           'depth': dropdown_depth}
 def __init__(self, context):
     NavtreeQueryBuilder.__init__(self, context)
     dropdown_properties = getToolByName(
         context, 'portal_properties').dropdown_properties
     dropdown_depth = dropdown_properties.getProperty('dropdown_depth', 3)
     self.query['path']['depth'] = dropdown_depth