16 from z3c.form import field |
16 from z3c.form import field |
17 from zope.interface import implementer |
17 from zope.interface import implementer |
18 |
18 |
19 from pyams_content.component.illustration.interfaces import IBasicIllustration, IBasicIllustrationTarget, \ |
19 from pyams_content.component.illustration.interfaces import IBasicIllustration, IBasicIllustrationTarget, \ |
20 IIllustration, IIllustrationTarget, ILinkIllustrationTarget |
20 IIllustration, IIllustrationTarget, ILinkIllustrationTarget |
21 from pyams_content.component.illustration.zmi.paragraph import ParagraphContainerIllustrationMarker |
21 from pyams_content.component.illustration.zmi.paragraph import ParagraphIllustrationMarker |
22 from pyams_content.component.paragraph import IBaseParagraph |
22 from pyams_content.component.paragraph import IBaseParagraph |
23 from pyams_content.component.paragraph.zmi import get_json_paragraph_markers_refresh_event |
23 from pyams_content.component.paragraph.zmi import get_json_paragraph_markers_refresh_event |
24 from pyams_content.features.renderer.zmi.widget import RendererFieldWidget |
24 from pyams_content.features.renderer.zmi.widget import RendererFieldWidget |
25 from pyams_content.zmi import pyams_content |
25 from pyams_content.zmi import pyams_content |
26 from pyams_form.interfaces.form import IInnerSubForm, IWidgetsPrefixViewletsManager |
26 from pyams_form.interfaces.form import IInnerSubForm, IWidgetsPrefixViewletsManager |
98 ITransactionManager(self.context).get().commit() |
98 ITransactionManager(self.context).get().commit() |
99 if IBaseParagraph.providedBy(self.context): |
99 if IBaseParagraph.providedBy(self.context): |
100 if self.getContent().data: |
100 if self.getContent().data: |
101 events.append( |
101 events.append( |
102 get_json_paragraph_markers_refresh_event(self.context, self.request, self, |
102 get_json_paragraph_markers_refresh_event(self.context, self.request, self, |
103 ParagraphContainerIllustrationMarker)) |
103 ParagraphIllustrationMarker)) |
104 else: |
104 else: |
105 events.append( |
105 events.append( |
106 get_json_paragraph_markers_refresh_event(self.context, self.request, self, |
106 get_json_paragraph_markers_refresh_event(self.context, self.request, self, |
107 EmptyViewlet, |
107 EmptyViewlet, |
108 ParagraphContainerIllustrationMarker.marker_type)) |
108 ParagraphIllustrationMarker.marker_type)) |
109 events.append(get_json_form_refresh_event(self.context, self.request, self.__class__)) |
109 events.append(get_json_form_refresh_event(self.context, self.request, self.__class__)) |
110 return output |
110 return output |
111 |
111 |
112 |
112 |
113 @adapter_config(name='illustration', context=(IIllustrationTarget, IPyAMSLayer, IPropertiesEditForm), |
113 @adapter_config(name='illustration', context=(IIllustrationTarget, IPyAMSLayer, IPropertiesEditForm), |