Thereis no system to control swfupload widget behaviour when there is no need to upload files. You can control the number of files to upload using swfupload setting, but if you establish the value to 0 the widget its showed again. Drupal upload module use content-type edit form to disable or enable upload files. I think a solution is integrate this feature on swfupload.
//swfupload.module line 119
function swfupload_form_alter(&$form, $form_state, $form_id) {
// For all node edit/add forms and for all users who have access,
// the regular upload form will be replaced by the swfupload form.
if (isset($form['#node']) && user_access('upload files')) {
If we change the if statement we can control if the file uploads are enabled for this content type. The new code:
//swfupload.module line 119
function swfupload_form_alter(&$form, $form_state, $form_id) {
// For all node edit/add forms and for all users who have access,
// the regular upload form will be replaced by the swfupload form.
if (isset($form['#node']) && isset($form['attachments']) && user_access('upload files')) {
Comments
Comment #1
xavier.carriba commentedComment #2
xavier.carriba commentedComment #3
skilip commentedYou already can enable/disable the upload element per content type. I'm planning to add a CCK module to it to make it even more flexible.
Comment #4
skilip commented