Exemplo n.º 1
0
Arquivo: events.py Projeto: dtgit/ecec
def update_accessibility_compliant(obj, evt):
    """ update accessibility compliant annotation  """
    if IAccessibilityCompliantable.providedBy(evt.object):
	if hasattr(evt.object.REQUEST, 'accessibilitycompliant'):
	    if hasattr(evt.object.REQUEST, 'id'):
	        if evt.object.id == evt.object.REQUEST['id']:
                    IAnnotations(evt.object)['eduCommons.accessible'] = evt.object.REQUEST['accessibilitycompliant']
                    evt.object.reindexObject()
        else:
	    IAnnotations(evt.object)['eduCommons.accessible'] = False
            evt.object.reindexObject()
Exemplo n.º 2
0
 def changeAccessibility(self, value):
     """ Provides annotation to placeless script """
     context = self.context
     message = ''        
     if IAccessibilityCompliantable.providedBy(context):
         anno = IAnnotations(context)
         if value == 'True':
             anno['eduCommons.accessible'] = True
             message=_(u'Accessibility Compliant set to True')
         elif value == 'False':
             anno['eduCommons.accessible'] = False
             message=_(u'Accessibility Compliant set to False')
     return message