src/pyams_content/shared/imagemap/zmi/preview.py
changeset 487 093f201e3168
parent 486 cb67e71dafff
child 488 826448236ec9
equal deleted inserted replaced
486:cb67e71dafff 487:093f201e3168
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_content.component.association.interfaces import IAssociationInfo
       
    20 from pyams_content.features.preview.zmi.interfaces import IPreviewForm
       
    21 from pyams_content.shared.imagemap.interfaces import IWfImageMap
       
    22 from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager
       
    23 from pyams_skin.layer import IPyAMSLayer
       
    24 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
       
    25 
       
    26 # import packages
       
    27 from pyams_template.template import template_config
       
    28 from pyams_viewlet.viewlet import viewlet_config
       
    29 
       
    30 
       
    31 @viewlet_config(name='imagemap-preview', context=IWfImageMap, layer=IPyAMSLayer,
       
    32                 view=IPreviewForm, manager=IWidgetsSuffixViewletsManager,
       
    33                 permission=VIEW_SYSTEM_PERMISSION, weight=100)
       
    34 @template_config(template='templates/preview.pt', layer=IPyAMSLayer)
       
    35 class ImagemapPreview(object):
       
    36     """Image map preview"""
       
    37 
       
    38     def get_item_info(self, item):
       
    39         return IAssociationInfo(item, None)