You are here

function video_ffmpeg_helper_form_alter in Video 6

Same name and namespace in other branches
  1. 5 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_form_alter()
  2. 6.2 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_form_alter()

Implementation of hook_form_alter()

File

plugins/video_ffmpeg_helper/video_ffmpeg_helper.module, line 227
Provide some api for use ffmpeg. Simplify video nodes creation.

Code

function video_ffmpeg_helper_form_alter(&$form, &$form_state, $form_id) {
  $node = $form['#node'];

  //print_r($form);
  if ($form_id == 'video_node_form') {
    if (function_exists('_image_check_settings')) {
      _image_check_settings();
      $form['#attributes'] = array(
        "enctype" => "multipart/form-data",
      );
    }
    if ($node->vtype == 'upload' && user_access('bypass automatic video conversion') && variable_get('video_ffmpeg_helper_auto_conversion', false)) {
      $form['video']['video_ffmpeg_helper_convertion_bypass'] = array(
        '#type' => 'checkbox',
        '#title' => t('Bypass automatic video conversion'),
        '#description' => t('Check this if you want that your video is submitted as it is, without being converted.'),
        '#default_value' => $node->video_ffmpeg_helper_convertion_bypass,
      );
    }
  }
}