143 parent = get_parent(self.context, IAssociationTarget) |
143 parent = get_parent(self.context, IAssociationTarget) |
144 table = ParagraphContainerTable(parent, self.request) |
144 table = ParagraphContainerTable(parent, self.request) |
145 viewlet = ParagraphTitleToolbarViewletManager(parent, self.request, table) |
145 viewlet = ParagraphTitleToolbarViewletManager(parent, self.request, table) |
146 viewlet.update() |
146 viewlet.update() |
147 output.setdefault('events', []).append({ |
147 output.setdefault('events', []).append({ |
148 'event': 'PyAMS_content.changed_item', |
148 'event': 'myams.refresh', |
149 'options': {'handler': 'PyAMS_content.paragraphs.updateToolbar', |
149 'options': { |
150 'object_name': self.context.__name__, |
150 'handler': 'PyAMS_content.paragraphs.updateToolbar', |
151 'toolbar_tag': viewlet.render()}}) |
151 'object_name': self.context.__name__, |
|
152 'toolbar_tag': viewlet.render() |
|
153 } |
|
154 }) |
152 # refresh associations table |
155 # refresh associations table |
153 associations_table = AssociationsTable(self.context, self.request) |
156 associations_table = AssociationsTable(self.context, self.request) |
154 associations_table.update() |
157 associations_table.update() |
155 output.setdefault('events', []).append({ |
158 output.setdefault('events', []).append({ |
156 'event': 'PyAMS_content.changed_item', |
159 'event': 'myams.refresh', |
157 'options': {'handler': 'PyAMS_content.associations.refreshAssociations', |
160 'options': { |
158 'object_name': associations_table.id, |
161 'handler': 'PyAMS_content.associations.refreshAssociations', |
159 'table': associations_table.render()}}) |
162 'object_id': associations_table.id, |
|
163 'table': associations_table.render() |
|
164 } |
|
165 }) |
160 return output |
166 return output |
161 |
167 |
162 |
168 |
163 @adapter_config(context=(IHTMLParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) |
169 @adapter_config(context=(IHTMLParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) |
164 @implementer(IInnerForm, IPropertiesEditForm, IAssociationsParentForm, IHTMLParagraphInnerEditForm) |
170 @implementer(IInnerForm, IPropertiesEditForm, IAssociationsParentForm, IHTMLParagraphInnerEditForm) |
188 parent = get_parent(self.context, IAssociationTarget) |
194 parent = get_parent(self.context, IAssociationTarget) |
189 table = ParagraphContainerTable(parent, self.request) |
195 table = ParagraphContainerTable(parent, self.request) |
190 viewlet = ParagraphTitleToolbarViewletManager(parent, self.request, table) |
196 viewlet = ParagraphTitleToolbarViewletManager(parent, self.request, table) |
191 viewlet.update() |
197 viewlet.update() |
192 output.setdefault('events', []).append({ |
198 output.setdefault('events', []).append({ |
193 'event': 'PyAMS_content.changed_item', |
199 'event': 'myams.refresh', |
194 'options': {'handler': 'PyAMS_content.paragraphs.updateToolbar', |
200 'options': { |
195 'object_name': self.context.__name__, |
201 'handler': 'PyAMS_content.paragraphs.updateToolbar', |
196 'toolbar_tag': viewlet.render()}}) |
202 'object_name': self.context.__name__, |
|
203 'toolbar_tag': viewlet.render() |
|
204 } |
|
205 }) |
197 # refresh associations table |
206 # refresh associations table |
198 associations_table = AssociationsTable(self.context, self.request) |
207 associations_table = AssociationsTable(self.context, self.request) |
199 associations_table.update() |
208 associations_table.update() |
200 output.setdefault('events', []).append({ |
209 output.setdefault('events', []).append({ |
201 'event': 'PyAMS_content.changed_item', |
210 'event': 'myams.refresh', |
202 'options': {'handler': 'PyAMS_content.associations.refreshAssociations', |
211 'options': { |
203 'object_name': associations_table.id, |
212 'handler': 'PyAMS_content.associations.refreshAssociations', |
204 'table': associations_table.render()} |
213 'object_id': associations_table.id, |
|
214 'table': associations_table.render() |
|
215 } |
205 }) |
216 }) |
206 return output |
217 return output |
207 |
218 |
208 |
219 |
209 # |
220 # |