diff options
Diffstat (limited to 'types/videoupload/videoupload.module')
-rw-r--r-- | types/videoupload/videoupload.module | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/types/videoupload/videoupload.module b/types/videoupload/videoupload.module index 9664e1e..b482c67 100644 --- a/types/videoupload/videoupload.module +++ b/types/videoupload/videoupload.module @@ -6,51 +6,36 @@ * uploadfield core hooks and menu callbacks. */ -module_load_include('inc', 'uploadfield', 'uploadfield_widget'); +module_load_include('inc', 'videoupload', 'videoupload.field'); /** * Implementation of hook_perm(). */ -function uploadfield_perm() { +function videoupload_perm() { return array('use default thumbnail', 'bypass conversion video'); } /** * Implementation of hook_theme(). */ -function uploadfield_theme() { +function videoupload_theme() { $theme = array(); $theme['uploadfield_widget'] = array( 'arguments' => array('element' => NULL), - 'file' => 'uploadfield.theme.inc', + 'file' => 'videoupload.theme.inc', ); $theme['uploadfield_widget_item'] = array( 'arguments' => array('element' => NULL), - 'file' => 'uploadfield.theme.inc', + 'file' => 'videoupload.theme.inc', ); return $theme; } -/** - * Implementation of CCK's hook_widget_info(). - */ -function uploadfield_widget_info() { - return array( - 'uploadfield_widget' => array( - 'label' => t('Video'), - 'field types' => array('filefield'), - 'multiple values' => CONTENT_HANDLE_CORE, - 'callbacks' => array('default value' => CONTENT_CALLBACK_CUSTOM), - 'description' => t('An edit widget for video files, including video thumbnails and transcoding to flash.'), - ), - ); -} - /** * Implementation of hook_elements(). */ -function uploadfield_elements() { +function videoupload_elements() { $elements = array(); // An uploadfield is really just a FileField with extra processing. $filefield_elements = module_invoke('filefield', 'elements'); @@ -65,7 +50,7 @@ function uploadfield_elements() { /** * Implementation of hook_file_download. */ -function uploadfield_file_download($filepath) { +function videoupload_file_download($filepath) { // Return headers for default images. if (strpos($filepath, 'video_thumbs') !== FALSE) { $full_path = file_create_path($filepath); @@ -81,7 +66,7 @@ function uploadfield_file_download($filepath) { /** * Implementation of CCK's hook_widget_settings(). */ -function uploadfield_widget_settings($op, $widget) { +function videoupload_widget_settings($op, $widget) { switch ($op) { case 'form': return uploadfield_widget_settings_form($widget); @@ -95,7 +80,7 @@ function uploadfield_widget_settings($op, $widget) { /** * Implementation of hook_widget(). */ -function uploadfield_widget(&$form, &$form_state, $field, $items, $delta = NULL) { +function videoupload_widget(&$form, &$form_state, $field, $items, $delta = NULL) { $item = array('fid' => 0, 'list' => $field['list_default'], 'data' => array('description' => '', 'video_thumb' => '')); if (isset($items[$delta])) { $item = array_merge($item, $items[$delta]); @@ -106,7 +91,7 @@ function uploadfield_widget(&$form, &$form_state, $field, $items, $delta = NULL) /** * Implementation of CCK's hook_default_value(). */ -function uploadfield_default_value(&$form, &$form_state, $field, $delta) { +function videoupload_default_value(&$form, &$form_state, $field, $delta) { return filefield_default_value($form, $form_state, $field, $delta); } @@ -115,14 +100,14 @@ function uploadfield_default_value(&$form, &$form_state, $field, $delta) { * * Modify the add new field form to make "Video" the default formatter. */ -function uploadfield_form_content_field_overview_form_alter(&$form, &$form_state) { +function videoupload_form_content_field_overview_form_alter(&$form, &$form_state) { $form['#submit'][] = 'uploadfield_form_content_field_overview_submit'; } /** * Submit handler to set a new field's formatter to "video_plain". */ -function uploadfield_form_content_field_overview_submit(&$form, &$form_state) { +function videoupload_form_content_field_overview_submit(&$form, &$form_state) { if (isset($form_state['fields_added']['_add_new_field']) && isset($form['#type_name'])) { $new_field = $form_state['fields_added']['_add_new_field']; $node_type = $form['#type_name']; @@ -141,6 +126,6 @@ function uploadfield_form_content_field_overview_submit(&$form, &$form_state) { /** * filefield source support */ -function uploadfield_filefield_sources_widgets() { - return array('uploadfield_widget'); +function videoupload_filefield_sources_widgets() { + return array('videoupload_widget'); }
\ No newline at end of file |