Exemple #1
0
def update_clear_copyright(obj, evt):
    """ update clear copyright annotation  """
    if IClearCopyrightable.providedBy(evt.object):
	if hasattr(evt.object.REQUEST, 'clearedCopyright'):
	    if hasattr(evt.object.REQUEST, 'id'):
	        if evt.object.id == evt.object.REQUEST['id']:
                    IAnnotations(evt.object)['eduCommons.clearcopyright'] = evt.object.REQUEST['clearedCopyright']
                    evt.object.reindexObject()
        else:
	    IAnnotations(evt.object)['eduCommons.clearcopyright'] = False
            evt.object.reindexObject()
Exemple #2
0
 def changeCopyright(self, value):
     """ Provides annotation to placeless script """
     context = self.context
     message = ''        
     if IClearCopyrightable.providedBy(context):
         anno = IAnnotations(context)
         if value == 'True':
             anno['eduCommons.clearcopyright'] = True
             message= _(u'Copyright Cleared')
         elif value == 'False':
             anno['eduCommons.clearcopyright'] = False
             message= _(u'Copyright Revoked')
     return message