]> CRI, Mines Paris - PSL - PlinnDocument.git/blobdiff - skins/plinn_attachment_form.py
eggification
[PlinnDocument.git] / skins / plinn_attachment_form.py
diff --git a/skins/plinn_attachment_form.py b/skins/plinn_attachment_form.py
deleted file mode 100644 (file)
index 090c57b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-##parameters=
-form = context.REQUEST.form
-formId = form.get('formId')
-epozInsert = form.get('epozInsert', False)
-file = form.get('file', None)
-fileOb = None
-
-if file : fileOb = context.addAttachment(file, formId)
-
-onload = None
-if fileOb is not None :
-       if fileOb.meta_type == 'Photo' :
-               fileUrl = 'attachments/%s/getThumbnail' % fileOb.getId()
-               if epozInsert :
-                       onload = "dispatchImageAndHideUploadForm('%s', '%s', true);" % (fileUrl, formId)
-               else :
-                       ratio = float(fileOb.height)/fileOb.width
-                       dispatchValue = "%f_%s" % (ratio, fileUrl)
-                       onload = "dispatchImageAndHideUploadForm('%s','%s', false);" % (dispatchValue, formId)
-       else :
-               dispatchValue = '%s[%s]' % (fileOb.getId(), 'attachments/'+fileOb.getId())
-               onload = "dispatchFileAndHideUploadForm('%s', '%s');" % (dispatchValue, formId)
-
-hideFormCode = "hideUploadForm('%s');" % formId
-
-return context.plinn_attachment_template(onload=onload,
-                                                                                hideFormCode=hideFormCode,
-                                                                                formId=formId)
\ No newline at end of file