diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/video_ui/video.admin.inc | 3 | ||||
-rw-r--r-- | modules/video_ui/video.preset.inc | 55 | ||||
-rw-r--r-- | modules/video_zencoder/includes/zencoder.inc | 17 | ||||
-rw-r--r-- | modules/video_zencoder/transcoders/video_zencoder.inc | 8 | ||||
-rw-r--r-- | modules/video_zencoder/video_zencoder.module | 3 |
5 files changed, 47 insertions, 39 deletions
diff --git a/modules/video_ui/video.admin.inc b/modules/video_ui/video.admin.inc index 2f1c94b..12778e4 100644 --- a/modules/video_ui/video.admin.inc +++ b/modules/video_ui/video.admin.inc @@ -122,7 +122,8 @@ function video_players_admin_settings() { '#prefix' => '<div class="admin_flv_player_wrapper" id="flv_player_' . $ext . '">', '#suffix' => '</div>', ); - } else { + } + else { $form['extensions']['video_extension_' . $ext . '_flash_player'] = array( '#type' => 'markup', '#markup' => t('No flash players detected.<br />You need to install !swf_tools or !flowplayer.', array('!swf_tools' => l(t('SWF Tools'), 'http://www.drupal.org/project/swftools'), '!flowplayer' => l(t('Flowplayer'), 'http://www.drupal.org/project/flowplayer'))), diff --git a/modules/video_ui/video.preset.inc b/modules/video_ui/video.preset.inc index e9ff011..f4ecd78 100644 --- a/modules/video_ui/video.preset.inc +++ b/modules/video_ui/video.preset.inc @@ -45,7 +45,7 @@ function video_preset_default_form($form, &$form_state, $preset) { '#collapsed' => FALSE ); $video_extension = array(); - foreach (video_video_extensions () as $extension => $theme) { + foreach (video_video_extensions() as $extension => $theme) { $video_extension[$extension] = $extension; } $form['settings']['video']['video_extension'] = array( @@ -202,7 +202,7 @@ function video_preset_default_form($form, &$form_state, $preset) { $form['settings']['adv_video']['one_pass'] = array( '#type' => 'checkbox', '#title' => t('One pass'), - '#description' => t('Force one-pass encoding when targeting a specific video_bitrate. True or False.'), + '#description' => t('Force one-pass encoding when targeting a specific video_bitrate. TRUE or FALSE.'), '#default_value' => !empty($preset['settings']['one_pass']) ? $preset['settings']['one_pass'] : '' ); $form['settings']['adv_video']['skip_video'] = array( @@ -366,10 +366,10 @@ function video_presets_overview() { $rows[] = $row; } return theme('table', array('header' => $header, 'rows' => $rows)); - } else { + } + else { return t('No Preset were found. Please use the !create_link link to create - a new video preset, or upload an existing Feature to your modules directory.', - array('!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))); + a new video preset, or upload an existing Feature to your modules directory.', array('!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))); } } @@ -380,7 +380,7 @@ function video_presets_overview() { * @param <type> $preset * @return string */ -function video_preset_form($form, &$form_state, $preset = false) { +function video_preset_form($form, &$form_state, $preset = FALSE) { $form = array(); // basic preset details $form['preset'] = array( @@ -393,7 +393,8 @@ function video_preset_form($form, &$form_state, $preset = false) { '#type' => 'value', '#value' => $preset['pid'], ); - } elseif (video_is_default_preset($preset['name'])) { + } + elseif (video_is_default_preset($preset['name'])) { $form['preset']['default'] = array( '#type' => 'value', '#value' => TRUE, @@ -445,7 +446,7 @@ function video_preset_form($form, &$form_state, $preset = false) { * Validation for the preset form. */ function video_preset_validate($form, &$form_state) { - + } /** @@ -459,7 +460,8 @@ function video_preset_array_flatten($array, $return=array()) { foreach ($array as $key => $value) { if (is_array($value)) { $return = video_preset_array_flatten($value, $return); - } else { + } + else { $return[$key] = $value; } } @@ -477,11 +479,7 @@ function video_preset_submit($form, &$form_state) { $preset['name'] = $form_state['values']['name']; $preset['description'] = $form_state['values']['description']; // unset unwanted values saved to database - unset($form_state['values']['pid'], $form_state['values']['name'], - $form_state['values']['description'], $form_state['values']['submit'], - $form_state['values']['delete'], $form_state['values']['form_build_id'], - $form_state['values']['form_token'], $form_state['values']['form_id'], - $form_state['values']['op']); + unset($form_state['values']['pid'], $form_state['values']['name'], $form_state['values']['description'], $form_state['values']['submit'], $form_state['values']['delete'], $form_state['values']['form_build_id'], $form_state['values']['form_token'], $form_state['values']['form_id'], $form_state['values']['op']); $preset['settings'] = video_preset_array_flatten($form_state['values']); // Save this preset. @@ -568,7 +566,8 @@ function video_preset_import_validate($form, &$form_state) { if ($error = video_validate_preset_name($name)) { form_set_error('name', $error); } - } else { + } + else { form_set_error('name', 'Invalid preset import.'); } @@ -593,7 +592,7 @@ function video_preset_export_form($form, &$form_state, $preset) { unset($preset['default']); // Get the code string representation. - $code = var_export($preset, true); + $code = var_export($preset, TRUE); // Make sure to format the arrays like drupal. $code = str_replace("=> \n ", '=> ', $code); @@ -663,9 +662,9 @@ function video_preset_get_presets() { // Get all the presets from the database. $result = db_select('video_preset', 'p') - ->fields('p') - ->orderBy('p.name', 'ASC') - ->execute(); + ->fields('p') + ->orderBy('p.name', 'ASC') + ->execute(); // Iterate through all the presets and structure them in an array. foreach ($result as $preset) { @@ -676,7 +675,7 @@ function video_preset_get_presets() { } // Now allow other modules to add their default presets. - foreach (video_preset_get_default_presets () as $preset) { + foreach (video_preset_get_default_presets() as $preset) { // adding default TRUE $preset['default'] = TRUE; if (!empty($preset['name']) && !isset($normal_presets[$preset['name']])) { @@ -693,13 +692,14 @@ function video_preset_get_presets() { function video_get_preset($preset_name) { // Get the preset from the database. $preset = db_select('video_preset', 'p') - ->fields('p') - ->condition('p.name', $preset_name) - ->execute() - ->fetchAssoc(); + ->fields('p') + ->condition('p.name', $preset_name) + ->execute() + ->fetchAssoc(); if ($preset) { $preset['settings'] = $preset['settings'] ? unserialize($preset['settings']) : array(); - } else { + } + else { // Get all of the default presets. $default_presets = video_preset_get_default_presets(); @@ -737,8 +737,9 @@ function video_preset_name_exists($preset_name) { // See if there is a default preset name. if ($default_presets && isset($default_presets[$preset_name])) { - return true; - } else { + return TRUE; + } + else { return (bool) db_select('video_preset', 'p') ->fields('p') ->condition('p.name', $preset_name) diff --git a/modules/video_zencoder/includes/zencoder.inc b/modules/video_zencoder/includes/zencoder.inc index 09109a2..f898479 100644 --- a/modules/video_zencoder/includes/zencoder.inc +++ b/modules/video_zencoder/includes/zencoder.inc @@ -180,16 +180,17 @@ class video_zencoder_api { // Check if it worked if ($encoding_job->created) { return $encoding_job; - } else { + } + else { foreach ($encoding_job->errors as $error) { watchdog('zencoder', 'Zencoder reports some errors. !error', array('!error' => $error), WATCHDOG_ERROR); } - return false; + return FALSE; } } /* - * Verifies the existence of a file id, returns the row or false if none found. + * Verifies the existence of a file id, returns the row or FALSE if none found. */ public function load_job($jobid) { @@ -209,7 +210,7 @@ class video_zencoder_api { $request = new ZencoderRequest( 'https://app.zencoder.com/api/account', - false, // API key isn't needed for new account creation + FALSE, // API key isn't needed for new account creation array( "terms_of_service" => "1", "email" => $user->email, @@ -223,14 +224,16 @@ class video_zencoder_api { $message = drupal_mail('video_zencoder', 'video_zencoder', $user->email, language_default(), $results); if (!$message['result']) { drupal_set_message(t('Unable to send e-mail!. Your Zencoder Details are as below.<br/> <b>API Key</b> : !api_key<br/> <b>Password</b> : !password<br/>', array('!api_key' => $results['api_key'], '!password' => $results['password'])), 'status'); - } else { + } + else { // drupal_mail('video_zencoder', 'video_zencoder', 'heshanmw@gmail.com', language_default(), $results); drupal_set_message(t('Your account has been created and is ready to start processing on Zencoder')); } // return $request->results; - return true; + return TRUE; // variable_set('video_zencoder_api_key', ''); - } else { + } + else { $errors = ''; foreach ($request->errors as $error) { if ($error == 'Email has already been taken') { diff --git a/modules/video_zencoder/transcoders/video_zencoder.inc b/modules/video_zencoder/transcoders/video_zencoder.inc index e629155..eb93fba 100644 --- a/modules/video_zencoder/transcoders/video_zencoder.inc +++ b/modules/video_zencoder/transcoders/video_zencoder.inc @@ -100,7 +100,8 @@ class video_zencoder implements transcoder_interface { if ($this->update($video)) { watchdog('zencoder', t('Successfully created trancoding job on !jobid.', array('!jobid' => $video->jobid)), array(), WATCHDOG_INFO); } - } else { + } + else { watchdog('zencoder', 'Failed to queus our file to Zencoder.', array(), WATCHDOG_ERROR); $this->change_status($video->vid, VIDEO_RENDERING_FAILED); return FALSE; @@ -168,7 +169,8 @@ class video_zencoder implements transcoder_interface { '#title' => t('Agree Zencoder !link.', array('!link' => l(t('Terms and Conditions'), 'http://zencoder.com/terms', array('attributes' => array('target' => '_blank'))))), '#default_value' => variable_get('agree_terms_zencoder', TRUE), ); - } else { + } + else { // Zencoder API is exists $form['zencoder_info'] = array( '#type' => 'fieldset', @@ -237,7 +239,7 @@ class video_zencoder implements transcoder_interface { $user = new stdClass; $user->email = $email; $result = $zc->create_user($user); - if ($result !== true) + if ($result !== TRUE) form_set_error('zencoder_username', $result); } } diff --git a/modules/video_zencoder/video_zencoder.module b/modules/video_zencoder/video_zencoder.module index 93735c0..2343bc8 100644 --- a/modules/video_zencoder/video_zencoder.module +++ b/modules/video_zencoder/video_zencoder.module @@ -100,7 +100,8 @@ function _video_zencoder_postback_jobs() { // echo 'working failed'; $zc->change_status($vid, VIDEO_RENDERING_FAILED); watchdog('zencoder', t('Zencoder job failed converting videos, please login to zencoder web and check the erros.', array()), NULL, WATCHDOG_ERROR); - } else { + } + else { echo 'zencoder postback is working'; } } |