src/pyams_content/component/illustration/zmi/__init__.py
changeset 283 9139536eab90
parent 208 9345af0a1b4c
child 351 ce073b17b943
equal deleted inserted replaced
282:2990223a5b7f 283:9139536eab90
   145             ITransactionManager(self.context).get().commit()
   145             ITransactionManager(self.context).get().commit()
   146             form = IllustrationPropertiesInnerEditForm(self.context, self.request)
   146             form = IllustrationPropertiesInnerEditForm(self.context, self.request)
   147             form.update()
   147             form.update()
   148             illustration = form.getContent()
   148             illustration = form.getContent()
   149             output.setdefault('events', []).append({
   149             output.setdefault('events', []).append({
   150                 'event': 'PyAMS_content.changed_item',
   150                 'event': 'myams.refresh',
   151                 'options': {'handler': 'PyAMS_content.refreshForm',
   151                 'options': {
   152                             'object_name': '{0}_{1}_{2}'.format(
   152                     'object_id': '{0}_{1}_{2}'.format(
   153                                 self.context.__class__.__name__,
   153                         self.context.__class__.__name__,
   154                                 getattr(illustration, '__name__', 'noname').replace('++', ''),
   154                         getattr(illustration, '__name__', 'noname').replace('++', ''),
   155                                 form.id),
   155                         form.id),
   156                             'form': form.render()}
   156                     'content': form.render()
       
   157                 }
   157             })
   158             })
   158             viewlet = ParagraphContainerIllustrationMarker(self.context, self.request, self, None)
   159             viewlet = ParagraphContainerIllustrationMarker(self.context, self.request, self, None)
   159             if viewlet is not None:
   160             if viewlet is not None:
   160                 viewlet.update()
   161                 viewlet.update()
   161             output.setdefault('events', []).append({
   162             output.setdefault('events', []).append({
   162                 'event': 'PyAMS_content.changed_item',
   163                 'event': 'myams.refresh',
   163                 'options': {'handler': 'PyAMS_content.paragraphs.updateMarkers',
   164                 'options': {
   164                             'object_name': self.context.__name__,
   165                     'handler': 'PyAMS_content.paragraphs.updateMarkers',
   165                             'marker_type': 'illustration',
   166                     'object_name': self.context.__name__,
   166                             'marker_tag': viewlet.render() if viewlet is not None else ''}
   167                     'marker_type': 'illustration',
       
   168                     'marker_tag': viewlet.render() if viewlet is not None else ''
       
   169                 }
   167             })
   170             })
   168         return output
   171         return output
   169 
   172 
   170 
   173 
   171 @viewlet_config(name='add-illustration.action', context=IIllustrationTarget, layer=IPyAMSLayer,
   174 @viewlet_config(name='add-illustration.action', context=IIllustrationTarget, layer=IPyAMSLayer,