module S3SwfUpload module ViewHelpers def s3_swf_upload_tag(options = {}) buttonWidth = options[:buttonWidth] || 100 buttonHeight = options[:buttonHeight] || 30 flashVersion = options[:height] || '9.0.0' queueSizeLimit = options[:queueSizeLimit] || 100 fileSizeLimit = options[:fileSizeLimit] || 524288000 fileTypes = options[:fileTypes] || '*.*' fileTypeDescs = options[:fileTypeDescs] || 'All Files' selectMultipleFiles = options.has_key?(:selectMultipleFiles) ? options[:selectMultipleFiles] : true keyPrefix = options[:keyPrefix] || '' signaturePath = options[:signaturePath] || '/s3_uploads.xml' swfFilePath = options[:swfFilePath] || '/flash/s3_upload.swf' buttonUpPath = options[:buttonUpPath] || '/flash/s3_up_button.gif' buttonOverPath = options[:buttonOverPath] || '/flash/s3_over_button.gif' buttonDownPath = options[:buttonDownPath] || '/flash/s3_down_button.gif' onFileAdd = options[:onFileAdd] || false onFileRemove = options[:onFileRemove] || false onFileSizeLimitReached = options[:onFileSizeLimitReached] || false onFileNotInQueue = options[:onFileNotInQueue] || false onQueueChange = options[:onQueueChange] || false onQueueClear = options[:onQueueClear] || false onQueueSizeLimitReached = options[:onQueueSizeLimitReached] || false onQueueEmpty = options[:onQueueEmpty] || false onUploadingStop = options[:onUploadingStop] || false onUploadingStart = options[:onUploadingStart] || false onUploadingFinish = options[:onUploadingFinish] || false onSignatureOpen = options[:onSignatureOpen] || false onSignatureProgress = options[:onSignatureProgress] || false onSignatureHttpStatus = options[:onSignatureHttpStatus] || false onSignatureComplete = options[:onSignatureComplete] || false onSignatureSecurityError= options[:onSignatureSecurityError] || false onSignatureIOError = options[:onSignatureIOError] || false onSignatureXMLError = options[:onSignatureXMLError] || false onUploadOpen = options[:onUploadOpen] || false onUploadProgress = options[:onUploadProgress] || false onUploadHttpStatus = options[:onUploadHttpStatus] || false onUploadComplete = options[:onUploadComplete] || false onUploadIOError = options[:onUploadIOError] || false onUploadSecurityError = options[:onUploadSecurityError] || false onUploadError = options[:onUploadError] || false @include_s3_upload ||= false @count ||= 1 out = '' if Rails.version < '3.1.0' if !@include_s3_upload out << javascript_include_tag('s3_upload') @include_s3_upload = true end end out << "\n\n" out << "