function emvideo_field_settings in Embedded Media Field 6.2
Same name and namespace in other branches
- 6.3 contrib/emvideo/emvideo.module \emvideo_field_settings()
- 6 contrib/emvideo/emvideo.module \emvideo_field_settings()
Implementation of hook_field_settings().
File
- contrib/
emvideo/ emvideo.module, line 255 - Embedded Video module is a handler for 3rd party video files.
Code
function emvideo_field_settings($op, $field) {
switch ($op) {
case 'views data':
$data = emfield_emfield_field_settings($op, $field);
$table_alias = content_views_tablename($field);
$field_duration = $field['field_name'] . '_duration';
$data[$table_alias][$field_duration] = $data[$table_alias][$field['field_name'] . '_embed'];
$data[$table_alias][$field_duration]['title'] .= t(' - Duration');
$data[$table_alias][$field_duration]['field']['title'] = $data[$table_alias][$field_duration]['title'];
$data[$table_alias][$field_duration]['title short'] = t('Duration');
$data[$table_alias][$field_duration]['field']['title short'] = $data[$table_alias][$field_duration]['title short'];
$data[$table_alias][$field_duration]['field']['field'] = $field_duration;
$data[$table_alias][$field_duration]['field']['handler'] = 'emvideo_handler_field_duration';
$data[$table_alias][$field_duration]['argument']['field'] = $field_duration;
$data[$table_alias][$field_duration]['argument']['handler'] = 'emvideo_handler_argument_duration';
$data[$table_alias][$field_duration]['filter']['field'] = $field_duration;
$data[$table_alias][$field_duration]['filter']['handler'] = 'content_handler_filter_numeric';
$data[$table_alias][$field_duration]['sort']['field'] = $field_duration;
$field_description = $field['field_name'] . '_description';
$data[$table_alias][$field_description] = $data[$table_alias][$field['field_name'] . '_embed'];
$data[$table_alias][$field_description]['title'] .= t(' - Description');
$data[$table_alias][$field_description]['field']['title'] = $data[$table_alias][$field_description]['title'];
$data[$table_alias][$field_description]['title short'] = t('Description');
$data[$table_alias][$field_description]['field']['title short'] = $data[$table_alias][$field_description]['title short'];
$data[$table_alias][$field_description]['field']['field'] = $field_description;
$data[$table_alias][$field_description]['field']['handler'] = 'emvideo_handler_field_description';
$field_title = $field['field_name'] . '_title';
$data[$table_alias][$field_title] = $data[$table_alias][$field['field_name'] . '_embed'];
$data[$table_alias][$field_title]['title'] .= t(' - Title');
$data[$table_alias][$field_title]['field']['title'] = $data[$table_alias][$field_title]['title'];
$data[$table_alias][$field_title]['title short'] = t('Title');
$data[$table_alias][$field_title]['field']['title short'] = $data[$table_alias][$field_title]['title short'];
$data[$table_alias][$field_title]['field']['field'] = $field_title;
$data[$table_alias][$field_title]['field']['handler'] = 'emvideo_handler_field_title';
return $data;
case 'database columns':
$columns = emfield_emfield_field_settings($op, $field);
// Store duration in its own column for views.
$columns = array_merge($columns, array(
'duration' => array(
'description' => t('Store the duration of a video in seconds.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
));
return $columns;
default:
return emfield_emfield_field_settings($op, $field);
}
}