You are here

function youtube_settings_form in YouTube Field 7

Settings form for the YouTube Field module's configuration page.

1 string reference to 'youtube_settings_form'
youtube_menu in ./youtube.module
Implements hook_menu().

File

./youtube.module, line 64

Code

function youtube_settings_form($form) {
  $form = array();
  $form['text'] = array(
    '#type' => 'markup',
    '#markup' => '<p>' . t('The following settings will be used as default values on all YouTube video fields.  More settings can be altered in the display settings of individual fields.') . '</p>',
  );
  $form['youtube_global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video parameters'),
  );
  $form['youtube_global']['youtube_suggest'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show suggested videos from any channel - as opposed to only the same channel - when playback ends (rel).'),
    '#default_value' => variable_get('youtube_suggest', TRUE),
  );
  $form['youtube_global']['youtube_modestbranding'] = array(
    '#type' => 'checkbox',
    '#title' => t('Do not show YouTube logo on video player (modestbranding).'),
    '#default_value' => variable_get('youtube_modestbranding', FALSE),
  );
  $form['youtube_global']['youtube_theme'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use a light colored control bar for video player controls
      (theme).'),
    '#default_value' => variable_get('youtube_theme', FALSE),
  );
  $form['youtube_global']['youtube_color'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use a white colored video progress bar (color).'),
    '#default_value' => variable_get('youtube_color', FALSE),
    '#description' => t('Note: the modestbranding parameter will be ignored when this is in use.'),
  );
  $form['youtube_global']['youtube_enablejsapi'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable use of the IFrame API (enablejsapi, origin).'),
    '#default_value' => variable_get('youtube_enablejsapi', FALSE),
    '#description' => t('For more information on the IFrame API and how to use it, see the <a href="@api_reference">IFrame API documentation</a>.', array(
      '@api_reference' => 'https://developers.google.com/youtube/js_api_reference',
    )),
  );
  $form['youtube_global']['youtube_wmode'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fix overlay problem in IE (wmode).'),
    '#default_value' => variable_get('youtube_wmode', TRUE),
    '#description' => t("Checking this will fix the issue of a YouTube video showing above elements with fixed or absolute positioning (including Drupal's Overlay and Toolbar)."),
  );
  $form['youtube_global']['youtube_override'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow users to override parameters.'),
    '#default_value' => variable_get('youtube_override', FALSE),
    '#description' => t('This will allow users to pass parameter values into the YouTube URL provided in the field input. For example, adding "&start=30" to the end of the URL would start the embedded video at the 30 second mark. This may have unintended side effects if parameter values are ever passed by accident.'),
  );
  $form['youtube_thumbs'] = array(
    '#type' => 'fieldset',
    '#title' => t('Thumbnails'),
  );
  $form['youtube_thumbs']['youtube_thumb_dir'] = array(
    '#type' => 'textfield',
    '#title' => t('YouTube thumbnail directory'),
    '#field_prefix' => variable_get('file_public_path', conf_path() . '/files') . '/',
    '#field_suffix' => '/thumbnail.jpg',
    '#description' => t('Location, within the files directory, where you would like the YouTube thumbnails stored.'),
    '#default_value' => variable_get('youtube_thumb_dir', 'youtube'),
  );
  $form['youtube_thumbs']['youtube_thumb_hires'] = array(
    '#type' => 'checkbox',
    '#title' => t('Save higher resolution thumbnail images'),
    '#description' => t('This will save thumbnails larger than the default size, 480x360, to the thumbnails directory specified above.'),
    '#default_value' => variable_get('youtube_thumb_hires', FALSE),
  );
  $form['youtube_thumbs']['youtube_thumb_token_image_style'] = array(
    '#type' => 'select',
    '#options' => image_style_options(TRUE, PASS_THROUGH),
    '#title' => t('Default token image style'),
    '#description' => t('Default image style for the output of a youtube_image_url token.'),
    '#default_value' => variable_get('youtube_thumb_token_image_style', NULL),
  );
  $form['youtube_thumbs']['youtube_thumb_delete_all'] = array(
    '#type' => 'submit',
    '#value' => t('Refresh existing thumbnail image files'),
    '#submit' => array(
      'youtube_thumb_delete_all',
    ),
  );
  $form['youtube_privacy'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable privacy-enhanced mode.'),
    '#default_value' => variable_get('youtube_privacy', FALSE),
    '#description' => t('Checking this box will prevent YouTube from setting cookies in your site visitors browser.'),
  );
  $form['youtube_player_class'] = array(
    '#type' => 'textfield',
    '#title' => t('YouTube player class'),
    '#default_value' => variable_get('youtube_player_class', 'youtube-field-player'),
    '#description' => t('The iframe of every player will be given this class. They will also be given IDs based off of this value.'),
  );
  return system_settings_form($form);
}