Imagefield SWFUpload module for Drupal 5
Download link below. The 'Readme.txt' which is also in the archive, follows:
This module enables users to do bulk uploads of multiple images at once,
using the open source applicatoin 'SWFUpload', to a CCK field of type
'imagefield' (with 'Multiple Values' set).
It is for imagefields specifically, because of the specific issues with
parallel uploads in Drupal 5.
INSTALLATION
- Install the module to your favourite location (sites/all/modules)
- Make sure the SWFUpload application is installed in the subdirectory
'swfupload/' of this module. Specifically, the following files are needed: - Enable the module (http://YOURSITE/admin/build/modules)
- Make sure you have content types set up with CCK fields of type 'Image', with the option 'Multiple Values' checked.
- You can enable SWFUpload (for all users) for specific content types at http://YOURSITE/admin/settings/imagefield_fupload. In this screen, all content types containing a multiple-value 'imagefield' are shown.
SWFUpload can be enabled by selecting the relevant field for the content type, from the dropdown box (whose default value is '').
Per content type, maximum one imagefield can have SWFUpload attached. - The maximum disk space allowed for the total of all images can be configured here too. Other disk space settings can be configured in the specific field settings, at http://YOURSITE/admin/content/types/TYPE/fields
- If certain groups (except for the site's superuser) need to be able to administer the above, you can configure those permissions at http://YOURSITE/admin/user/access#module-imagefield_fupload
swfupload/swfupload.js
swfupload/swfupload.swf
swfupload/plugins/swfupload.cookies.js
swfupload/plugins/swfupload.queue.js
swfupload/plugins/swfupload.swfobject.js
Users now see an SWFUpload widget (and a disk space summary) in place of the regular upload widget. After uploading images, they can reorder them in the web browser.
Happy uploading!
N.B.: There are no permissions for 'uploading images with SWFUpload'. If it's enabled for a specific content type, it's enabled for anyone able to edit that content type.
PATCHES NECESSARY
1)
The imagefield module (and consequently the imagefield_fupload module, which is a dependant add-on instead of a replacement) stores data of newly uploaded images in the session object. Unfortunately, Drupal (at least Drupal 5) does not handle sessions very well in parallel communications between webserver and client (which happen with multiple simultaneous uploads). Therefore, this module needs a patch to Drupal Core, in order to make sure all communication is done synchronously.
See included file: PATCHES/drupal-core-session.patch
2)
Also, since modules using SWFUpload occasionally lose session information, and SWFUpload now directly integrates with imagefield.module, imagefield.module needs to be patched with the same code that all SWFUpload-using modules have.
See included file: PATCHES/imagefield.module.session.patch
(This file is a patch against the 5.x-2.x-dev branch from end 2008)
See http://drupal.org/node/287776 (step 5) for background.
THEMING
The uploaded image rows can be themed through the Drupal system, since the function responsible for their output is called theme_imagefield_fupload_edit_image_row($element). However, this is explicitly discouraged. Since the output of this function is essentially a large batch of tags (containing mandatory information), theming should all be possible through CSS.
CSS examples can be seen in swfupload-style.css.
An example output of theme_imagefield_fupload_edit_image_row($element) is provided for further reference.
( deleted from online README; see text in archive )
| Attachment | Size |
|---|---|
| imagefield_fupload.tbz | 21.55 KB |