Changeset 1199 in products


Ignore:
Timestamp:
Jul 31, 2009 1:21:12 PM (15 years ago)
Author:
piv
Message:

set category sufix as optional setting, fix actions tab level functionality

Location:
quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/menu.py

    r1197 r1199  
    1919    def __init__(self, context): 
    2020        super(DropDownMenuQueryBuilder, self).__init__(context) 
    21         # TODO: make sure sitemap query builder is what we need 
    22         # override depth by dropdown menu settings 
    2321        if self._settings.content_tabs_level > 0: 
    2422            self.query['path']['depth'] = self._settings.content_tabs_level 
     
    3937    def __init__(self, context, view=None): 
    4038        super(DropDownMenuStrategy, self).__init__(context, view) 
    41         # TODO: make sure default navtree strategy is what we need 
    4239        self.bottomLevel = self._settings.content_tabs_level 
    4340 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py

    r1197 r1199  
    3333        self.conf = conf = self._settings() 
    3434        self.tool = getToolByName(context, 'portal_actions') 
    35  
    36         #import pdb;pdb.set_trace() 
    3735 
    3836        # fetch actions-based tabs? 
     
    7876            currentItem = False 
    7977            currentParent = False 
    80             # TODO: adjust img tag 
    8178            icon = info['icon'] and '<img src="%s" />' % info['icon'] or '' 
    8279 
    8380            # look up children for a given action 
    8481            children = [] 
    85             if level <= self.conf.actions_tabs_level: 
     82            bottomLevel = self.conf.actions_tabs_level 
     83            if bottomLevel < 1 or level < bottomLevel: 
    8684                # try to find out appropriate subcategory 
    87                 subcat_id = info['id'] + self.conf.nested_category_sufix 
     85                subcat_id = info['id'] 
     86                if self.conf.nested_category_sufix is not None: 
     87                    subcat_id += self.conf.nested_category_sufix 
    8888                if self.conf.nested_category_prefix is not None: 
    8989                    subcat_id = self.conf.nested_category_prefix + subcat_id 
    90                 if subcat_id in category.objectIds(): 
     90                if subcat_id != info['id'] and \ 
     91                   subcat_id in category.objectIds(): 
    9192                    subcat = category._getOb(subcat_id) 
    9293                    if IActionCategory.providedBy(subcat): 
     
    129130    def _content_tabs(self): 
    130131        """Return tree of tabs based on content structure""" 
    131         # TODO: check currentItem functionality 
     132        # TODO: make non-folderish work as proxy 
    132133        context = aq_inner(self.context) 
    133134 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py

    r1197 r1199  
    8888        description=_(u"Sufix part of the category id to be looked up during " 
    8989                      u"linking with action."), 
    90         default=u"_sub") 
     90        default=u"_sub", 
     91        required=False) 
Note: See TracChangeset for help on using the changeset viewer.