From aa5c9b48cfa5674f534acab2cdaab685e9e116ee Mon Sep 17 00:00:00 2001 From: Heshan Date: Wed, 4 May 2011 17:16:42 +0530 Subject: Run through the coder module and review the code and documentation of the module code. --- video.module | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'video.module') diff --git a/video.module b/video.module index 4cdca77..8d31806 100644 --- a/video.module +++ b/video.module @@ -185,7 +185,8 @@ function video_thumb_process(&$element, &$form_state) { '#weight' => 10, '#attributes' => array('class' => array('video-thumbnails'), 'onchange' => 'videoftp_thumbnail_change()', 'rel' => 'video_large_thumbnail-' . $delta), ); - } else { + } + else { $gen_fail = TRUE; } } @@ -212,9 +213,11 @@ function video_thumb_process(&$element, &$form_state) { // @todo Add smaller video preview instead of thumbnail? if (isset($file['thumbanail']) && !empty($file['thumbanail'])) { $large_thumb = file_load($file['thumbanail']); - } elseif (!empty($field['settings']['default_video_thumbnail']['fid'])) { + } + elseif (!empty($field['settings']['default_video_thumbnail']['fid'])) { $large_thumb = file_load($field['settings']['default_video_thumbnail']['fid']); - } else { + } + else { // $large_thumb = file_load($default_thumb); } // print_r($field['settings']); @@ -363,7 +366,8 @@ function video_widget_element_settings(&$element, &$form_state) { '#description' => t('This will bypass your auto conversion of videos.'), '#attributes' => array('class' => array('video-bypass-auto-conversion')), ); - } else if (variable_get('video_bypass_conversion', FALSE)) { + } + elseif (variable_get('video_bypass_conversion', FALSE)) { $element['bypass_autoconversion'] = array( '#type' => 'value', '#value' => variable_get('video_bypass_conversion', FALSE), @@ -379,7 +383,8 @@ function video_widget_element_settings(&$element, &$form_state) { '#description' => t('This will convert your video to flv format when you save, instead of scheduling it for cron.'), '#attributes' => array('class' => array('video-convert-video-on-save')), ); - } else if (variable_get('video_convert_on_save', FALSE)) { + } + elseif (variable_get('video_convert_on_save', FALSE)) { $element['convert_video_on_save'] = array( '#type' => 'value', '#value' => variable_get('video_convert_on_save', FALSE), @@ -400,7 +405,8 @@ function video_widget_element_settings(&$element, &$form_state) { if ($default_thumb) { $element['use_default_video_thumb']['#attributes']['checked'] = 'checked'; } - } else { + } + else { $element['use_default_video_thumb'] = array( '#type' => 'value', '#value' => $default_thumb, @@ -422,7 +428,8 @@ function _video_dimensions_options(&$options, $video) { //lets check our width and height first if ($aspect_ratio['width'] == $wxh[0] && $aspect_ratio['height'] == $wxh[1]) { $options[$key] = $value . ' ' . t('(Matches Resolution)'); - } else { + } + else { //now lets check our ratio's $ratio = number_format($wxh[0] / $wxh[1], 4); if ($ratio == $aspect_ratio['ratio']) { @@ -636,10 +643,10 @@ function video_explode($delimeter, $dimensions) { function video_format_right($value) { $format = explode("x", $value); if (!isset($format[0]) || !is_numeric(trim($format[0]))) - return false; + return FALSE; if (!isset($format[1]) || !is_numeric(trim($format[1]))) - return false; - return true; + return FALSE; + return TRUE; } /* -- cgit v1.2.3