function videoftp_widget in Video 6.5
Same name and namespace in other branches
- 6.4 types/videoftp/videoftp.module \videoftp_widget()
Implementation of hook_widget().
3 string references to 'videoftp_widget'
- videoftp_js in types/
videoftp/ videoftp.module - Menu callback; Shared AHAH callback for ftp file attachment and deletions.
- videoftp_widget_settings in types/
videoftp/ videoftp.module - Implementation of CCK's hook_widget_settings().
- video_views_data in views/
video.views.inc - Implementation of hook_views_data().
File
- types/
videoftp/ videoftp.module, line 118
Code
function videoftp_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
if (empty($form['#validate']) || !in_array('filefield_node_form_validate', $form['#validate'])) {
$form['#validate'][] = 'filefield_node_form_validate';
}
$item = array(
'fid' => 0,
'list' => $field['list_default'],
);
$data = array(
'description' => '',
'video_thumb' => '',
'bypass_autoconversion' => variable_get('video_bypass_conversion', FALSE),
);
if (isset($items[$delta])) {
if (isset($items[$delta]['data'])) {
$data = array_merge($data, $items[$delta]['data']);
}
$item = array_merge($item, $items[$delta]);
}
$item['data'] = $data;
return array(
'#title' => $field['widget']['label'],
'#type' => $field['widget']['type'],
'#default_value' => $item,
);
}