Changeset 2207 in products for quintagroup.portlet.map/trunk/quintagroup/portlet/map/map_fix.py
- Timestamp:
- Apr 26, 2010 7:17:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.portlet.map/trunk/quintagroup/portlet/map/map_fix.py
r2188 r2207 1 from zope.component import adapts2 1 from zope.interface import implements 3 from zope.component import getMultiAdapter4 5 from Acquisition import aq_inner, aq_parent6 7 from Products.ATContentTypes import interface8 from Products.Maps.adapters import FolderMap9 2 from Products.Maps.interfaces import IMapView 10 3 from Products.Maps.browser.map import BaseMapView 11 12 class DefaultPageMapView(BaseMapView):13 implements(IMapView)14 15 @property16 def enabled(self):17 if self.map is None:18 return False19 elif not self.isDefaultPage():20 return False21 return True22 23 def isDefaultPage(self):24 context = aq_inner(self.context)25 container = aq_parent(context)26 if not container:27 return False28 view = getMultiAdapter((container, self.request), name='default_page')29 return view.isDefaultPage(context)30 31 32 class DefaultPageMap(FolderMap):33 adapts(interface.IATDocument)34 35 def __init__(self, context):36 context = aq_inner(context)37 container = aq_parent(context)38 self.context = container39 40 4 41 5 class FolderMapView(BaseMapView):
Note: See TracChangeset
for help on using the changeset viewer.