src/pyams_content/component/paragraph/zmi/map.py
changeset 1002 ab7787b3faf1
parent 956 a8723fffbaf6
child 1006 cbb65b4b8742
equal deleted inserted replaced
1001:ad63fa80bb49 1002:ab7787b3faf1
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    14 
    14 
    15 
       
    16 from pyams_content.component.paragraph.interfaces.map import have_gis
    15 from pyams_content.component.paragraph.interfaces.map import have_gis
    17 if have_gis:
    16 if have_gis:
    18 
    17 
    19     # import standard library
       
    20 
       
    21     # import interfaces
       
    22     from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer, \
    18     from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer, \
    23         IBaseParagraph, PARAGRAPH_HIDDEN_FIELDS
    19         IBaseParagraph, PARAGRAPH_HIDDEN_FIELDS
    24     from pyams_content.component.paragraph.interfaces.map import MAP_PARAGRAPH_TYPE, IMapParagraph
    20     from pyams_content.component.paragraph.interfaces.map import MAP_PARAGRAPH_TYPE, IMapParagraph
    25     from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor
    21     from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor
    26     from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
    22     from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
    27     from pyams_form.interfaces.form import IInnerForm
    23     from pyams_form.interfaces.form import IInnerForm
    28     from pyams_skin.interfaces.viewlet import IToolbarAddingMenu
    24     from pyams_skin.interfaces.viewlet import IToolbarAddingMenu
    29     from pyams_skin.layer import IPyAMSLayer
    25     from pyams_skin.layer import IPyAMSLayer
    30     from z3c.form.interfaces import INPUT_MODE
    26     from z3c.form.interfaces import INPUT_MODE
    31 
    27 
    32     # import packages
       
    33     from pyams_content.component.paragraph.map import MapParagraph
    28     from pyams_content.component.paragraph.map import MapParagraph
    34     from pyams_content.component.paragraph.zmi import IParagraphContainerView, BaseParagraphAddMenu, \
    29     from pyams_content.component.paragraph.zmi import IParagraphContainerView, BaseParagraphAddMenu, \
    35         BaseParagraphAJAXAddForm, BaseParagraphAJAXEditForm, BaseParagraphPropertiesEditForm, \
    30         BaseParagraphAJAXAddForm, BaseParagraphAJAXEditForm, BaseParagraphPropertiesEditForm, \
    36         IParagraphEditFormButtons, get_json_paragraph_refresh_event
    31         get_json_paragraph_refresh_event, IParagraphInnerEditFormButtons
    37     from pyams_content.features.renderer.zmi.widget import RendererFieldWidget
    32     from pyams_content.features.renderer.zmi.widget import RendererFieldWidget
    38     from pyams_form.form import ajax_config
    33     from pyams_form.form import ajax_config
    39     from pyams_pagelet.pagelet import pagelet_config
    34     from pyams_pagelet.pagelet import pagelet_config
    40     from pyams_skin.event import get_json_form_refresh_event
    35     from pyams_skin.event import get_json_form_refresh_event
    41     from pyams_utils.adapter import adapter_config
    36     from pyams_utils.adapter import adapter_config
   107         legend = None
   102         legend = None
   108 
   103 
   109         @property
   104         @property
   110         def buttons(self):
   105         def buttons(self):
   111             if self.mode == INPUT_MODE:
   106             if self.mode == INPUT_MODE:
   112                 return button.Buttons(IParagraphEditFormButtons)
   107                 return button.Buttons(IParagraphInnerEditFormButtons)
   113             else:
   108             else:
   114                 return button.Buttons()
   109                 return button.Buttons()
   115 
   110 
   116         def get_ajax_output(self, changes):
   111         def get_ajax_output(self, changes):
   117             output = super(self.__class__, self).get_ajax_output(changes)
   112             output = super(self.__class__, self).get_ajax_output(changes)