Changeset 2207 in products


Ignore:
Timestamp:
Apr 26, 2010 7:17:17 PM (11 years ago)
Author:
mylan
Message:

Clean-up needless IMapEnabledView adapter for default pabe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.portlet.map/trunk/quintagroup/portlet/map/map_fix.py

    r2188 r2207  
    1 from zope.component import adapts 
    21from zope.interface import implements 
    3 from zope.component import getMultiAdapter 
    4  
    5 from Acquisition import aq_inner, aq_parent 
    6  
    7 from Products.ATContentTypes import interface 
    8 from Products.Maps.adapters import FolderMap 
    92from Products.Maps.interfaces import IMapView 
    103from Products.Maps.browser.map import BaseMapView 
    11  
    12 class DefaultPageMapView(BaseMapView): 
    13     implements(IMapView) 
    14  
    15     @property 
    16     def enabled(self): 
    17         if self.map is None: 
    18             return False 
    19         elif not self.isDefaultPage(): 
    20             return False 
    21         return True 
    22  
    23     def isDefaultPage(self): 
    24         context = aq_inner(self.context) 
    25         container = aq_parent(context) 
    26         if not container: 
    27             return False 
    28         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 = container 
    39  
    404 
    415class FolderMapView(BaseMapView): 
Note: See TracChangeset for help on using the changeset viewer.