You are here

function video_embed_field_handler_vimeo_form in Video Embed Field 7.2

Same name and namespace in other branches
  1. 7 video_embed_field.module \video_embed_field_handler_vimeo_form()

Defines the form elements for the Vimeo configuration form.

Parameters

array $defaults: The form default values.

Return value

array The provider settings form array.

1 string reference to 'video_embed_field_handler_vimeo_form'
video_embed_field_video_embed_handler_info in ./video_embed_field.handlers.inc
Implements hook_video_embed_handler_info().

File

./video_embed_field.handlers.inc, line 567
Provide some handlers for video embed field Other modules can implement the hook_video_embed_handler_info to provide more handlers.

Code

function video_embed_field_handler_vimeo_form($defaults) {
  $form = array();
  $form['width'] = array(
    '#type' => 'textfield',
    '#size' => '5',
    '#title' => t('Player Width'),
    '#description' => t('The width of the vimeo player.'),
    '#default_value' => $defaults['width'],
  );
  $form['height'] = array(
    '#type' => 'textfield',
    '#size' => '5',
    '#title' => t('Player Height'),
    '#description' => t('The height of the vimeo player.'),
    '#default_value' => $defaults['height'],
  );
  $form['color'] = array(
    '#type' => 'select',
    '#options' => array(
      '00adef' => t('Blue'),
      'ff9933' => t('Orange'),
      'c9ff23' => t('Lime'),
      'ff0179' => t('Fuschia'),
      'ffffff' => t('White'),
    ),
    '#title' => t('Player Color'),
    '#description' => t('The color to use on the vimeo player.'),
    '#default_value' => $defaults['color'],
  );
  $form['portrait'] = array(
    '#type' => 'checkbox',
    '#title' => t('Overlay Author Thumbnail'),
    '#description' => t("Overlay the author's thumbnail before the video is played."),
    '#default_value' => $defaults['portrait'],
  );
  $form['title'] = array(
    '#type' => 'checkbox',
    '#title' => t("Overlay Video's Title"),
    '#description' => t("Overlay the video's title before the video is played."),
    '#default_value' => $defaults['title'],
  );
  $form['byline'] = array(
    '#type' => 'checkbox',
    '#title' => t("Overlay Video's Byline"),
    '#description' => t("Overlay the video's description before the video is played."),
    '#default_value' => $defaults['byline'],
  );
  $form['overridable'] = array(
    '#prefix' => '<p class="note"><strong>' . t('Note') . ': </strong><em>',
    '#markup' => t('Color, portrait, title and byline can be restricted by Vimeo Plus videos.
      Such videos will ignore these settings.'),
    '#suffix' => '</em></p>',
  );
  $form['autoplay'] = array(
    '#type' => 'checkbox',
    '#title' => t('Autoplay'),
    '#description' => t('Play the video immediately.'),
    '#default_value' => $defaults['autoplay'],
  );
  $form['loop'] = array(
    '#type' => 'checkbox',
    '#title' => t('Loop'),
    '#description' => t("Loop the video's playback"),
    '#default_value' => $defaults['loop'],
  );
  $form['froogaloop'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable froogaloop support'),
    '#description' => t("Enables Froogallop Vimeo's library support"),
    '#default_value' => $defaults['loop'],
  );
  $form['class'] = array(
    '#type' => 'textfield',
    '#title' => t('Player CSS class'),
    '#description' => t('CSS class to add to the player'),
    '#default_value' => $defaults['class'],
  );
  return $form;
}