function soundcloudfield_process in SoundCloud field 6
Process an individual element. Build the form element.
#element['#value'] is already set
The $fields array is in $form['#field_info'][$element['#field_name']]
1 string reference to 'soundcloudfield_process'
- soundcloudfield_elements in ./
soundcloudfield.module - Implementation of FAPI hook_elements().
File
- ./
soundcloudfield.module, line 274 - SoundCloud CCK field.
Code
function soundcloudfield_process($element, $edit, $form_state, $form) {
$field = $form['#field_info'][$element['#field_name']];
$field_key = $element['#columns'][0];
// $field_key = 'embed'
$delta = $element['#delta'];
$element[$field_key] = array(
'#type' => 'textfield',
'#title' => $element['#title'],
'#description' => 'Here you can type the URL of the Soundcloud track or set',
// $field['widget']['description']
'#required' => $element['#required'],
'#maxlength' => 255,
'#size' => !empty($field['widget']['size']) ? $field['widget']['size'] : 48,
'#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL,
);
return $element;
}