aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-23 05:37:22 +0000
committerHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-23 05:37:22 +0000
commit1716ca811681ee5364cc096883add4d6fcf74831 (patch)
tree80c1befcf11f55b9bc6846b9aa6541ab16c005bc
parent7bc9304547b69e97f0bd103b02e75dac485a5da2 (diff)
downloadvideo-1716ca811681ee5364cc096883add4d6fcf74831.tar.gz
video-1716ca811681ee5364cc096883add4d6fcf74831.tar.bz2
Adding latest build to the CVS
-rw-r--r--.cvsignore3
-rw-r--r--video.install20
-rw-r--r--video.module58
3 files changed, 45 insertions, 36 deletions
diff --git a/.cvsignore b/.cvsignore
index 3ba64fc..a383a9b 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,5 +1,6 @@
-.DS_Store_1
.git
+.DS_Store_1
.cvsignore_1
.DS_Store
+.gitignore
.project
diff --git a/video.install b/video.install
index 1d07e50..bec9c52 100644
--- a/video.install
+++ b/video.install
@@ -89,22 +89,24 @@ function video_install() {
* Implementation of hook_uninstall().
*/
function video_uninstall() {
-// drupal_uninstall_schema('video');
+ return;
+ drupal_uninstall_schema('video');
// Delete all variables which begin with the namespaced "video_*".
- $video_vars = array();
- $query = "SELECT name FROM {variable} WHERE name LIKE '%video_%'";
- $video_vars = db_query($query);
- while ($result = db_fetch_array($video_vars)) {
- if (strpos($result['name'], 'video') === 0) {
- variable_del($result['name']);
- }
- }
+// $video_vars = array();
+// $query = "SELECT name FROM {variable} WHERE name LIKE '%video_%'";
+// $video_vars = db_query($query);
+// while ($result = db_fetch_array($video_vars)) {
+// if (strpos($result['name'], 'video') === 0) {
+// variable_del($result['name']);
+// }
+// }
}
/**
* Implements hook_field_schema().
*/
function video_field_schema($field) {
+ return;
return array(
'columns' => array(
'fid' => array(
diff --git a/video.module b/video.module
index 3a945dd..8d3ece0 100644
--- a/video.module
+++ b/video.module
@@ -470,7 +470,8 @@ function video_widget_element_settings(&$element, &$form_state) {
$player_dimensions = $settings['default_player_dimensions'];
// Lets figure out our dimensions for our video and add astericks next to our options.
$options = video_explode("\n", variable_get("video_metadata_dimensions", video_default_dimensions()));
- if ($field['settings']['autoconversion'] && isset($element['preview']) && $file['fid'] != 0 && $default_dimensions) {
+ if ($field['settings']['autoconversion'] && isset($element['preview']) &&
+ $file['fid'] != 0 && $default_dimensions) {
$file_object = file_load($file['fid']);
$video_info = _video_dimensions_options($options, drupal_realpath($file_object->uri));
$description = t('Set your video dimensions. This will create your player
@@ -500,13 +501,17 @@ function video_widget_element_settings(&$element, &$form_state) {
$player_dimensions = $file['data']['player_dimensions'];
}
- $element['data']['dimensions'] = array(
- '#type' => 'select',
- '#title' => t('Dimensions for Video Transcoding'),
- '#default_value' => $dimensions,
- '#description' => $description,
- '#options' => $options,
- );
+ // show only enabled the autoconversion
+ if ($field['settings']['autoconversion']) {
+ $element['data']['dimensions'] = array(
+ '#type' => 'select',
+ '#title' => t('Dimensions for Video Transcoding'),
+ '#default_value' => $dimensions,
+ '#description' => $description,
+ '#options' => $options,
+ );
+ }
+ // get the player dimentions
$element['data']['player_dimensions'] = array(
'#type' => 'select',
'#title' => t('Dimensions for Video Player'),
@@ -533,7 +538,7 @@ function video_widget_element_settings(&$element, &$form_state) {
'#attributes' => array('class' => array('video-bypass-auto-conversion')),
);
}
-
+// check this to convert the video on save
$convert = isset($file['data']['convert_video_on_save']) ? $file['data']['convert_video_on_save'] : variable_get('video_convert_on_save', FALSE);
if (user_access('convert on submission')) {
$element['data']['convert_video_on_save'] = array(
@@ -553,25 +558,26 @@ function video_widget_element_settings(&$element, &$form_state) {
'#value' => $convert,
);
}
+ }
- $default_thumb = isset($file['data']['use_default_video_thumb']) ? $file['data']['use_default_video_thumb'] : variable_get('video_use_default_thumb', FALSE);
- if (user_access('use default thumb')) {
- $element['data']['use_default_video_thumb'] = array(
- '#type' => 'checkbox',
- '#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' => array('video-use-default-video-thumb')),
- );
- if ($default_thumb) {
- $element['data']['use_default_video_thumb']['#attributes']['checked'] = 'checked';
- }
- } else {
- $element['data']['use_default_video_thumb'] = array(
- '#type' => 'value',
- '#value' => $default_thumb,
- );
+ // use of default thumbnail
+ $default_thumb = isset($file['data']['use_default_video_thumb']) ? $file['data']['use_default_video_thumb'] : variable_get('video_use_default_thumb', FALSE);
+ if (user_access('use default thumb')) {
+ $element['data']['use_default_video_thumb'] = array(
+ '#type' => 'checkbox',
+ '#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' => array('video-use-default-video-thumb')),
+ );
+ if ($default_thumb) {
+ $element['data']['use_default_video_thumb']['#attributes']['checked'] = 'checked';
}
+ } else {
+ $element['data']['use_default_video_thumb'] = array(
+ '#type' => 'value',
+ '#value' => $default_thumb,
+ );
}
}