I just did this with the imagefield extended module and a small custom module. After enabling the imagefield_extended module, I add this code to my custom module.
/**
* Implementation of hook_imagefield_extended_widget().
*/
function MYMODULE_imagefield_extended_widget($element, $extra_values) {
// If you need the field or widget to conditionally add a FAPI field, use these.
$field = content_fields($element['#field_name'], $element['#type_name']);
$widget = $field['widget'];
if($element['#type_name'] == 'occupancy_status' && $element['#field_name'] == 'field_task_files'){
return array(
//This will Replace the Textfield with dropdown select for the description
'description' => array(
'#type' => 'select',
'#title' => t('Document Description'),
'#options' => array(
'Occupancy Flyer' => t('Occupancy Flyer'),
'Personal Property Release' => t('Personal Property Release'),
'Introduction Letter' => t('Introduction Letter'),
'Notice of Rights' => t('Notice of Rights'),
'Miscellenous' => t('Miscellenous'),
),
// this makes b the default value when the value is not set.
'#default_value' => isset($extra_values['description']) ? $extra_values['description'] : 'Miscellenous',
),
);
}
if( $element['#type_name'] == 'property_gallery' && $element['#field_name'] == 'field_gallery_images' && arg(1)!=='add'){
return array(
//These are stored in the 'data' column of the cck imagefield's db table
'revised' => array(
'#type' => 'checkbox',
'#title' => t('Revise This Description'),
'#default_value' => isset($extra_values['revised']) ? $extra_values['revised'] : 0,
'#attributes'=>array('class' => 'revise-check')
),
'revisedby' => array(
'#type' => 'textfield',
'#maxlength' => 64,
'#title' => t('Revsied By'),
'#description' => t('Replace your name with the current name if you are making a new revision.'),
'#default_value' => ($extra_values['revised']==0) ? NULL : $extra_values['revisedby'] ,
),
'revisedon' => array(
'#type' => 'date',
'#title' => t('Date Revised'),
'#default_value' => ($extra_values['revised']==0) ? NULL : $extra_values['revisedon'] ,
),
);
}
} /*End function */
You have the ability to add or modify the filefield or the imagefield field widgets. The only problem that I'm stuck at is making this work for fupload_imagefield.