def getSelectedNames(view): mgr = SecondaryNavigationManager(view.context, view.request, view) mgr.update() primary = mgr.getActivePrimaryName() for v in mgr.getActiveViewlets(): if v.selected: secondary = v.__name__ break else: secondary = '' return primary, secondary
def selected(self): requestURL = self.request.getURL().replace('/@@', '/') for url in chain((self.url,), self.subviews): if re.search(url, requestURL) : return True sec = SecondaryNavigationManager(self.context, self.request, self.__parent__) if sec: for v in sec.getViewletsByParentName(self.__name__): if v.selected: return True return False
def selected(self): requestURL = self.request.getURL().replace('/@@', '/') for url in chain((self.url, ), self.subviews): if re.search(url, requestURL): return True sec = SecondaryNavigationManager(self.context, self.request, self.__parent__) if sec: for v in sec.getViewletsByParentName(self.__name__): if v.selected: return True return False