You are here

function video_settings_form in Video 6.2

Same name and namespace in other branches
  1. 5 video.module \video_settings_form()
  2. 6 video.module \video_settings_form()

Settings Hook

Return value

string of form content or error message

1 string reference to 'video_settings_form'
video_menu in ./video.module
Implementation of hook_menu().

File

./video.module, line 264
video.module

Code

function video_settings_form() {
  global $base_url;
  $form = array();
  $form['menu'] = array(
    '#type' => 'fieldset',
    '#title' => t('General behavior'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $vtypes = video_get_types_infos();
  if ($vtypes) {

    // no vtype available
    $video_types = array();
    foreach ($vtypes as $vtype => $info) {
      $video_types[$vtype] = $info['#name'];
    }
    $video_types[0] = t('No default type');
    $form['menu']['video_default_video_type'] = array(
      '#type' => 'select',
      '#title' => t('Choose default video type'),
      '#default_value' => variable_get('video_default_video_type', 0),
      '#description' => t('For installations that have more than one video type available, this sets the default video type when a user visits node/add/video'),
      '#options' => $video_types,
    );
  }

  // GMM: No longer supported, non-standard use of tab - use download link under video

  /*
    $form['menu']['video_displaydownloadmenutab'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display download menu tab'),
      '#default_value' => variable_get('video_displaydownloadmenutab', 1),
      '#description' => t('Toggle display of menu tab to download video from the node page.')
    );
  */
  $form['menu']['video_in_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display video in node teaser'),
    '#default_value' => variable_get('video_in_teaser', FALSE),
    '#description' => t('Display the video in the node teaser. For instance, when shown on the front page feed'),
  );
  $form['menu']['video_show_help_text'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show help text below video'),
    '#default_value' => variable_get('video_show_help_text', TRUE),
    '#description' => t('Enabling this may help users play the video.'),
  );
  $form['menu']['video_displaydownloadlink'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display download link'),
    '#default_value' => variable_get('video_displaydownloadlink', 1),
    '#description' => t('Toggle display of "download" link (below the node content in most themes).'),
  );
  $form['menu']['video_displayplaytime'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display playtime'),
    '#default_value' => variable_get('video_displayplaytime', 1),
    '#description' => t('Toggle the display of the playtime for a video.'),
  );
  $form['menu']['video_displayfilesize'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display filesize'),
    '#default_value' => variable_get('video_displayfilesize', 1),
    '#description' => t('Toggle the display of the filesize for a video.'),
  );
  $form['menu']['video_autoplay'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically start video on page load'),
    '#default_value' => variable_get('video_autoplay', TRUE),
    '#description' => t('Start the video when the page and video loads'),
  );
  $form['resolutions'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video resolutions'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['resolutions']["video_resolution_width"] = array(
    '#type' => 'textfield',
    '#title' => t("Default width"),
    '#default_value' => variable_get("video_resolution_width", 400),
    '#description' => t('The width which will be used to scale video during playing. This let all videos on the website look the same. <strong>NOTE:</strong> You can disable video scaling making this field blank.'),
  );
  $i = 1;
  while ($i <= 4) {
    $form['resolutions']["video_resolution_{$i}_name"] = array(
      '#type' => 'textfield',
      '#title' => t("Resolution {$i} name"),
      '#default_value' => variable_get("video_resolution_{$i}_name", ''),
    );
    $form['resolutions']["video_resolution_{$i}_value"] = array(
      '#type' => 'textfield',
      '#title' => t("Resolution {$i} value"),
      '#default_value' => variable_get("video_resolution_{$i}_value", ''),
      '#description' => t('The resolution: two numbers representing width and height separated by an "x"'),
    );
    $i++;
  }

  // statistics stuff
  $form['counters'] = array(
    '#type' => 'fieldset',
    '#title' => t('Statistics counters'),
    '#description' => t('To allow users to view counters visit: ') . l(t('access control'), 'admin/user/permissions'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['counters']['video_playcounter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Count play hits'),
    '#default_value' => variable_get('video_playcounter', 1),
    '#description' => t('Counts a hit everytime someone views the play page.'),
  );
  $form['counters']['video_downloadcounter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Count downloads'),
    '#default_value' => variable_get('video_downloadcounter', 1),
    '#description' => t('Counts a hit everytime someone downloads a video.'),
  );

  // Flash Settings
  $form['flash'] = array(
    '#type' => 'fieldset',
    '#title' => t('Flash settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  // check flowplayer commercial module is in active
  $form['flash']['video_flowplayer_module'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use flowplayer module'),
    '#default_value' => variable_get('video_flowplayer_module', FALSE) && module_exists('flowplayer'),
    '#description' => t('You can use flowplayer module. <a href="@link">Download flowplayer module.</a> This is currently recommended for you.', array(
      '@link' => url('http://drupal.org/project/flowplayer'),
    )),
    '#disabled' => module_exists('flowplayer') ? FALSE : TRUE,
  );
  $form['flash']['video_flvplayerloader'] = array(
    '#type' => 'textfield',
    '#title' => t('Filename of Flash loader'),
    '#default_value' => variable_get('video_flvplayerloader', 'FlowPlayer.swf'),
    '#description' => t('The name of the Shockwave file that manages loading the FLV movie. This is relative to the website root. This settings will override if flowplayer module is installed and enabled. Mainly we focus by this settings to add custom flv player support to the video module See includes/common.inc theme_video_play_flash() for further developments.'),
  );
  $form['ogg'] = array(
    '#type' => 'fieldset',
    '#title' => t('Ogg Theora settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['ogg']['video_cortado'] = array(
    '#type' => 'textfield',
    '#title' => t('Filename of Cortado Java Applet'),
    '#default_value' => variable_get('video_cortado', $base_url . '/cortado.jar'),
    '#description' => t('The path to the Cortado Applet to play Ogg Theora Files.'),
  );
  return system_settings_form($form);
}