Hi there,
need some help with this code - like to port a module - scibdfield to D7.
What should I do with this code? Don't know how to port this? How to add this fields in D7? Do I need the "data" array anymore? It seems that it is not existing in D7? Sould this fields be added like a filediscriptionfield? But how? Or should a hook schema implemented?
Hope some sould give me some hints!
/**
* Implementation of hook_elements().
*/
function scribdfield_elements() {
$filefield_elements = filefield_elements(); // API filefiled
dsm($filefield_elements);
$elements['scribdfield_widget'] = $filefield_elements['filefield_widget'];
$elements['scribdfield_widget']['#process'][] = 'scribdfield_widget_process';
return $elements;
}
/**
* Form API #process callback; see hook_elements().
*/
function scribdfield_widget_process($element, $edit, &$form_state, $form) {
if (_form_button_was_clicked($element['filefield_remove'])) {
unset($element['#value']['data']['scribd_doc_id']);
unset($element['#value']['data']['scribd_access_key']);
unset($element['#value']['data']['scribd_secret_password']);
$_SESSION['scribfield_removed_files'][$element['#delta']]++;
}
// we have no way of knowing if someone has a) edited the node, b) clicked
// Remove, c) uploaded a new file to the same delta. For some reason, the