Changeset 2272 in products for quintagroup.dropdownmenu/trunk
- Timestamp:
- May 7, 2010 2:11:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py
r2267 r2272 69 69 def _subactions(self, category, object, level=0): 70 70 tabs = [] 71 currentParentId = -1 72 index = -1 73 currentParent = False 71 74 for info in self._actionInfos(category, object): 72 75 # prepare data for action … … 75 78 # actions tabs are rendered separately 76 79 currentItem = False 77 currentParent = False 80 81 index += 1 78 82 icon = info['icon'] and '<img src="%s" />' % info['icon'] or '' 79 83 … … 93 97 if IActionCategory.providedBy(subcat): 94 98 children = self._subactions(subcat, object, level+1) 95 url = self.context.absolute_url() 96 if url.startswith(info['url']): 97 currentParent = True 98 if url == info['url']: 99 currentItem = True 99 100 url = self.context.absolute_url() 101 if url.startswith(info['url']): 102 if currentParentId > -1: 103 if len(tabs[currentParentId]['getURL']) < len(info['url']): 104 currentParentId = index 105 else: 106 currentParentId = index 107 if url == info['url']: 108 currentItem = True 100 109 # make up final tab dictionary 101 110 tab = {'Title': info['title'], … … 109 118 'normalized_review_state': 'visible'} 110 119 tabs.append(tab) 120 if currentParentId > -1: 121 tabs[currentParentId]['currentParent'] = True 111 122 return tabs 112 123
Note: See TracChangeset
for help on using the changeset viewer.