def getSkins(self, request=None): layout = self.getLayout() skins = [] if layout and request: request.debug = False ifaces = directlyProvidedBy(request) directlyProvides(request, ICollageBrowserLayer) target = self.context if ICollageAlias.providedBy(target): target = target.get_target() if not target: target = self.context view = getMultiAdapter((target, request), name=layout) skinInterfaces = getattr(view, "skinInterfaces", ()) for si in skinInterfaces: for name, utility in getUtilitiesFor(si): skins.append((name, utility.title)) # restore interfaces directlyProvides(request, ifaces) skins.sort(lambda x, y: cmp(x[0], y[0])) return skins
def getLayouts(self): context = self.context if ICollageAlias.providedBy(self.context): # use target as self.context target = self.context.get_target() if target: context = target return self._getViewFactoryInfo(ICollageBrowserLayer, context=context)