diff options
author | Heshan Wanigasooriya <heshanmw@gmail.com> | 2011-01-13 02:37:51 +0000 |
---|---|---|
committer | Heshan Wanigasooriya <heshanmw@gmail.com> | 2011-01-13 02:37:51 +0000 |
commit | c7474ecfeb5036e568c940b629accd6a3d038b09 (patch) | |
tree | 466fade7c89188eeb74ac61aa138e05cbefb9764 | |
parent | ac967cb60f30724dcc908679322271645b8ccfe6 (diff) | |
download | video-c7474ecfeb5036e568c940b629accd6a3d038b09.tar.gz video-c7474ecfeb5036e568c940b629accd6a3d038b09.tar.bz2 |
#1024822 by hadsie. [Patch] Class attribute in forms is an array in D7 and Fatal error: Call to undefined function content_fields() D7
-rw-r--r-- | video.install | 55 | ||||
-rw-r--r-- | video.module | 6 | ||||
-rw-r--r-- | views/video.views.inc | 2 |
3 files changed, 44 insertions, 19 deletions
diff --git a/video.install b/video.install index 35fcc31..1d07e50 100644 --- a/video.install +++ b/video.install @@ -78,12 +78,11 @@ function video_schema() { return $schema; } - /** * Implementation of hook_install(). */ function video_install() { -// drupal_install_schema('video'); + drupal_install_schema('video'); } /** @@ -103,18 +102,44 @@ function video_uninstall() { } /** - * Implements hook_requirements() to check the PHP GD Library. - * - * @param $phase - * @TODO : add requirment when this need FFMPEG, thing on install profiles + * Implements hook_field_schema(). */ -function video_requirements($phase) { - $requirements = array(); - - if ($phase == 'runtime') { - $requirements['video']['value'] = t('1.0'); - $requirements['video']['severity'] = REQUIREMENT_OK; - $requirements['video']['title'] = t('GD library rotate and desaturate effects'); - } - return $requirements; +function video_field_schema($field) { + return array( + 'columns' => array( + 'fid' => array( + 'description' => 'The {file_managed}.fid being referenced in this field.', + 'type' => 'int', + 'not null' => FALSE, + 'unsigned' => TRUE, + ), + 'fid' => array( + 'description' => 'The {file_managed}.fid being referenced in this field.', + 'type' => 'int', + 'not null' => FALSE, + 'unsigned' => TRUE, + ), + 'dimensions' => array( + 'description' => "Video dimention for the video player.", + 'type' => 'varchar', + 'length' => 32, + 'not null' => FALSE, + ), + 'title' => array( + 'description' => "Image title text, for the image's 'title' attribute.", + 'type' => 'varchar', + 'length' => 128, + 'not null' => FALSE, + ), + ), + 'indexes' => array( + 'fid' => array('fid'), + ), + 'foreign keys' => array( + 'fid' => array( + 'table' => 'file_managed', + 'columns' => array('fid' => 'fid'), + ), + ), + ); }
\ No newline at end of file diff --git a/video.module b/video.module index 4bb7ad0..3a945dd 100644 --- a/video.module +++ b/video.module @@ -530,7 +530,7 @@ function video_widget_element_settings(&$element, &$form_state) { '#title' => t('Bypass auto conversion'), '#default_value' => isset($file['data']['bypass_autoconversion']) ? $file['data']['bypass_autoconversion'] : variable_get('video_bypass_conversion', FALSE), '#description' => t('This will bypass your auto conversion of videos.'), - '#attributes' => array('class' => 'video-bypass-auto-conversion'), + '#attributes' => array('class' => array('video-bypass-auto-conversion')), ); } @@ -541,7 +541,7 @@ function video_widget_element_settings(&$element, &$form_state) { '#title' => t('Convert video on save'), '#default_value' => $convert, '#description' => t('This will convert your video to flv format when you save, instead of scheduling it for cron.'), - '#attributes' => array('class' => 'video-convert-video-on-save'), + '#attributes' => array('class' => array('video-convert-video-on-save')), ); if ($convert) { @@ -561,7 +561,7 @@ function video_widget_element_settings(&$element, &$form_state) { '#title' => t('Use the default thumbnail for this video?'), '#default_value' => $default_thumb, '#description' => t('This will set a flag for this video to use the default video thumbnail when outputed..'), - '#attributes' => array('class' => 'video-use-default-video-thumb'), + '#attributes' => array('class' => array('video-use-default-video-thumb')), ); if ($default_thumb) { $element['data']['use_default_video_thumb']['#attributes']['checked'] = 'checked'; diff --git a/views/video.views.inc b/views/video.views.inc index 4d4cc36..a0c5384 100644 --- a/views/video.views.inc +++ b/views/video.views.inc @@ -31,7 +31,7 @@ function video_views_data() { $data = array(); $data['video']['table']['group'] = t('Video'); $widgets = array('videoftp_widget', 'uploadfield_widget'); - foreach (content_fields () as $field) { + foreach (field_info_fields () as $field) { if ($field['module'] == 'filefield' && isset($field['widget']['type']) && in_array($field['widget']['type'], $widgets)) { $views_data = content_views_field_views_data($field); $table_alias = content_views_tablename($field); |