src/pyams_content/component/extfile/zmi/__init__.py
changeset 283 9139536eab90
parent 202 7d7947f69fce
child 314 18da24db44b6
equal deleted inserted replaced
282:2990223a5b7f 283:9139536eab90
   125         output = super(ExtFileAJAXAddForm, self).get_ajax_output(changes)
   125         output = super(ExtFileAJAXAddForm, self).get_ajax_output(changes)
   126         if output:
   126         if output:
   127             counter = ExtFilesCounter(self.context, self.request, self, None)
   127             counter = ExtFilesCounter(self.context, self.request, self, None)
   128             counter.update()
   128             counter.update()
   129             output.setdefault('events', []).append({
   129             output.setdefault('events', []).append({
   130                 'event': 'PyAMS_content.changed_item',
   130                 'event': 'myams.refresh',
   131                 'options': {'handler': 'PyAMS_content.paragraphs.updateMarkers',
   131                 'options': {
   132                             'object_name': self.context.__name__,
   132                     'handler': 'PyAMS_content.paragraphs.updateMarkers',
   133                             'marker_type': 'extfiles',
   133                     'object_name': self.context.__name__,
   134                             'marker_tag': counter.render()}
   134                     'marker_type': 'extfiles',
       
   135                     'marker_tag': counter.render()
       
   136                 }
   135             })
   137             })
   136         return output
   138         return output
   137 
   139 
   138 
   140 
   139 @pagelet_config(name='properties.html', context=IExtFile, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   141 @pagelet_config(name='properties.html', context=IExtFile, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   227         output = super(ExtImageAJAXAddForm, self).get_ajax_output(changes)
   229         output = super(ExtImageAJAXAddForm, self).get_ajax_output(changes)
   228         if output:
   230         if output:
   229             counter = ExtImagesCounter(self.context, self.request, self, None)
   231             counter = ExtImagesCounter(self.context, self.request, self, None)
   230             counter.update()
   232             counter.update()
   231             output.setdefault('events', []).append({
   233             output.setdefault('events', []).append({
   232                 'event': 'PyAMS_content.changed_item',
   234                 'event': 'myams.refresh',
   233                 'options': {'handler': 'PyAMS_content.paragraphs.updateMarkers',
   235                 'options': {
   234                             'object_name': self.context.__name__,
   236                     'handler': 'PyAMS_content.paragraphs.updateMarkers',
   235                             'marker_type': 'extimages',
   237                     'object_name': self.context.__name__,
   236                             'marker_tag': counter.render()}
   238                     'marker_type': 'extimages',
       
   239                     'marker_tag': counter.render()
       
   240                 }
   237             })
   241             })
   238         return output
   242         return output
   239 
   243 
   240 
   244 
   241 @pagelet_config(name='properties.html', context=IExtImage, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   245 @pagelet_config(name='properties.html', context=IExtImage, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   321         output = super(ExtVideoAJAXAddForm, self).get_ajax_output(changes)
   325         output = super(ExtVideoAJAXAddForm, self).get_ajax_output(changes)
   322         if output:
   326         if output:
   323             counter = ExtVideosCounter(self.context, self.request, self, None)
   327             counter = ExtVideosCounter(self.context, self.request, self, None)
   324             counter.update()
   328             counter.update()
   325             output.setdefault('events', []).append({
   329             output.setdefault('events', []).append({
   326                 'event': 'PyAMS_content.changed_item',
   330                 'event': 'myams.refresh',
   327                 'options': {'handler': 'PyAMS_content.paragraphs.updateMarkers',
   331                 'options': {
   328                             'object_name': self.context.__name__,
   332                     'handler': 'PyAMS_content.paragraphs.updateMarkers',
   329                             'marker_type': 'extvideos',
   333                     'object_name': self.context.__name__,
   330                             'marker_tag': counter.render()}
   334                     'marker_type': 'extvideos',
       
   335                     'marker_tag': counter.render()
       
   336                 }
   331             })
   337             })
   332         return output
   338         return output
   333 
   339 
   334 
   340 
   335 @pagelet_config(name='properties.html', context=IExtVideo, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   341 @pagelet_config(name='properties.html', context=IExtVideo, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   414         output = super(ExtAudioAJAXAddForm, self).get_ajax_output(changes)
   420         output = super(ExtAudioAJAXAddForm, self).get_ajax_output(changes)
   415         if output:
   421         if output:
   416             counter = ExtAudiosCounter(self.context, self.request, self, None)
   422             counter = ExtAudiosCounter(self.context, self.request, self, None)
   417             counter.update()
   423             counter.update()
   418             output.setdefault('events', []).append({
   424             output.setdefault('events', []).append({
   419                 'event': 'PyAMS_content.changed_item',
   425                 'event': 'myams.refresh',
   420                 'options': {'handler': 'PyAMS_content.paragraphs.updateMarkers',
   426                 'options': {
   421                             'object_name': self.context.__name__,
   427                     'handler': 'PyAMS_content.paragraphs.updateMarkers',
   422                             'marker_type': 'extaudios',
   428                     'object_name': self.context.__name__,
   423                             'marker_tag': counter.render()}
   429                     'marker_type': 'extaudios',
       
   430                     'marker_tag': counter.render()
       
   431                 }
   424             })
   432             })
   425         return output
   433         return output
   426 
   434 
   427 
   435 
   428 @pagelet_config(name='properties.html', context=IExtAudio, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
   436 @pagelet_config(name='properties.html', context=IExtAudio, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)